def upgrade(self, *e): if not vsu.is_connected_to_internet(): vsu.Message('sorry, not connected to internet...', dursec=2); return ms1 = vsu.Message('finding upgrade strategies', tkroot=self.esono.tkroot) dir1 = self.esono.pathdir_esonoclaste if vsu.is_in_git_repo(dir1): if vsu.is_in_git_readonly_repo(dir1): vsu.gitpull(dir1) ms1.quit() ms2 = vsu.Message('read-only git repo : upgrading with git', dursec=2) relaunch() else: ms1.quit() ms2 = vsu.Message('upgrading canceled : this is a read/write git repo', dursec=2) return tarname = vsu.get_git_tar_name('esonoclaste', 'vrx') if tarname in os.listdir(dir1): ms1.quit(); vsu.Message('nothing to update', dursec=2);return def percent(percent): m.set(float(percent)/100.) ms1.quit() m = vsu.ProgressBar('UPGRADING', 'Downloading...', self.esono.tkroot) # get tar file os.chdir(dir1) vsu.get_git_tar('esonoclaste', 'vrx', tarname , percent) m.quit() # WATCH OUT extract tar file on place!!! tf = tarfile.open(tarname) members = tf.getmembers() root = os.path.basename(members[0].path) for member in members: member.path = member.path.replace(root,'.') tf.extract(member,'.') tf.close()
#! /usr/bin/env python # -*- mode: python; coding: utf-8 ; python-indent: 2 -*- import vsutils as vsu vsu.gitpull() vsu.gitpull('../vspy') vsu.rep_clear() vsu.rep_synchro('vsutils','../vspy/vsutils','git') vsu.rep_synchro('vsosc','../vspy/vsosc','git') vsu.rep_synchro('vsparse','../vspy/vsparse','git') vsu.rep_synchro('vsaudio','../vspy/vsaudio','git')