add int variables int the rougail user data #1

Open
opened 2024-09-04 09:58:57 +02:00 by gremond · 0 comments
Member

When using a non-string variable, for example this one:

varname23:
  type: number
  #multi: true
  default:
    - 1
    - 2

The rougail CLI script fails like this :

Traceback (most recent call last):
  File "/home/ubuntu/workplace/./rougail-cli/bin/rougail", line 7, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/ubuntu/workplace/rougail/src/rougail/cli/__main__.py", line 43, in main
    module.run(rougailconfig,
  File "/home/ubuntu/workplace/rougail/src/rougail/user_data_questionary/cli.py", line 32, in run
    ).run()
      ^^^^^
  File "/home/ubuntu/workplace/rougail/src/rougail/user_data_questionary/data.py", line 69, in run
    self.parse(self.config)
  File "/home/ubuntu/workplace/rougail/src/rougail/user_data_questionary/data.py", line 78, in parse
    self.display_questionary(option)
  File "/home/ubuntu/workplace/rougail/src/rougail/user_data_questionary/data.py", line 111, in display_questionary
    kwargs['default'] = "\n".join(default)
                        ^^^^^^^^^^^^^^^^^^
TypeError: sequence item 0: expected str instance, int found
When using a non-string variable, for example this one: ```version: 1.1 varname23: type: number #multi: true default: - 1 - 2 ``` The rougail CLI script fails like this : ```./rougail-cli/bin/rougail -m dict --step.user_data questionary Traceback (most recent call last): File "/home/ubuntu/workplace/./rougail-cli/bin/rougail", line 7, in <module> sys.exit(main()) ^^^^^^ File "/home/ubuntu/workplace/rougail/src/rougail/cli/__main__.py", line 43, in main module.run(rougailconfig, File "/home/ubuntu/workplace/rougail/src/rougail/user_data_questionary/cli.py", line 32, in run ).run() ^^^^^ File "/home/ubuntu/workplace/rougail/src/rougail/user_data_questionary/data.py", line 69, in run self.parse(self.config) File "/home/ubuntu/workplace/rougail/src/rougail/user_data_questionary/data.py", line 78, in parse self.display_questionary(option) File "/home/ubuntu/workplace/rougail/src/rougail/user_data_questionary/data.py", line 111, in display_questionary kwargs['default'] = "\n".join(default) ^^^^^^^^^^^^^^^^^^ TypeError: sequence item 0: expected str instance, int found ```
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: stove/rougail-user-data-questionary#1
No description provided.