def backup_scripts(self, bkup_path): makepaths(join(bkup_path, 'scripts')) for row in self.scripts(): npath = join(bkup_path, 'scripts', row.script) nfile = self.scriptfile(row.script) filecopy(nfile, npath) nfile.close()
def export_scripts(self, bkup_path): makepaths(join(bkup_path, 'scripts')) for row in self.scripts(): npath = join(bkup_path, 'scripts', row.script) nfile = self.scriptfile(row.script) filecopy(nfile, npath) nfile.close()
def backup_templates(self, bkup_path): makepaths(join(bkup_path, 'templates')) for t in self.templates(): npath = join(bkup_path, 'templates', t.package, t.template) tfile = self.templatefile(t.package, t.template) makepaths(dirname(npath)) filecopy(tfile, npath + '.template') tfile.close()
def export_templates(self, bkup_path): makepaths(join(bkup_path, 'templates')) for t in self.templates(): npath = join(bkup_path, 'templates', t.package, t.template) tfile = self.templatefile(t.package, t.template) makepaths(dirname(npath)) filecopy(tfile, npath + '.template') tfile.close()
def export_templates(self, bkup_path): n = 0 for t in self.templates(): npath = join(bkup_path, 'template-%d' % n) tfile = self.templatefile(t.package, t.template) filecopy(tfile, npath) tfile.close() n += 1
def export_templates(self, bkup_path): n = 0 for t in self.templates(): npath = join(bkup_path, 'template-%d' % n) tfile = self.templatefile(t.package, t.template) filecopy(tfile, npath) tfile.close() n += 1
def _update_section_(self, section, release=False): rpath = self.release.path(section, release=release) localpath = pjoin(self.local.source.distpath, rpath) url = pjoin(self.source.distpath, rpath) status = self.local.check_section(section, release=release) if status == 'missing': makepaths(dirname(localpath)) rfile = get_url(url) filecopy(rfile, localpath) elif status == 'corrupt': rfile = get_url(url) filecopy(rfile, localpath) else: print localpath, status
def _update_section_(self, section, release=False): rpath = self.release.path(section, release=release) localpath = path.join(self.backup.source.distpath, rpath) url = path.join(self.local.source.distpath, rpath) status = self.backup.check_section(section, release=release) if status == 'missing': makepaths(path.dirname(localpath)) rfile = file(url) filecopy(rfile, localpath) elif status == 'corrupt': rfile = file(url) filecopy(rfile, localpath) else: print localpath, status
def update_flatrepos(self): rpath = self.release.path(section, release=release) localpath = pjoin(self.local.source.distpath, rpath) url = pjoin(self.source.distpath, rpath) status = self.local.check_section(section, release=release) if status == 'missing': makepaths(dirname(localpath)) rfile = get_url(url) filecopy(rfile, localpath) elif status == 'corrupt': rfile = get_url(url) filecopy(rfile, localpath) else: print localpath, status
def update_flatrepos(self): rpath = self.release.path(section, release=release) localpath = path.join(self.backup.source.distpath, rpath) url = path.join(self.local.source.distpath, rpath) status = self.backup.check_section(section, release=release) if status == 'missing': makepaths(path.dirname(localpath)) rfile = get_url(url) filecopy(rfile, localpath) elif status == 'corrupt': rfile = get_url(url) filecopy(rfile, localpath) else: print localpath, status
def _update_section_(self, section, release=False): rpath = self.release.path(section, release=release) localpath = join(self.local_src.distpath, rpath) url = join(self.remote_src.distpath, rpath) status = self.local.check_dist_section(section, release=release) please_insert = False if not self.local._section_.count_rows(section) and not release: please_insert = True while status in ['missing', 'corrupt']: if status == 'missing': makepaths(dirname(localpath)) rfile = get_url(url) filecopy(rfile, localpath) print localpath, status status = self.local.check_dist_section(section, release=release) print localpath, status if please_insert: self.insert_section_data(section) elif status == 'corrupt': self.insert_section_data(section)
def export_scripts(self, bkup_path): for row in self.scripts(): npath = join(bkup_path, 'script-%s' % row.script) nfile = self.scriptfile(row.script) filecopy(nfile, npath) nfile.close()
def export_scripts(self, bkup_path): for row in self.scripts(): npath = join(bkup_path, 'script-%s' % row.script) nfile = self.scriptfile(row.script) filecopy(nfile, npath) nfile.close()