Show
Ignore:
Timestamp:
01/30/09 11:17:23 (14 months ago)
Author:
JensDiemer
Message:

Chnage the way to get the plugin_name. The Problem was: self.class.name does not represent in every case the real plugin name! If a big plugin split the plugin methods in smaller file/classes and inherit directly from PyLucidBasePlugin?. e.g. the show_interals does this...
The right plugin name is needed for getting the right internal page files.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/pylucid_project/PyLucid/system/BasePlugin.py

    r1804 r1816  
    4747class PyLucidBasePlugin(object): 
    4848 
    49     def __init__(self, context, response): 
    50         self.plugin_name = self.__class__.__name__ 
     49    def __init__(self, context, response, plugin_name): 
     50        self.plugin_name = plugin_name 
    5151        self.internal_page = InternalPage(context, self.plugin_name) 
    5252 
     
    172172        try: 
    173173            content = self.internal_page.get_content(internal_page_name, "html") 
    174         except InternalPageNotFound: 
    175             msg = "Internal page '%s' not found!" % internal_page_name 
     174        except InternalPageNotFound, err: 
     175            if debug: 
     176                msg = err 
     177            else:     
     178                msg = "Internal page '%s' not found!" % internal_page_name 
    176179            self.page_msg.red(msg) 
    177180            return "[%s]" % msg