Index: trunk/tools/editor_trends/classes/projects.py |
— | — | @@ -40,7 +40,8 @@ |
41 | 41 | lang = lnc.init_languages[lang] |
42 | 42 | if lang in self.valid_languages: |
43 | 43 | if output == 'parser': |
44 | | - choices.append(lnc.languages.get(lang, 'Unknown language')) |
| 44 | + lang = lnc.languages.get(lang, 'Unknown language') |
| 45 | + choices.append(lang.name) |
45 | 46 | elif output == 'django': |
46 | 47 | lang = lnc.languages.get(lang, languages.Language('Unknown language', lang, None)) |
47 | 48 | choices.append((lang.code, lang.name)) |
Index: trunk/tools/editor_trends/classes/exceptions.py |
— | — | @@ -61,3 +61,11 @@ |
62 | 62 | def __str__(self): |
63 | 63 | return 'There is no JSON encoder called %s, please make sure that you \ |
64 | 64 | entered the right name' % self.func |
| 65 | + |
| 66 | +class NotYetImplementedError(Error): |
| 67 | + def __init__(self, func): |
| 68 | + self.func = func |
| 69 | + |
| 70 | + def __str__(self): |
| 71 | + return '''%s has not yet been implemented, update your installation from |
| 72 | + subversion or contact diederik van liere.''' % self.func.func_name |
Index: trunk/tools/editor_trends/classes/runtime_settings.py |
— | — | @@ -54,8 +54,8 @@ |
55 | 55 | self.hash = self.secs_since_epoch() |
56 | 56 | self.base_location = self.settings.input_location if \ |
57 | 57 | self.settings.input_location != None else self.get_value('location') |
58 | | - self.update_project_settings() |
59 | | - self.update_language_settings() |
| 58 | + self.project = self.update_project_settings() |
| 59 | + self.language = self.update_language_settings() |
60 | 60 | |
61 | 61 | self.targets = self.split_keywords(self.get_value('charts')) |
62 | 62 | self.keywords = self.split_keywords(self.get_value('keywords')) |
— | — | @@ -167,18 +167,23 @@ |
168 | 168 | lnc = languages.LanguageContainer() |
169 | 169 | default = lnc.languages[lnc.default] |
170 | 170 | if lang != default.name: |
171 | | - lang = lnc.get_language(lang) |
| 171 | + lang = lnc.get_language(lang, code=False) |
172 | 172 | return lang |
| 173 | + else: |
| 174 | + return default |
173 | 175 | |
174 | 176 | def update_project_settings(self): |
175 | 177 | ''' |
176 | 178 | Determine the project to be analyzed, default is Wikipedia |
177 | 179 | ''' |
| 180 | + default = self.project |
178 | 181 | proj = self.get_value('project') |
179 | 182 | if proj != 'wiki': |
180 | 183 | pc = projects.ProjectContainer() |
181 | 184 | proj = pc.get_project(proj) |
182 | 185 | return proj |
| 186 | + else: |
| 187 | + return default |
183 | 188 | |
184 | 189 | def get_projectname(self): |
185 | 190 | ''' |
Index: trunk/tools/editor_trends/classes/languages.py |
— | — | @@ -29,7 +29,7 @@ |
30 | 30 | self.default = default |
31 | 31 | |
32 | 32 | def __repr__(self): |
33 | | - return '%s - %s' % (self.code, self.name) |
| 33 | + return u'%s - %s' % (self.code, self.name) |
34 | 34 | |
35 | 35 | def show_languages(self, settings, project, startswith=None): |
36 | 36 | if startswith != None: |
— | — | @@ -642,8 +642,10 @@ |
643 | 643 | def __repr__(self): |
644 | 644 | return 'contains %s languages' % (len(self.languages)) |
645 | 645 | |
646 | | - def get_language(self, code): |
647 | | - return self.languages.get(code, None) |
| 646 | + def get_language(self, value, code=True): |
| 647 | + if not code: |
| 648 | + value = self.init_languages[value] |
| 649 | + return self.languages.get(value, None) |
648 | 650 | |
649 | 651 | def determine_default_language(self): |
650 | 652 | ''' |