Changeset 1392 in products
- Timestamp:
- Nov 24, 2009 10:45:53 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
quintagroup.transmogrifier/branches/plone-2.1/quintagroup.transmogrifier/quintagroup/transmogrifier/exportimport.py
r690 r1392 1 import os 1 2 import tempfile 2 3 … … 86 87 87 88 def importSiteStructure(context): 88 # this function is also called when adding Plone site, so call standard handler89 if not context.readDataFile('.objects.xml', subdir='structure'):90 try:91 from Products.GenericSetup.interfaces import IFilesystemImporter92 IFilesystemImporter(context.getSite()).import_(context, 'structure', True)93 except ImportError:94 pass95 return96 97 89 transmogrifier = ITransmogrifier(context.getSite()) 98 90 … … 109 101 transmogrifier._data = {} 110 102 103 # this function is also called when adding Plone site, so call standard handler 104 path = '' 105 if 'reader' in transmogrifier._raw: 106 path = transmogrifier._raw['reader'].get('path', '') 107 if not context.readDataFile('.objects.xml', subdir=os.path.join(path, 'structure')): 108 try: 109 from Products.GenericSetup.interfaces import IFilesystemImporter 110 IFilesystemImporter(context.getSite()).import_(context, 'structure', True) 111 except ImportError: 112 pass 113 return 114 111 115 options = transmogrifier._raw['transmogrifier'] 112 116 sections = options['pipeline'].splitlines() … … 118 122 # tarball replace it with given function argument 119 123 while hasattr(last_section, 'previous'): 120 if isinstance(last_section, ReaderSection) and \121 isinstance(last_section.import_context, gscontext.TarballImportContext):122 last_section.import_context = context123 124 last_section = last_section.previous 124 125 # end cycle if we get empty starter section
Note: See TracChangeset
for help on using the changeset viewer.