Index: trunk/tools/editor_trends/manage.py |
— | — | @@ -191,6 +191,7 @@ |
192 | 192 | stopwatch = timer.Timer() |
193 | 193 | log.log_to_mongo(properties, 'dataset', 'export', stopwatch, event='start') |
194 | 194 | |
| 195 | + collection = '%s_%s' % (properties.collection, 'dataset') |
195 | 196 | for target in properties.targets: |
196 | 197 | # write_message_to_log(logger, settings, |
197 | 198 | # message=None, |
— | — | @@ -198,8 +199,9 @@ |
199 | 200 | # target=target, |
200 | 201 | # dbname=properties.full_project, |
201 | 202 | # collection=properties.collection) |
| 203 | + |
202 | 204 | analyzer.generate_chart_data(properties.project.name, |
203 | | - properties.collection, |
| 205 | + collection, |
204 | 206 | properties.language.code, |
205 | 207 | target, |
206 | 208 | **properties.keywords) |
— | — | @@ -252,7 +254,7 @@ |
253 | 255 | (sort_launcher, 'sort'), |
254 | 256 | (store_launcher, 'store'), |
255 | 257 | (transformer_launcher, 'transform'), |
256 | | - (exporter_launcher, 'export'))) |
| 258 | + (dataset_launcher, 'dataset'))) |
257 | 259 | |
258 | 260 | for function, callname in functions.iteritems(): |
259 | 261 | if callname not in properties.ignore: |
— | — | @@ -299,7 +301,7 @@ |
300 | 302 | action='store', |
301 | 303 | help='Enter the first letter of a language to see which languages are \ |
302 | 304 | available.') |
303 | | - parser_languages.set_defaults(func=show_languages) |
| 305 | + parser_languages.set_defaults(func=language.show_languages(settings, project)) |
304 | 306 | |
305 | 307 | #CONFIG |
306 | 308 | parser_config = subparsers.add_parser('config', |
Index: trunk/tools/editor_trends/configuration.py |
— | — | @@ -64,11 +64,9 @@ |
65 | 65 | class Settings: |
66 | 66 | __metaclass__ = Singleton |
67 | 67 | |
68 | | - def __init__(self, debug=True, process_multiplier=1, **kwargs): |
| 68 | + def __init__(self, process_multiplier=1, **kwargs): |
69 | 69 | self.minimum_python_version = (2, 6) |
70 | 70 | self.detect_python_version() |
71 | | - self.debug = debug |
72 | | - self.progressbar = True |
73 | 71 | self.encoding = 'utf-8' |
74 | 72 | |
75 | 73 | #Date format as used by Erik Zachte |
— | — | @@ -98,11 +96,10 @@ |
99 | 97 | self.max_filehandles = self.determine_max_filehandles_open() |
100 | 98 | self.tab_width = 4 if self.platform == 'Windows' else 8 |
101 | 99 | |
102 | | - self.load_configuration() |
103 | | - self.set_custom_settings(**kwargs) |
104 | 100 | |
105 | 101 | |
106 | 102 | self.input_location = os.path.join(self.root, 'wikimedia') |
| 103 | + self.load_configuration() |
107 | 104 | # Default Input file |
108 | 105 | self.input_filename = os.path.join(self.input_location, 'en', |
109 | 106 | 'wiki', |
— | — | @@ -115,8 +112,7 @@ |
116 | 113 | self.dataset_location = os.path.join(self.working_directory, 'datasets') |
117 | 114 | self.binary_location = os.path.join(self.working_directory, |
118 | 115 | 'data', 'objects') |
119 | | - self.namespace_location = os.path.join(self.working_directory, |
120 | | - 'namespaces') |
| 116 | + |
121 | 117 | self.chart_location = os.path.join(self.working_directory, 'statistics', |
122 | 118 | 'charts') |
123 | 119 | self.file_choices = ('stub-meta-history.xml.gz', |
— | — | @@ -124,10 +120,6 @@ |
125 | 121 | 'pages-meta-history.xml.7z', |
126 | 122 | 'pages-meta-current.xml.bz2',) |
127 | 123 | |
128 | | - def set_custom_settings(self, **kwargs): |
129 | | - for kw in kwargs: |
130 | | - setattr(self, kw, kwargs[kw]) |
131 | | - |
132 | 124 | def load_configuration(self): |
133 | 125 | if os.path.exists(os.path.join(self.working_directory, 'wiki.cfg')): |
134 | 126 | config = ConfigParser.RawConfigParser() |
— | — | @@ -157,10 +149,10 @@ |
158 | 150 | return platform.system() |
159 | 151 | |
160 | 152 | def verify_environment(self, directories): |
161 | | - for dir in directories: |
162 | | - if not os.path.exists(dir): |
| 153 | + for directory in directories: |
| 154 | + if not os.path.exists(directory): |
163 | 155 | try: |
164 | | - os.makedirs(dir) |
| 156 | + os.makedirs(directory) |
165 | 157 | except IOError: |
166 | 158 | raise 'Configuration Error, could not create directory.' |
167 | 159 | |
Index: trunk/tools/editor_trends/cronjobs.py |
— | — | @@ -17,6 +17,7 @@ |
18 | 18 | __date__ = '2010-10-21' |
19 | 19 | __version__ = '0.1' |
20 | 20 | |
| 21 | +import time |
21 | 22 | from multiprocessing import Process |
22 | 23 | |
23 | 24 | import manage as manager |
— | — | @@ -107,5 +108,8 @@ |
108 | 109 | launcher() |
109 | 110 | |
110 | 111 | |
| 112 | + |
111 | 113 | if __name__ == '__main__': |
112 | | - debug() |
| 114 | + while True: |
| 115 | + launcher() |
| 116 | + time.sleep(5 * 60) |