Exemple #1
0
class XML_Presenter(TaggedModelPresenter):

    cid = uc2const.XML

    config = None
    doc_file = ''
    resources = None
    cms = None

    def __init__(self, appdata, cnf={}, filepath=None):
        self.config = XML_Config()
        config_file = os.path.join(appdata.app_config_dir,
                                   self.config.filename)
        self.config.load(config_file)
        self.config.update(cnf)
        self.appdata = appdata
        self.cms = self.appdata.app.default_cms
        self.loader = XML_Loader()
        self.saver = XML_Saver()
        if filepath is None:
            self.new()
        else:
            self.load(filepath)

    def new(self):
        self.model = XMLObject('root')
Exemple #2
0
class XML_Presenter(TaggedModelPresenter):

    cid = uc2const.XML

    config = None
    doc_file = ""
    resources = None
    cms = None

    def __init__(self, appdata, cnf={}, filepath=None):
        self.config = XML_Config()
        config_file = os.path.join(appdata.app_config_dir, self.config.filename)
        self.config.load(config_file)
        self.config.update(cnf)
        self.appdata = appdata
        self.cms = self.appdata.app.default_cms
        self.loader = XML_Loader()
        self.saver = XML_Saver()
        if filepath is None:
            self.new()
        else:
            self.load(filepath)

    def new(self):
        self.model = XMLObject("root")
Exemple #3
0
 def __init__(self, appdata, cnf={}, filepath=None):
     self.config = XML_Config()
     config_file = os.path.join(appdata.app_config_dir,
                                self.config.filename)
     self.config.load(config_file)
     self.config.update(cnf)
     self.appdata = appdata
     self.cms = self.appdata.app.default_cms
     self.loader = XML_Loader()
     self.saver = XML_Saver()
     if filepath is None:
         self.new()
     else:
         self.load(filepath)
Exemple #4
0
 def __init__(self, appdata, cnf={}, filepath=None):
     self.config = XML_Config()
     config_file = os.path.join(appdata.app_config_dir, self.config.filename)
     self.config.load(config_file)
     self.config.update(cnf)
     self.appdata = appdata
     self.cms = self.appdata.app.default_cms
     self.loader = XML_Loader()
     self.saver = XML_Saver()
     if filepath is None:
         self.new()
     else:
         self.load(filepath)