X-Git-Url: https://git.camperquake.de/gitweb.cgi?p=time-slider.git;a=blobdiff_plain;f=usr%2Fshare%2Ftime-slider%2Flib%2Ftime_slider%2Ftmp2.py;h=ec4d5d60731296db6c6f5022a8073f63cad1c9b7;hp=b4ad9fd74d0cde21b663d7a0457abb6bd4ca14b5;hb=75feb72a4aa1bf0940b4b2eaddd68c781cdf50ee;hpb=1ad3b546afd04dedd97020e33bd153531b4cdee2 diff --git a/usr/share/time-slider/lib/time_slider/tmp2.py b/usr/share/time-slider/lib/time_slider/tmp2.py index b4ad9fd..ec4d5d6 100755 --- a/usr/share/time-slider/lib/time_slider/tmp2.py +++ b/usr/share/time-slider/lib/time_slider/tmp2.py @@ -73,8 +73,8 @@ GETTEXT_DOMAIN = 'time-slider' gtk.glade.bindtextdomain(GETTEXT_DOMAIN, LOCALE_PATH) gtk.glade.textdomain(GETTEXT_DOMAIN) -import zfs -from rbac import RBACprofile +from . import zfs +from .rbac import RBACprofile class RsyncBackup: @@ -91,7 +91,7 @@ class RsyncBackup: self.creationtime = creationtime try: tm = time.localtime(self.creationtime) - self.creationtime_str = unicode(time.strftime ("%c", tm), + self.creationtime_str = str(time.strftime ("%c", tm), locale.getpreferredencoding()).encode('utf-8') except: self.creationtime_str = time.ctime(self.creationtime) @@ -131,22 +131,21 @@ class RsyncBackup: rsyncsmf.RSYNCLOCKSUFFIX) if not os.path.exists(lockFileDir): - os.makedirs(lockFileDir, 0755) + os.makedirs(lockFileDir, 0o755) lockFile = os.path.join(lockFileDir, self.snaplabel + ".lock") try: lockFp = open(lockFile, 'w') fcntl.flock(lockFp, fcntl.LOCK_EX | fcntl.LOCK_NB) except IOError: - raise RuntimeError, \ - "couldn't delete %s, already used by another process" % self.mountpoint + raise RuntimeError("couldn't delete %s, already used by another process" % self.mountpoint) return trashDir = os.path.join(self.rsync_dir, self.fsname, rsyncsmf.RSYNCTRASHSUFFIX) if not os.path.exists(trashDir): - os.makedirs(trashDir, 0755) + os.makedirs(trashDir, 0o755) backupTrashDir = os.path.join (self.rsync_dir, self.fsname, @@ -178,6 +177,6 @@ for root, dirs, files in os.walk(rsyncsmf.RsyncSMF("%s:rsync" %(plugin.PLUGINBAS insort(backupDirs, os.path.abspath(backupDir)) -print backupDirs +print(backupDirs)