def load(self, klass=None): from vistrails.core.vistrail.vistrail import Vistrail if klass is None: klass = Vistrail obj = _XMLFileLocator.load(self, klass.vtType) klass.convert(obj) obj.locator = self return obj
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
def __init__(self, filename, **kwargs): _XMLFileLocator.__init__(self, filename, **kwargs)