1
0
Fork 0
mirror of https://github.com/fmap/muflax65ngodyewp.onion synced 2024-06-27 10:26:48 +02:00
This commit is contained in:
muflax 2010-04-30 22:02:52 +02:00
parent 465d456a3b
commit 77aba390d0

View file

@ -118,9 +118,7 @@ class Webifier(object):
if not op.exists(out): if not op.exists(out):
os.mkdir(out) os.mkdir(out)
for f in glob.glob(src+"/*.pdc"): for f in glob.glob(src+"/*.pdc"):
mtime = dt.datetime.fromtimestamp(os.stat(f).st_mtime) self.templatify(f, meta, out)
if self.force or mtime > self.now:
self.templatify(f, meta, out)
# do the same for all subdirectories # do the same for all subdirectories
for dir in [d for d in os.listdir(src) for dir in [d for d in os.listdir(src)
@ -147,10 +145,6 @@ class Webifier(object):
def make_rss_feed(self, changelog): def make_rss_feed(self, changelog):
"""generate an RSS feed out of the Changelog""" """generate an RSS feed out of the Changelog"""
mtime = dt.datetime.fromtimestamp(os.stat(changelog).st_mtime)
if not (self.force or mtime > self.now):
return
with open(changelog, "r") as f: with open(changelog, "r") as f:
print("parsing {}...".format(changelog)) print("parsing {}...".format(changelog))
@ -204,7 +198,7 @@ class Webifier(object):
if re.match(".*\.html", f)]: if re.match(".*\.html", f)]:
mtime = dt.datetime.fromtimestamp(os.stat(f).st_mtime) mtime = dt.datetime.fromtimestamp(os.stat(f).st_mtime)
if self.force or mtime > self.now: if self.force or mtime > self.now:
subprocess.call(["tidy", "-i", "--tidy-mark", "f", "-m", "-q", subprocess.call(["tidy", "--tidy-mark", "f", "-i", "-m", "-q",
"-utf8", f]) "-utf8", f])
def tidy_up_xml(self, dir): def tidy_up_xml(self, dir):
@ -215,7 +209,7 @@ class Webifier(object):
if re.match(".*\.xml", f)]: if re.match(".*\.xml", f)]:
mtime = dt.datetime.fromtimestamp(os.stat(f).st_mtime) mtime = dt.datetime.fromtimestamp(os.stat(f).st_mtime)
if self.force or mtime > self.now: if self.force or mtime > self.now:
subprocess.call(["tidy", "-i", "-xml", "-m", "-q", "-utf8", f]) subprocess.call(["tidy", "-xml", "-i", "-m", "-q", "-utf8", f])
def main(): def main():
parser = optparse.OptionParser() parser = optparse.OptionParser()