Ignore:
Timestamp:
Nov 26, 2009 11:11:11 AM (14 years ago)
Author:
piv
Message:

temporarily dirty fix to make import of content with directory context POSSIBLE!

File:
1 edited

Legend:

Unmodified
Added
Removed
  • quintagroup.transmogrifier/trunk/quintagroup/transmogrifier/exportimport.py

    r679 r1416  
     1import os 
    12import tempfile 
    23 
     
    8485 
    8586def importSiteStructure(context): 
    86     # this function is also called when adding Plone site, so call standard handler 
    87     if not context.readDataFile('.objects.xml', subdir='structure'): 
    88         IFilesystemImporter(context.getSite()).import_(context, 'structure', True) 
    89         return 
    9087 
    9188    transmogrifier = ITransmogrifier(context.getSite()) 
     
    10299        CONFIGFILE = None 
    103100    transmogrifier._data = {} 
     101 
     102    # this function is also called when adding Plone site, so call standard handler 
     103    path = '' 
     104    if 'reader' in transmogrifier._raw: 
     105        path = transmogrifier._raw['reader'].get('path', '') 
     106    if not context.readDataFile('.objects.xml', subdir=os.path.join(path, 'structure')): 
     107        try: 
     108            from Products.GenericSetup.interfaces import IFilesystemImporter 
     109            IFilesystemImporter(context.getSite()).import_(context, 'structure', True) 
     110        except ImportError: 
     111            pass 
     112        return 
    104113 
    105114    options = transmogrifier._raw['transmogrifier'] 
Note: See TracChangeset for help on using the changeset viewer.