Move call to utime into write
This commit is contained in:
parent
9c6f075af6
commit
51e17650df
@ -51,11 +51,12 @@ def filename(directory, filename):
|
|||||||
|
|
||||||
return os.path.join(directory, filename)
|
return os.path.join(directory, filename)
|
||||||
|
|
||||||
def write(xdoc, out):
|
def write(xdoc, out, mtime=None):
|
||||||
""" write the document out to disk """
|
""" write the document out to disk """
|
||||||
file = open(out,'w')
|
file = open(out,'w')
|
||||||
file.write(xdoc)
|
file.write(xdoc)
|
||||||
file.close()
|
file.close()
|
||||||
|
if mtime: os.utime(out, (mtime, mtime))
|
||||||
|
|
||||||
def _is_http_uri(uri):
|
def _is_http_uri(uri):
|
||||||
parsed = urlparse.urlparse(uri)
|
parsed = urlparse.urlparse(uri)
|
||||||
@ -221,8 +222,7 @@ def writeCache(feed_uri, feed_info, data):
|
|||||||
continue
|
continue
|
||||||
|
|
||||||
# write out and timestamp the results
|
# write out and timestamp the results
|
||||||
write(output, cache_file)
|
write(output, cache_file, mtime)
|
||||||
os.utime(cache_file, (mtime, mtime))
|
|
||||||
|
|
||||||
# optionally index
|
# optionally index
|
||||||
if index != None:
|
if index != None:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user