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/models.py

    r1548 r1551  
    3232from PyLucid.tools import crypt 
    3333from PyLucid.system.utils import get_uri_base 
    34 from PyLucid.system.plugin_import import get_plugin_module 
     34from PyLucid.system.plugin_import import get_plugin_config, get_plugin_version 
    3535 
    3636#from PyLucid.db.cache import delete_page_cache 
     
    234234            auto_shortcuts = True 
    235235        else: 
    236             print ">>>", preferences 
    237236            auto_shortcuts = preferences["auto_shortcuts"] 
    238237 
     
    508507        # Get the name of the plugin, if __file__ used 
    509508        plugin_name = os.path.splitext(os.path.basename(plugin_name))[0] 
    510         print "plugin name: '%s'" % plugin_name 
     509        #print "plugin name: '%s'" % plugin_name 
    511510 
    512511        if plugin_name in preference_cache: 
     
    541540    ) 
    542541 
     542    #__________________________________________________________________________ 
     543    # spezial methods 
     544 
    543545    def init_pref_form(self, pref_form): 
    544546        """ 
     
    550552        self.set_pref_data_string(init_dict) 
    551553 
     554    #__________________________________________________________________________ 
     555    # spezial set methods 
     556 
    552557    def set_pref_data_string(self, data_dict): 
    553558        """ 
     
    556561        preference_cache[self.plugin_name] = data_dict 
    557562        self.pref_data_string = pformat(data_dict) 
     563 
     564    #__________________________________________________________________________ 
     565    # spezial get methods 
    558566 
    559567    def get_preferences(self): 
     
    570578        initial information into the help text and return the form. 
    571579        """ 
    572         plugin_module = get_plugin_module( 
     580        plugin_config = get_plugin_config( 
    573581            self.package_name, self.plugin_name, debug 
    574582        ) 
    575         form = getattr(plugin_module, "PreferencesForm") 
     583        form = getattr(plugin_config, "PreferencesForm") 
    576584        setup_help_text(form) 
    577585        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    #-------------------------------------------------------------------------- 
    578594 
    579595    def save(self):