Example #1
0
def main(out_fname, in_fnames):
    """main(out_fname: str, in_fnames: list<str>) -> None
    Combines all vistrails specified in in_fnames into a single vistrail
    by renumbering their ids

    """
    # FIXME this breaks when you use abstractions!
    (save_bundle, vt_save_dir) = io.open_bundle_from_zip_xml(DBVistrail.vtType, in_fnames[0])
    for in_fname in in_fnames[1:]:
        (new_save_bundle, new_save_dir) = io.open_bundle_from_zip_xml(DBVistrail.vtType, in_fname)
        vistrails.db.services.vistrail.merge(save_bundle, new_save_bundle, "", True, vt_save_dir, new_save_dir)
    io.save_bundle_to_zip_xml(save_bundle, out_fname)
def main(out_fname, in_fnames):
    """main(out_fname: str, in_fnames: list<str>) -> None
    Combines all vistrails specified in in_fnames into a single vistrail
    by renumbering their ids

    """
    # FIXME this breaks when you use abstractions!
    (save_bundle,
     vt_save_dir) = io.open_bundle_from_zip_xml(DBVistrail.vtType,
                                                in_fnames[0])
    for in_fname in in_fnames[1:]:
        (new_save_bundle,
         new_save_dir) = io.open_bundle_from_zip_xml(DBVistrail.vtType,
                                                     in_fname)
        vistrails.db.services.vistrail.merge(save_bundle, new_save_bundle, "",
                                             True, vt_save_dir, new_save_dir)
    io.save_bundle_to_zip_xml(save_bundle, out_fname)
Example #3
0
 def save(self, save_bundle, do_copy=True, version=None):
     if do_copy:
         # make sure we create a fresh temporary directory if we're
         # duplicating the vistrail
         tmp_dir = None
     else:
         # otherwise, use the existing temp directory if one is set
         tmp_dir = self.tmp_dir
     (save_bundle, tmp_dir) = io.save_bundle_to_zip_xml(save_bundle, self._name, tmp_dir, version)
     self.tmp_dir = tmp_dir
     for obj in save_bundle.get_db_objs():
         obj.locator = self
     # Only remove the temporaries if save succeeded!
     self.clean_temporaries()
     return save_bundle
Example #4
0
 def save(self, save_bundle, do_copy=True, version=None):
     if do_copy:
         # make sure we create a fresh temporary directory if we're
         # duplicating the vistrail
         tmp_dir = None
     else:
         # otherwise, use the existing temp directory if one is set
         tmp_dir = self.tmp_dir
     (save_bundle, tmp_dir) = io.save_bundle_to_zip_xml(save_bundle, self._name, tmp_dir, version)
     self.tmp_dir = tmp_dir
     for obj in save_bundle.get_db_objs():
         obj.locator = self
     # Only remove the temporaries if save succeeded!
     self.clean_temporaries()
     return save_bundle