Changeset 1551
- Timestamp:
- 05/02/08 16:47:16 (23 months ago)
- Location:
- trunk/pylucid
- Files:
-
- 16 modified
-
media/PyLucid/internal_page/plugin_admin/administation_menu.html (modified) (3 diffs)
-
media/PyLucid/internal_page/preference_editor/select.html (modified) (1 diff)
-
PyLucid/db/page.py (modified) (2 diffs)
-
PyLucid/models.py (modified) (7 diffs)
-
PyLucid/plugins_internal/find_and_replace/find_and_replace.py (modified) (2 diffs)
-
PyLucid/plugins_internal/find_and_replace/find_and_replace_cfg.py (modified) (1 diff)
-
PyLucid/plugins_internal/page_admin/page_admin.py (modified) (2 diffs)
-
PyLucid/plugins_internal/plugin_admin/plugin_admin.py (modified) (5 diffs)
-
PyLucid/plugins_internal/preference_editor/preference_editor.py (modified) (2 diffs)
-
PyLucid/plugins_internal/search/search.py (modified) (1 diff)
-
PyLucid/plugins_internal/search/search_cfg.py (modified) (1 diff)
-
PyLucid/plugins_internal/system_settings/system_settings.py (modified) (3 diffs)
-
PyLucid/plugins_internal/system_settings/system_settings_cfg.py (modified) (1 diff)
-
PyLucid/system/detect_page.py (modified) (4 diffs)
-
PyLucid/system/plugin_import.py (modified) (4 diffs)
-
PyLucid/system/plugin_manager.py (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pylucid/media/PyLucid/internal_page/plugin_admin/administation_menu.html
r1532 r1551 50 50 <a class="author" href="{{ plugin.url }}" title="{{ plugin.author }}"></a> 51 51 </td> 52 <td class="version">{{ plugin. version}}</td>52 <td class="version">{{ plugin.get_version_string }}</td> 53 53 <td> 54 54 {% if plugin.builtin %} … … 91 91 <a class="author" href="{{ plugin.url }}" title="{{ plugin.author }}">{{ plugin.author }}</a> 92 92 </td> 93 <td class="version">{{ plugin. version}}</td>93 <td class="version">{{ plugin.get_version_string }}</td> 94 94 <td> 95 95 {% if not plugin.can_deinstall %} … … 116 116 <h4>Info:</h4> 117 117 <ul> 118 <li><strong>install</strong> - register a plugin/Plugin in the Database</li>119 <li><strong>deinstall</strong> - All tables, stylesheets and internal pages where delete in the DB.</li>120 <li><strong>activate</strong> - enable the plugin /Plugin for the CMS</li>121 <li><strong>deactivate</strong> - disable the plugin /Plugin</li>118 <li><strong>install</strong> - register a plugin/Plugin in the database</li> 119 <li><strong>deinstall</strong> - Complete remove the plugin from the database (incl. preferences)</li> 120 <li><strong>activate</strong> - enable the plugin (set active flag)</li> 121 <li><strong>deactivate</strong> - disable the plugin</li> 122 122 </ul> -
trunk/pylucid/media/PyLucid/internal_page/preference_editor/select.html
r1544 r1551 1 1 <fieldset><legend>select for edit</legend> 2 2 <ul> 3 {% for item in preferences %}4 <li><a href="{{ item.edit_link }}">{{ item.plugin_name }}</a> - {{ item.plugin_description }}</li>3 {% for plugin in plugins %} 4 <li><a href="{{ plugin.edit_link }}">{{ plugin.plugin_name }}</a> - {{ plugin.description }}</li> 5 5 {% endfor %} 6 6 </ul> -
trunk/pylucid/PyLucid/db/page.py
r1390 r1551 20 20 # page-ID <-> parant-ID relation? 21 21 # url data for every page? 22 23 from django import newforms as forms 24 from django.newforms.util import ValidationError 25 from django.utils.translation import ugettext as _ 22 26 23 27 from PyLucid.models import User, Page … … 129 133 return sub_pages 130 134 135 #______________________________________________________________________________ 136 # newforms Page choice 137 """ 138 # usage: 131 139 140 from PyLucid.db.page import PageChoiceField, get_page_choices 141 class MyForm(forms.Form): 142 ... 143 page = PageChoiceField(widget=forms.Select(choices=get_page_choices())) 144 ... 145 """ 146 147 class PageChoiceField(forms.IntegerField): 148 def clean(self, page_id): 149 """ 150 returns the parent page instance. 151 Note: 152 In PyLucid.models.Page.save() it would be checkt if the selected 153 parent page is logical valid. Here we check only, if the page with 154 the given ID exists. 155 """ 156 # let convert the string into a integer: 157 page_id = super(PageChoiceField, self).clean(page_id) 158 159 if page_id == 0: 160 # assigned to the tree root. 161 return None 162 163 try: 164 #page_id = 999999999 # Not exists test 165 page = Page.objects.get(id=page_id) 166 except Exception, msg: 167 raise ValidationError(_(u"Wrong parent POST data: %s" % msg)) 168 else: 169 return page_id 170 171 172 def get_page_choices(): 173 """ 174 generate a verbose page name tree for the parent choice field. 175 """ 176 page_list = flat_tree_list() 177 choices = [(0, "---[root]---")] 178 for page in page_list: 179 choices.append((page["id"], page["level_name"])) 180 return choices -
trunk/pylucid/PyLucid/models.py
r1548 r1551 32 32 from PyLucid.tools import crypt 33 33 from PyLucid.system.utils import get_uri_base 34 from PyLucid.system.plugin_import import get_plugin_ module34 from PyLucid.system.plugin_import import get_plugin_config, get_plugin_version 35 35 36 36 #from PyLucid.db.cache import delete_page_cache … … 234 234 auto_shortcuts = True 235 235 else: 236 print ">>>", preferences237 236 auto_shortcuts = preferences["auto_shortcuts"] 238 237 … … 508 507 # Get the name of the plugin, if __file__ used 509 508 plugin_name = os.path.splitext(os.path.basename(plugin_name))[0] 510 print "plugin name: '%s'" % plugin_name509 #print "plugin name: '%s'" % plugin_name 511 510 512 511 if plugin_name in preference_cache: … … 541 540 ) 542 541 542 #__________________________________________________________________________ 543 # spezial methods 544 543 545 def init_pref_form(self, pref_form): 544 546 """ … … 550 552 self.set_pref_data_string(init_dict) 551 553 554 #__________________________________________________________________________ 555 # spezial set methods 556 552 557 def set_pref_data_string(self, data_dict): 553 558 """ … … 556 561 preference_cache[self.plugin_name] = data_dict 557 562 self.pref_data_string = pformat(data_dict) 563 564 #__________________________________________________________________________ 565 # spezial get methods 558 566 559 567 def get_preferences(self): … … 570 578 initial information into the help text and return the form. 571 579 """ 572 plugin_ module = get_plugin_module(580 plugin_config = get_plugin_config( 573 581 self.package_name, self.plugin_name, debug 574 582 ) 575 form = getattr(plugin_ module, "PreferencesForm")583 form = getattr(plugin_config, "PreferencesForm") 576 584 setup_help_text(form) 577 585 return form 586 587 def get_version_string(self, debug=False): 588 """ 589 Returned the version string from the plugin module 590 """ 591 return get_plugin_version(self.package_name, self.plugin_name, debug) 592 593 #-------------------------------------------------------------------------- 578 594 579 595 def save(self): -
trunk/pylucid/PyLucid/plugins_internal/find_and_replace/find_and_replace.py
r1548 r1551 33 33 34 34 from PyLucid.system.BasePlugin import PyLucidBasePlugin 35 from PyLucid.models import Page, Template, Style 36 #from PyLucid.db.preferences import get_pref_dict 35 from PyLucid.models import Page, Plugin, Template, Style 37 36 from PyLucid.tools.Diff import diff_lines 38 37 from PyLucid.tools.utils import escape 39 40 41 class PreferencesForm(forms.Form):42 min_term_len = forms.IntegerField(43 help_text="Min length of a search term",44 initial=2, min_value=145 )46 max_term_len = forms.IntegerField(47 help_text="Max length of a search term",48 initial=150, min_value=1, max_value=50049 )50 38 51 39 … … 59 47 60 48 # We used preferences values in a newform. We need these values here. 61 try: 62 preferences = Plugin.objects.get_preferences(__file__) 63 except Plugin.DoesNotExist, e: 64 # in _install section? 65 pass 66 else: 67 min_term_len = preferences["min_term_len"] 68 max_term_len = preferences["max_term_len"] 49 preferences = Plugin.objects.get_preferences(__file__) 50 51 min_term_len = preferences["min_term_len"] 52 max_term_len = preferences["max_term_len"] 69 53 70 54 -
trunk/pylucid/PyLucid/plugins_internal/find_and_replace/find_and_replace_cfg.py
r1548 r1551 16 16 submenu. 17 17 """ 18 19 #_____________________________________________________________________________ 20 # preferences 21 22 from django import newforms as forms 23 from django.utils.translation import ugettext as _ 24 25 class PreferencesForm(forms.Form): 26 min_term_len = forms.IntegerField( 27 help_text=_("Min length of a search term"), 28 initial=2, min_value=1 29 ) 30 max_term_len = forms.IntegerField( 31 help_text=_("Max length of a search term"), 32 initial=150, min_value=1, max_value=500 33 ) 18 34 19 35 #_____________________________________________________________________________ -
trunk/pylucid/PyLucid/plugins_internal/page_admin/page_admin.py
r1547 r1551 45 45 from PyLucid.plugins_internal.page_style.page_style import replace_add_data 46 46 47 48 class ParentChoiceField(forms.IntegerField): 49 def clean(self, parent_id): 50 """ 51 returns the parent page instance. 52 Note: 53 In PyLucid.models.Page.save() it would be checkt if the selected 54 parent page is logical valid. Here we check only, if the page with 55 the given ID exists. 56 """ 57 # let convert the string into a integer: 58 parent_id = super(ParentChoiceField, self).clean(parent_id) 59 assert isinstance(parent_id, int) 60 61 if parent_id == 0: 62 # assigned to the tree root. 63 return None 64 65 try: 66 #parent_id = 999999999 # Not exists test 67 page = Page.objects.get(id=parent_id) 68 return page 69 except Exception, msg: 70 raise ValidationError(_(u"Wrong parent POST data: %s" % msg)) 71 72 73 def get_parent_choices(): 74 """ 75 generate a verbose page name tree for the parent choice field. 76 """ 77 page_list = flat_tree_list() 78 choices = [(0, "---[root]---")] 79 for page in page_list: 80 choices.append((page["id"], page["level_name"])) 81 return choices 47 from PyLucid.db.page import PageChoiceField, get_page_choices 48 82 49 83 50 class EditPageForm(forms.Form): … … 95 62 ) 96 63 97 parent = Pa rentChoiceField(98 widget=forms.Select(choices=get_pa rent_choices()),64 parent = PageChoiceField( 65 widget=forms.Select(choices=get_page_choices()), 99 66 # FIXME: How to set invalid_choice here? 100 67 help_text="the higher-ranking father page", -
trunk/pylucid/PyLucid/plugins_internal/plugin_admin/plugin_admin.py
r1544 r1551 30 30 31 31 from PyLucid.system.plugin_manager import get_plugin_list, install_plugin 32 from PyLucid.system.plugin_import import get_plugin_config 32 from PyLucid.system.plugin_import import get_plugin_config, get_plugin_version 33 33 from PyLucid.system.BasePlugin import PyLucidBasePlugin 34 34 from PyLucid.models import Plugin … … 134 134 continue 135 135 try: 136 plugin_cfg = get_plugin_config( self.request,137 package_name, plugin_name, dissolve_version_string=True136 plugin_cfg = get_plugin_config( 137 package_name, plugin_name, self.request.debug 138 138 ) 139 139 except Exception, e: … … 142 142 self.page_msg("Error: %s" % e) 143 143 else: 144 plugin_version = get_plugin_version( 145 package_name, plugin_name, self.request.debug 146 ) 144 147 uninstalled_plugins.append({ 145 148 "plugin_name": plugin_name, … … 148 151 "url": plugin_cfg.__url__, 149 152 "author": plugin_cfg.__author__, 150 "version": plugin_ cfg.__version__,153 "version": plugin_version, 151 154 }) 152 155 … … 165 168 try: 166 169 install_plugin( 167 self.request, package_name, plugin_name, active,170 package_name, plugin_name, self.request.debug, active, 168 171 extra_verbose=False 169 172 ) -
trunk/pylucid/PyLucid/plugins_internal/preference_editor/preference_editor.py
r1549 r1551 11 11 ~~~~~~~~~~~~~~~~~ 12 12 $LastChangedDate$ 13 $Rev $14 $Author $13 $Rev:1549 $ 14 $Author:JensDiemer $ 15 15 16 16 :copyleft: 2008 by the PyLucid team. … … 40 40 Display the sub menu 41 41 """ 42 # self.context["PAGE"].title = _("Preferences editor")42 plugins = Plugin.objects.exclude(pref_data_string__isnull=True) 43 43 44 items = [] 45 plugins = Plugin.objects.all() 44 # Add edit link 46 45 for plugin in plugins: 47 if plugin.pref_data_string == None:48 continue49 50 46 edit_link = self.URLs.methodLink("edit", args=plugin.id) 51 52 items.append({ 53 "plugin_name": unicode(plugin), 54 "plugin_description": plugin.description, 55 "edit_link": edit_link, 56 }) 47 plugin.edit_link = edit_link 57 48 58 49 context = { 59 "p references": items,60 "admin_link": self.URLs.adminLink("PyLucid/ preference"),50 "plugins": plugins, 51 "admin_link": self.URLs.adminLink("PyLucid/Plugin"), 61 52 } 62 53 self._render_template("select", context)#, debug=True) -
trunk/pylucid/PyLucid/plugins_internal/search/search.py
r1548 r1551 35 35 36 36 37 class PreferencesForm(forms.Form): 38 min_term_len = forms.IntegerField( 39 help_text="Min length of a search term", 40 initial=3, min_value=1 37 # We used preferences values in a newform. We need these values here. 38 preferences = Plugin.objects.get_preferences(__file__) 39 40 class SearchForm(forms.Form): 41 search_string = forms.CharField( 42 min_length = preferences["min_term_len"], 43 max_length = preferences["max_term_len"], 41 44 ) 42 max_term_len = forms.IntegerField(43 help_text="Max length of a search term",44 initial=50, min_value=1, max_value=20045 )46 max_results = forms.IntegerField(47 help_text="Number of the paged for the result page",48 initial=20, min_value=1, max_value=20049 )50 text_cutout_len = forms.IntegerField(51 help_text="The length of the text-hit-cutouts",52 initial=50, min_value=1, max_value=20053 )54 text_cutout_lines = forms.IntegerField(55 help_text="Max. cutout lines for every search term",56 initial=5, min_value=1, max_value=2057 )58 59 # We used preferences values in a newform. We need these values here.60 try:61 preferences = Plugin.objects.get_preferences(__file__)62 except Plugin.DoesNotExist, e:63 # in _install section?64 pass65 else:66 class SearchForm(forms.Form):67 search_string = forms.CharField(68 min_length = preferences["min_term_len"],69 max_length = preferences["max_term_len"],70 )71 45 72 46 -
trunk/pylucid/PyLucid/plugins_internal/search/search_cfg.py
r1479 r1551 13 13 14 14 #_____________________________________________________________________________ 15 # preferences 16 17 from django import newforms as forms 18 from django.utils.translation import ugettext as _ 19 20 class PreferencesForm(forms.Form): 21 min_term_len = forms.IntegerField( 22 help_text=_("Min length of a search term"), 23 initial=3, min_value=1 24 ) 25 max_term_len = forms.IntegerField( 26 help_text=_("Max length of a search term"), 27 initial=50, min_value=1, max_value=200 28 ) 29 max_results = forms.IntegerField( 30 help_text=_("Number of the paged for the result page"), 31 initial=20, min_value=1, max_value=200 32 ) 33 text_cutout_len = forms.IntegerField( 34 help_text=_("The length of the text-hit-cutouts"), 35 initial=50, min_value=1, max_value=200 36 ) 37 text_cutout_lines = forms.IntegerField( 38 help_text=_("Max. cutout lines for every search term"), 39 initial=5, min_value=1, max_value=20 40 ) 41 42 #_____________________________________________________________________________ 15 43 # plugin administration data 16 44 -
trunk/pylucid/PyLucid/plugins_internal/system_settings/system_settings.py
r1548 r1551 7 7 8 8 A pseudo plugin for holding the system settings via the plugin preferences. 9 10 TODO: merge with page_admin ChoiceField -> move it into PyLucid.db.page?11 9 12 10 Last commit info: … … 22 20 __version__= "$Rev$" 23 21 24 from django import newforms as forms22 #from django import newforms as forms 25 23 #from django.utils.translation import ugettext as _ 26 24 #from django.utils.safestring import mark_safe … … 28 26 from PyLucid.system.BasePlugin import PyLucidBasePlugin 29 27 from PyLucid.models import Page 30 from PyLucid.db.page import flat_tree_list31 32 def get_parent_choices():33 """34 generate a verbose page name tree for the parent choice field.35 """36 page_list = flat_tree_list()37 choices = [(0, "---[root]---")]38 for page in page_list:39 choices.append((page["id"], page["level_name"]))40 return choices41 42 class PreferencesForm(forms.Form):43 # index_page = forms.IntegerField(44 index_page = forms.ChoiceField(45 choices=get_parent_choices(),46 help_text="The page ID of the index page",47 initial=048 )49 auto_shortcuts = forms.BooleanField(50 help_text="Should the shortcut of a page rebuild on every edit?",51 initial=True52 )53 54 28 55 29 56 30 class system_settings(PyLucidBasePlugin): 57 58 31 def lucidTag(self): 59 32 """ 60 Insert a empty search form into the page.33 TODO! 61 34 """ 62 35 self.page_msg("Preferences:", preferences) -
trunk/pylucid/PyLucid/plugins_internal/system_settings/system_settings_cfg.py
r1544 r1551 13 13 14 14 #_____________________________________________________________________________ 15 # preferences 16 17 from django import newforms as forms 18 from django.utils.translation import ugettext as _ 19 20 from PyLucid.db.page import PageChoiceField, get_page_choices 21 22 23 class PreferencesForm(forms.Form): 24 index_page = PageChoiceField( 25 widget=forms.Select(choices=get_page_choices()), 26 help_text=_("The page ID of the index page"), 27 initial=0 28 ) 29 auto_shortcuts = forms.BooleanField( 30 help_text=_("Should the shortcut of a page rebuild on every edit?"), 31 initial=True 32 ) 33 34 #_____________________________________________________________________________ 15 35 # plugin administration data 16 36 -
trunk/pylucid/PyLucid/system/detect_page.py
r1548 r1551 17 17 """ 18 18 19 from PyLucid.models import Page20 from PyLucid.system.exceptions import AccessDenied, LowLevelError21 22 19 from django.utils.translation import ugettext as _ 23 20 from django.http import Http404, HttpResponseRedirect 21 22 from PyLucid.system.exceptions import AccessDenied, LowLevelError 23 from PyLucid.models import Page, Plugin 24 24 25 25 26 def get_a_page(): 26 27 """ 27 28 Try to get and return a existing page. 28 Create a first page, if no page exists.29 29 """ 30 30 try: … … 37 37 38 38 39 def get_default_page_id( ):39 def get_default_page_id(request): 40 40 """ 41 41 returns the default page id 42 42 """ 43 43 try: 44 default_page = Preference.objects.get(name__exact="index page")45 # default_page = "raise!" 46 return int(default_page.value)44 preferences = Plugin.objects.get_preferences("system_settings") 45 default_page_id = preferences["index_page"] 46 return default_page_id 47 47 except Exception, e: 48 48 # TODO: make a page message for the admin … … 53 53 54 54 55 def get_default_page( ):56 page_id = get_default_page_id( )55 def get_default_page(request): 56 page_id = get_default_page_id(request) 57 57 try: 58 58 # page_id = "wrong test" … … 76 76 if page_name == "": 77 77 # Index Seite wurde aufgerufen. Zumindest bei poor-modrewrite 78 return get_default_page( )78 return get_default_page(request) 79 79 80 80 # bsp/und%2Foder -> ['bsp', 'und%2Foder'] -
trunk/pylucid/PyLucid/system/plugin_import.py
r1548 r1551 1 1 # -*- coding: utf-8 -*- 2 3 2 """ 4 3 PyLucid Plugin Manager … … 52 51 page_msg(getattr(plugin_config, item)) 53 52 54 def get_plugin_config(request, package_name, plugin_name, 55 dissolve_version_string=False, extra_verbose=False): 53 def get_plugin_config(package_name, plugin_name, debug, extra_verbose=False): 56 54 """ 57 55 imports the plugin and the config plugin and returns a merge config-object … … 61 59 """ 62 60 config_name = "%s_cfg" % plugin_name 63 debug = request.user.is_superuser or request.debug 61 from_name = ".".join([package_name, plugin_name, config_name]) 62 if extra_verbose: 63 print "from %s import %s" % (from_name, config_name) 64 64 65 def get_plugin(object_name): 66 from_name = ".".join([package_name, plugin_name, object_name]) 67 if extra_verbose: 68 print "from %s import %s" % (from_name, object_name) 69 return _import(from_name, object_name, debug) 70 71 config_plugin = get_plugin(config_name) 72 73 if dissolve_version_string: 74 plugin_plugin = get_plugin(plugin_name) 75 76 plugin_version = getattr(plugin_plugin, "__version__", None) 77 if plugin_version: 78 # Cleanup a SVN Revision Number 79 plugin_version = plugin_version.strip("$ ") 80 config_plugin.__version__ = plugin_version 65 config_plugin = _import(from_name, config_name, debug) 81 66 82 67 return config_plugin 68 69 def get_plugin_version(package_name, plugin_name, debug): 70 plugin_plugin = get_plugin_module(package_name, plugin_name, debug) 71 72 plugin_version = getattr(plugin_plugin, "__version__", "") 73 74 # Cleanup a SVN Revision Number 75 plugin_version = plugin_version.strip("$ ") 76 77 return plugin_version 83 78 84 79 … … 87 82 88 83 89 90 -
trunk/pylucid/PyLucid/system/plugin_manager.py
r1548 r1551 1 1 # -*- coding: utf-8 -*- 2 3 2 """ 4 3 PyLucid Plugin Manager … … 35 34 36 35 #from PyLucid.db.preferences import Preferences, preference_cache, PreferenceDoesntExist 37 from PyLucid.system.plugin_import import get_plugin_module, get_plugin_config 36 from PyLucid.system.plugin_import import get_plugin_module, get_plugin_config, \ 37 get_plugin_version 38 38 from PyLucid.system.exceptions import * 39 39 from PyLucid.models import Plugin … … 68 68 return 69 69 70 plugin_config = get_plugin_config( request,70 plugin_config = get_plugin_config( 71 71 package_name = plugin.package_name, 72 72 plugin_name = plugin.plugin_name, 73 d issolve_version_string=False73 debug = request.debug, 74 74 ) 75 75 # context["page_msg"](plugin_config.plugin_manager_data) … … 200 200 201 201 202 def _install_plugin( request,package_name, plugin_name, plugin_config, active,202 def _install_plugin(package_name, plugin_name, plugin_config, active, 203 203 extra_verbose): 204 204 """ … … 217 217 active = active, 218 218 ) 219 debug = request.user.is_superuser or request.debug 220 plugin_module = get_plugin_module(package_name, plugin_name, debug) 221 pref_form = getattr(plugin_module, "PreferencesForm", None) 219 220 pref_form = getattr(plugin_config, "PreferencesForm", None) 222 221 if pref_form: 223 222 # plugin module has a preferences newform class 224 223 plugin.init_pref_form(pref_form) 225 226 224 227 225 plugin.save() … … 232 230 233 231 234 def install_plugin( request, package_name, plugin_name, active,232 def install_plugin(package_name, plugin_name, debug, active, 235 233 extra_verbose=False): 236 234 """ 237 235 Get the config object from disk and insert the plugin into the database 238 236 """ 239 plugin_config = get_plugin_config(request, 240 package_name, plugin_name, 241 dissolve_version_string=True, extra_verbose=extra_verbose 237 plugin_config = get_plugin_config( 238 package_name, plugin_name, debug, extra_verbose=extra_verbose 242 239 ) 243 240 if extra_verbose: … … 255 252 256 253 plugin = _install_plugin( 257 request, package_name, plugin_name, 258 plugin_config, active, extra_verbose 254 package_name, plugin_name, plugin_config, active, extra_verbose 259 255 ) 260 256 … … 284 280 285 281 try: 286 install_plugin( request,287 package_name, plugin_name, 282 install_plugin( 283 package_name, plugin_name, request.debug, 288 284 active=True, extra_verbose=extra_verbose 289 285 ) 290 286 except Exception, e: 287 # FIXME 291 288 print "Error:" 292 289 import traceback