Index: trunk/tools/editor_trends/manage.py |
— | — | @@ -49,33 +49,33 @@ |
50 | 50 | return choices |
51 | 51 | |
52 | 52 | |
53 | | -def config_launcher(properties, logger): |
| 53 | +def config_launcher(rts, logger): |
54 | 54 | ''' |
55 | 55 | Config launcher is used to reconfigure editor trends toolkit. |
56 | 56 | ''' |
57 | 57 | # settings.load_configuration() |
58 | 58 | pc = projects.ProjectContainer() |
59 | | - if not os.path.exists('wiki.cfg') or properties.force: |
| 59 | + if not os.path.exists('wiki.cfg') or rts.force: |
60 | 60 | config = ConfigParser.RawConfigParser() |
61 | 61 | project = None |
62 | 62 | language = None |
63 | 63 | #language_map = languages.language_map() |
64 | 64 | working_directory = raw_input('Please indicate where you installed Editor Trends Analytics.\nCurrent location is %s\nPress Enter to accept default.\n' % os.getcwd()) |
65 | | - input_location = raw_input('Please indicate where to store the Wikipedia dump files.\nDefault is: %s\nPress Enter to accept default.\n' % settings.input_location) |
| 65 | + input_location = raw_input('Please indicate where to store the Wikipedia dump files.\nDefault is: %s\nPress Enter to accept default.\n' % rts.input_location) |
66 | 66 | |
67 | 67 | while project not in pc.projects.keys(): |
68 | | - project = raw_input('Please indicate which project you would like to analyze.\nDefault is: %s\nPress Enter to accept default.\n' % pc.projects[properties.project.name]) |
69 | | - project = project if len(project) > 0 else properties.project.name |
| 68 | + project = raw_input('Please indicate which project you would like to analyze.\nDefault is: %s\nPress Enter to accept default.\n' % rts.project.full_name) |
| 69 | + project = project if len(project) > 0 else rts.project.name |
70 | 70 | if project not in pc.projects.keys(): |
71 | 71 | print 'Valid choices for a project are: %s' % ','.join(pc.projects.keys()) |
72 | 72 | |
73 | | - while language not in properties.project.valid_languages: |
74 | | - language = raw_input('Please indicate which language of project %s you would like to analyze.\nDefault is: %s\nPress Enter to accept default.\n' % (pc.projects[project], properties.language)) |
| 73 | + while language not in rts.project.valid_languages: |
| 74 | + language = raw_input('Please indicate which language of project %s you would like to analyze.\nDefault is: %s\nPress Enter to accept default.\n' % (rts.project.full_name, rts.language)) |
75 | 75 | if len(language) == 0: |
76 | | - language = properties.language.code |
77 | | - language = language if language in properties.project.valid_languages else properties.language |
| 76 | + language = rts.language.code |
| 77 | + language = language if language in rts.project.valid_languages else rts.language.default |
78 | 78 | |
79 | | - input_location = input_location if len(input_location) > 0 else settings.input_location |
| 79 | + input_location = input_location if len(input_location) > 0 else rts.input_location |
80 | 80 | working_directory = working_directory if len(working_directory) > 0 else os.getcwd() |
81 | 81 | |
82 | 82 | config = ConfigParser.RawConfigParser() |
— | — | @@ -90,8 +90,8 @@ |
91 | 91 | config.write(fh) |
92 | 92 | fh.close() |
93 | 93 | |
94 | | - settings.working_directory = config.get('file_locations', 'working_directory') |
95 | | - settings.input_location = config.get('file_locations', 'input_location') |
| 94 | + rts.working_directory = config.get('file_locations', 'working_directory') |
| 95 | + rts.input_location = config.get('file_locations', 'input_location') |
96 | 96 | |
97 | 97 | |
98 | 98 | |
Index: trunk/tools/editor_trends/requirements.txt |
— | — | @@ -4,3 +4,4 @@ |
5 | 5 | pymongo==1.9 |
6 | 6 | argparse |
7 | 7 | python-dateutil |
| 8 | +texttable |
\ No newline at end of file |