Show
Ignore:
Timestamp:
05/02/08 16:47:16 (23 months ago)
Author:
JensDiemer
Message:

update preferences:

  • move the preferences form from the plugin module into the plugin config modul
  • a plugin must not use try...except to get the preferences
  • update all modules around the plugin install/deinstall etc.
  • detect_page used the system_settings "index_page" value (setup a other default index page works!)
Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/pylucid/PyLucid/plugins_internal/find_and_replace/find_and_replace.py

    r1548 r1551  
    3333 
    3434from PyLucid.system.BasePlugin import PyLucidBasePlugin 
    35 from PyLucid.models import Page, Template, Style 
    36 #from PyLucid.db.preferences import get_pref_dict 
     35from PyLucid.models import Page, Plugin, Template, Style 
    3736from PyLucid.tools.Diff import diff_lines 
    3837from 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=1 
    45     ) 
    46     max_term_len = forms.IntegerField( 
    47         help_text="Max length of a search term", 
    48         initial=150, min_value=1, max_value=500 
    49     ) 
    5038 
    5139 
     
    5947 
    6048# 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"] 
     49preferences = Plugin.objects.get_preferences(__file__) 
     50 
     51min_term_len = preferences["min_term_len"] 
     52max_term_len = preferences["max_term_len"] 
    6953 
    7054