X-Git-Url: http://git.dolda2000.com/gitweb/?a=blobdiff_plain;f=manga%2Fprofile.py;h=2b7a15a4385c63fed7093ee736afd108ae43caad;hb=f875978b3e6c24ff41006e9b1596f52e0e994ffd;hp=081cd6c58ff0af1de389fde728c79a8fba725ff5;hpb=3cc7937cd91ec6d3cfb7eebcd4c1afd85c5a615a;p=automanga.git diff --git a/manga/profile.py b/manga/profile.py index 081cd6c..2b7a15a 100644 --- a/manga/profile.py +++ b/manga/profile.py @@ -4,7 +4,8 @@ pj = os.path.join home = os.getenv("HOME") if home is None or not os.path.isdir(home): raise Exception("Could not find home directory for profile keeping") -basedir = pj(home, ".manga", "profiles") +confdir = pj(home, ".manga") +basedir = pj(confdir, "profiles") class txfile(object): def __init__(self, name, mode): @@ -218,6 +219,12 @@ class filemanga(manga): else: f.write(consline("lset", key, *val) + "\n") + def mtime(self): + try: + return os.stat(self.path).st_mtime + except FileNotFoundError: + return 0 + class profile(object): def __init__(self, dir): self.dir = dir @@ -255,7 +262,7 @@ class profile(object): raise KeyError("no such manga: (%s, %s)" % (libnm, id)) while True: try: - fp = openwdir(pj(self.dir, "%i.manga" % seq), "wx") + fp = openwdir(pj(self.dir, "%i.manga" % seq), "x") except IOError: seq += 1 else: