def export_trait(self, trait, suite=None, dirname=None, traitdb=None): if traitdb is None: if suite is None: RuntimeError , "you must pass a suite if you don't pass a Trait object" print "make new traitdb" traitdb = Trait(self.conn, suite) traitdb.set_trait(trait) if suite is None: suite = traitdb.suite if dirname is None: dirname = self._make_suite_export_path(suite) traitdb.export_trait(dirname) self.report_trait_exported(trait, dirname)
def export_trait(self, trait, suite=None, dirname=None, traitdb=None): if traitdb is None: if suite is None: RuntimeError, "you must pass a suite if you don't pass a Trait object" print "make new traitdb" traitdb = Trait(self.conn, suite) traitdb.set_trait(trait) if suite is None: suite = traitdb.suite if dirname is None: dirname = self._make_suite_export_path(suite) traitdb.export_trait(dirname) self.report_trait_exported(trait, dirname)
def backup(self, path=None): if path is None: path = self.path if not isdir(path): raise Error, '%s not a directory' % path dbfile = file(join(path, 'database.xml'), 'w') self.writexml(dbfile, indent='\t', newl='\n', addindent='\t') dbfile.close() self.backup_profiles(path) suites = [x.suite for x in self._suite_rows()] for suite in suites: makepaths(join(path, suite)) trait = Trait(self.conn, suite) for t in trait.get_trait_list(): trait.set_trait(t) trait.backup_trait(join(path, suite))
def backup(self, path=None): if path is None: path = self.path if not isdir(path): raise Error, '%s not a directory' % path dbfile = file(join(path, 'database.xml'), 'w') self.writexml(dbfile, indent='\t', newl='\n', addindent='\t') dbfile.close() self.backup_profiles(path) suites = [x.suite for x in self._suite_rows()] for suite in suites: makepaths(join(path, suite)) trait = Trait(self.conn, suite) for t in trait.get_trait_list(): trait.set_trait(t) trait.backup_trait(join(path, suite))