From 51e17650df029675bb04db02d7e504f4945caf82 Mon Sep 17 00:00:00 2001 From: Sam Ruby Date: Mon, 20 Apr 2009 11:15:10 -0400 Subject: [PATCH] Move call to utime into write --- planet/spider.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/planet/spider.py b/planet/spider.py index 7e72343..4aacc0b 100644 --- a/planet/spider.py +++ b/planet/spider.py @@ -51,11 +51,12 @@ def filename(directory, filename): return os.path.join(directory, filename) -def write(xdoc, out): +def write(xdoc, out, mtime=None): """ write the document out to disk """ file = open(out,'w') file.write(xdoc) file.close() + if mtime: os.utime(out, (mtime, mtime)) def _is_http_uri(uri): parsed = urlparse.urlparse(uri) @@ -221,8 +222,7 @@ def writeCache(feed_uri, feed_info, data): continue # write out and timestamp the results - write(output, cache_file) - os.utime(cache_file, (mtime, mtime)) + write(output, cache_file, mtime) # optionally index if index != None: