mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-30 14:59:34 +01:00
Oops, didn't check to see if the file was there before stat'ing it.
This commit is contained in:
parent
8b7b4d97ac
commit
206e14fcf4
@ -133,8 +133,11 @@ class PeriodicFileDownloader(object):
|
|||||||
self.downloadedCounter = {}
|
self.downloadedCounter = {}
|
||||||
for filename in self.periodicFiles:
|
for filename in self.periodicFiles:
|
||||||
if self.periodicFiles[filename][-1] is None:
|
if self.periodicFiles[filename][-1] is None:
|
||||||
fullPathname = os.path.join(conf.dataDir, filename)
|
fullname = os.path.join(conf.dataDir, filename)
|
||||||
self.lastDownloaded[filename] = os.stat(fullPathname).st_ctime
|
if os.path.exists(fullname):
|
||||||
|
self.lastDownloaded[filename] = os.stat(fullname).st_ctime
|
||||||
|
else:
|
||||||
|
self.lastDownloaded[filename] = 0
|
||||||
else:
|
else:
|
||||||
self.lastDownloaded[filename] = 0
|
self.lastDownloaded[filename] = 0
|
||||||
self.currentlyDownloading = sets.Set()
|
self.currentlyDownloading = sets.Set()
|
||||||
@ -143,7 +146,7 @@ class PeriodicFileDownloader(object):
|
|||||||
|
|
||||||
def _downloadFile(self, filename, url, f):
|
def _downloadFile(self, filename, url, f):
|
||||||
infd = urllib2.urlopen(url)
|
infd = urllib2.urlopen(url)
|
||||||
newFilename = utils.mktemp()
|
newFilename = os.path.join(conf.dataDir, utils.mktemp())
|
||||||
outfd = file(newFilename, 'wb')
|
outfd = file(newFilename, 'wb')
|
||||||
start = time.time()
|
start = time.time()
|
||||||
s = infd.read(4096)
|
s = infd.read(4096)
|
||||||
|
Loading…
Reference in New Issue
Block a user