Page MenuHomePhabricator

simplify generate_user_files.py options
Closed, ResolvedPublic

Description

I think we can safely remove some questions:

  • Your default user directory is "/home/valhallasw/src/pywikibot-core" Do you want to use that directory? ([y]es, [N]o)

(assume 'yes', but the path should be mentioned)

  • Do you want to copy user files from an existing Pywikibot installation? ([y]es, [n]o)

(assume 'no', if the user wants to do so, they can do so manually)

  • Create user-config.py file? Required for running bots. ([y]es, [N]o)

(assume 'yes', because otherwise these questions are useless)

  • Would you like the extended version of user-config.py, with explanations included? ([y]es, [n]o)

(assume 'yes'; I see no reason not to create the extended version)

  • Create user-fixes.py file? Optional and for advanced users. ([y]es, [N]o)

(the entire user-fixes.py creation should be removed, and replaced by either an example file or a documentation page)

This reduces the script to three questions:

  1. what family
  2. what lang
  3. what username

We might want to add a note 'You can abort at any time by pressing ctrl-c' in the beginning, as well as a note 'you can re-run this configuration script by running generate_user_files.py'.

Event Timeline

valhallasw raised the priority of this task from to Needs Triage.
valhallasw updated the task description. (Show Details)
valhallasw added a project: Pywikibot.
valhallasw subscribed.

I'm not sure about user-fixes.py, because those are not needed in all cases and except for creating a file this isn't something special (unlike the config which is dynamically).

valhallasw triaged this task as Medium priority.Jan 29 2015, 9:37 PM
valhallasw added a project: good first task.

@XZise: true, but we don't bundle an example file one could copy easily. I also don't see the damage in just creating it.

IMO it is better to have no user-fixes , than have a file which only has an example in it. replace.py could report that no user-fixes exists, and we could have a create_fix.py (maintenance?) script which guides the user through creating a fix and adding it to the relevant file.

here is a fix for that one!

@Parvjain1 it would be better to use gerrit so that the code change can be attributed to you (by git itself).

jayvdb renamed this task from simplify generate_user_config.py options to simplify generate_user_files.py options.Jun 9 2015, 6:13 AM

Attached file is out of date. @Parvjain1, if you want to resume working on this, please submit the change into Gerrit

AndyTechGuy subscribed.

I have accepted this task on the GCI website.

Change 263233 had a related patch set uploaded (by AndyTechGuy):
Simplify generate_user_files.py options

https://gerrit.wikimedia.org/r/263233

Your default user directory is "/home/valhallasw/src/pywikibot-core" Do you want to use that directory? ([y]es, [N]o)

(assume 'yes', but the path should be mentioned)

Regarding the current patch, I am worried that this one wasnt clearly specified. base_dir (printed above) is determined by pywikibot. If someone has a user-config.py in ~/.pywikibot and they wish to create a new user-config.py in the current directory, they will be told that ~/.pywikibot/user-config.py exists. There needs to be a way to alter the directory.

I believe the "assume 'yes'" means that if there is no user-config.py in base_dir, the script should proceed automatically. If there is a user-config.py in base_dir, the user should be given an option to change the target directory.

Change 263233 merged by jenkins-bot:
Simplify generate_user_files.py options

https://gerrit.wikimedia.org/r/263233