Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow passing in a custom lexer #70

Merged
merged 1 commit into from
Oct 14, 2020
Merged

Commits on Oct 5, 2020

  1. Allow passing in a custom lexer

    I want to use pygments lexers when asking i.e. for YAML or JSON input.
    
    If doing it right now, I get this error:
    
    ```
    Traceback (most recent call last):
      File "/var/home/yajo/prodevel/copier/.venv/bin/copier", line 5, in <module>
        CopierApp.run()
      File "/var/home/yajo/prodevel/copier/.venv/lib/python3.8/site-packages/plumbum/cli/application.py", line 577, in run
        inst, retcode = subapp.run(argv, exit=False)
      File "/var/home/yajo/prodevel/copier/.venv/lib/python3.8/site-packages/plumbum/cli/application.py", line 572, in run
        retcode = inst.main(*tailargs)
      File "/var/home/yajo/prodevel/copier/copier/cli.py", line 38, in _wrapper
        return method(*args, **kwargs)
      File "/var/home/yajo/prodevel/copier/copier/cli.py", line 262, in main
        self.parent._copy(
      File "/var/home/yajo/prodevel/copier/copier/cli.py", line 173, in _copy
        return copy(
      File "/var/home/yajo/prodevel/copier/copier/main.py", line 135, in copy
        conf = make_config(**locals())
      File "/var/home/yajo/prodevel/copier/copier/config/factory.py", line 141, in make_config
        init_args["data_from_asking_user"] = query_user_data(
      File "/var/home/yajo/prodevel/copier/copier/config/user_data.py", line 497, in query_user_data
        return questionary.get_answers()
      File "/var/home/yajo/prodevel/copier/copier/config/user_data.py", line 360, in get_answers
        self.answers_user = prompt(
      File "/var/home/yajo/prodevel/copier/.venv/lib/python3.8/site-packages/questionary/prompt.py", line 95, in prompt
        question = create_question_func(**_kwargs)
      File "/var/home/yajo/prodevel/copier/.venv/lib/python3.8/site-packages/questionary/prompts/text.py", line 75, in text
        p = PromptSession(
    TypeError: type object got multiple values for keyword argument 'lexer'
    ```
    
    This should fix it.
    yajo committed Oct 5, 2020
    Configuration menu
    Copy the full SHA
    4c54853 View commit details
    Browse the repository at this point in the history