コード例 #1
0
ファイル: exportimport.py プロジェクト: dtgit/dtedu
 def export(self, export_context, subdir, root=False):
     """ See IFilesystemExporter.
     """
     FolderishExporterImporter.export(self, export_context, subdir, root)
     template = PageTemplateResource("xml/%s" % self._FILENAME, globals()).__of__(self.context)
     export_context.writeDataFile(
         "%s/criteria.xml" % self.context.getId(), template(info=self._getExportInfo()), "text/xml", subdir
     )
コード例 #2
0
ファイル: exportimport.py プロジェクト: bendavis78/zope
 def export(self, export_context, subdir, root=False):
     """ See IFilesystemExporter.
     """
     FolderishExporterImporter.export(self, export_context, subdir, root)
     template = PageTemplateResource('xml/%s' % self._FILENAME,
                                     globals()).__of__(self.context)
     export_context.writeDataFile('%s/criteria.xml' % self.context.getId(),
                                  template(info=self._getExportInfo()),
                                  'text/xml',
                                  subdir,
                                 )
コード例 #3
0
ファイル: exportimport.py プロジェクト: dtgit/dtedu
 def listExportableItems(self):
     """ See IFilesystemExporter.
     """
     criteria_metatypes = self.context._criteria_metatype_ids()
     return [
         x for x in FolderishExporterImporter.listExportableItems(self) if x[1].meta_type not in criteria_metatypes
     ]
コード例 #4
0
ファイル: exportimport.py プロジェクト: dtgit/dtedu
    def import_(self, import_context, subdir, root=False):
        """ See IFilesystemImporter
        """
        FolderishExporterImporter.import_(self, import_context, subdir, root)

        self.encoding = import_context.getEncoding()

        if import_context.shouldPurge():
            self._purgeContext()

        data = import_context.readDataFile("%s/criteria.xml" % self.context.getId(), subdir)

        if data is not None:
            dom = parseString(data)
            root = dom.firstChild
            assert root.tagName == self._ROOT_TAGNAME
            self._updateFromDOM(root)
コード例 #5
0
ファイル: exportimport.py プロジェクト: bendavis78/zope
 def listExportableItems(self):
     """ See IFilesystemExporter.
     """
     criteria_metatypes = self.context._criteria_metatype_ids()
     return [
         x for x in FolderishExporterImporter.listExportableItems(self)
         if x[1].meta_type not in criteria_metatypes
     ]
コード例 #6
0
ファイル: exportimport.py プロジェクト: bendavis78/zope
    def import_(self, import_context, subdir, root=False):
        """ See IFilesystemImporter
        """
        FolderishExporterImporter.import_(self, import_context, subdir, root)

        self.encoding = import_context.getEncoding()

        if import_context.shouldPurge():
            self._purgeContext()

        data = import_context.readDataFile(
            '%s/criteria.xml' % self.context.getId(), subdir)

        if data is not None:
            dom = parseString(data)
            root = dom.firstChild
            assert root.tagName == self._ROOT_TAGNAME
            self._updateFromDOM(root)
コード例 #7
0
 def import_(self, import_context, subdir, root=False):
     """ See IFilesystemImporter.
     """
     FolderishExporterImporter.import_(self, import_context, subdir, root)
コード例 #8
0
 def export(self, export_context, subdir, root=False):
     """ See IFilesystemExporter.
     """
     FolderishExporterImporter.export(self, export_context, subdir, root)
コード例 #9
0
ファイル: exportimport.py プロジェクト: dtgit/dtedu
 def import_(self, import_context, subdir, root=False):
     """ See IFilesystemImporter.
     """
     FolderishExporterImporter.import_(self, import_context, subdir, root)
コード例 #10
0
ファイル: exportimport.py プロジェクト: dtgit/dtedu
 def export(self, export_context, subdir, root=False):
     """ See IFilesystemExporter.
     """
     FolderishExporterImporter.export(self, export_context, subdir, root)
コード例 #11
0
ファイル: exportimport.py プロジェクト: bendavis78/zope
 def _mustPreserve(self):
     context = self.context
     keepers = FolderishExporterImporter._mustPreserve(self)
     keepers.extend(context.objectItems(context._criteria_metatype_ids()))
     return keepers