Mercurial > p > roundup > code
comparison roundup/scripts/roundup_demo.py @ 5401:4cf48ff01e04
Python 3 preparation: replace raw_input uses.
The existing my_input in roundup/admin.py is moved to a new
roundup/anypy/my_input.py, which is then used in more places. Manual
patch.
| author | Joseph Myers <jsm@polyomino.org.uk> |
|---|---|
| date | Tue, 24 Jul 2018 23:47:10 +0000 |
| parents | 86ef4ab17dc5 |
| children | d09a1d6a3bd9 |
comparison
equal
deleted
inserted
replaced
| 5400:2120f77554d5 | 5401:4cf48ff01e04 |
|---|---|
| 22 # --/ | 22 # --/ |
| 23 | 23 |
| 24 | 24 |
| 25 from roundup import admin, configuration, demo, instance | 25 from roundup import admin, configuration, demo, instance |
| 26 from roundup.i18n import _ | 26 from roundup.i18n import _ |
| 27 from roundup.anypy.my_input import my_input | |
| 27 | 28 |
| 28 def run(): | 29 def run(): |
| 29 home = DEFAULT_HOME | 30 home = DEFAULT_HOME |
| 30 template = DEFAULT_TEMPLATE | 31 template = DEFAULT_TEMPLATE |
| 31 nuke = sys.argv[-1] == 'nuke' | 32 nuke = sys.argv[-1] == 'nuke' |
| 41 else: | 42 else: |
| 42 backend = 'anydbm' | 43 backend = 'anydbm' |
| 43 # FIXME: i'd like to have an option to abort the tracker creation | 44 # FIXME: i'd like to have an option to abort the tracker creation |
| 44 # say, by entering a single dot. but i cannot think of | 45 # say, by entering a single dot. but i cannot think of |
| 45 # appropriate prompt for that. | 46 # appropriate prompt for that. |
| 46 home = raw_input( | 47 home = my_input( |
| 47 _('Enter directory path to create demo tracker [%s]: ') % home) | 48 _('Enter directory path to create demo tracker [%s]: ') % home) |
| 48 if not home: | 49 if not home: |
| 49 home = DEFAULT_HOME | 50 home = DEFAULT_HOME |
| 50 templates = admin.AdminTool().listTemplates().keys() | 51 templates = admin.AdminTool().listTemplates().keys() |
| 51 template = raw_input( | 52 template = my_input( |
| 52 _('Enter tracker template to use (one of (%s)) [%s]: ') % | 53 _('Enter tracker template to use (one of (%s)) [%s]: ') % |
| 53 (','.join(templates),template)) | 54 (','.join(templates),template)) |
| 54 if not template: | 55 if not template: |
| 55 template = DEFAULT_TEMPLATE | 56 template = DEFAULT_TEMPLATE |
| 56 # install | 57 # install |
