mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-23 19:19:32 +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 = {}
|
||||
for filename in self.periodicFiles:
|
||||
if self.periodicFiles[filename][-1] is None:
|
||||
fullPathname = os.path.join(conf.dataDir, filename)
|
||||
self.lastDownloaded[filename] = os.stat(fullPathname).st_ctime
|
||||
fullname = os.path.join(conf.dataDir, filename)
|
||||
if os.path.exists(fullname):
|
||||
self.lastDownloaded[filename] = os.stat(fullname).st_ctime
|
||||
else:
|
||||
self.lastDownloaded[filename] = 0
|
||||
else:
|
||||
self.lastDownloaded[filename] = 0
|
||||
self.currentlyDownloading = sets.Set()
|
||||
@ -143,7 +146,7 @@ class PeriodicFileDownloader(object):
|
||||
|
||||
def _downloadFile(self, filename, url, f):
|
||||
infd = urllib2.urlopen(url)
|
||||
newFilename = utils.mktemp()
|
||||
newFilename = os.path.join(conf.dataDir, utils.mktemp())
|
||||
outfd = file(newFilename, 'wb')
|
||||
start = time.time()
|
||||
s = infd.read(4096)
|
||||
|
Loading…
Reference in New Issue
Block a user