def save_as(self, obj, version=None):
     is_bundle = False
     if type(obj) == type(SaveBundle(None)):
         is_bundle = True
         save_bundle = obj
         obj = save_bundle.get_primary_obj()
     klass = obj.__class__
     obj = _XMLFileLocator.save(self, obj, True, version)
     klass.convert(obj)
     obj.locator = self
     if is_bundle:
         return SaveBundle(save_bundle.bundle_type, obj)
     return obj
Ejemplo n.º 2
0
 def save_as(self, obj, version=None):
     is_bundle = False
     if type(obj) == type(SaveBundle(None)):
         is_bundle = True
         save_bundle = obj
         obj = save_bundle.get_primary_obj()
     klass = obj.__class__
     obj = _XMLFileLocator.save(self, obj, True, version)
     klass.convert(obj)
     obj.locator = self
     if is_bundle:
         return SaveBundle(save_bundle.bundle_type, obj)
     return obj
Ejemplo n.º 3
0
 def save_as(self, obj):
     klass = obj.__class__
     obj = _XMLFileLocator.save(self, obj, True)
     klass.convert(obj)
     obj.locator = self
     return obj