Commit efdc578e authored by hujun's avatar hujun

1

parent 491faab3
...@@ -93,9 +93,9 @@ class DownFile: ...@@ -93,9 +93,9 @@ class DownFile:
if len(item['voice_file']) > 0: if len(item['voice_file']) > 0:
self.local.local_file = self.save_path + item['voice_file'] self.local.local_file = self.save_path + item['voice_file']
if self.check_file(self.local.local_file): if self.check_file(self.local.local_file):
self.lock.acquire() # self.lock.acquire()
self.old_num = self.old_num + 1 # self.old_num = self.old_num + 1
self.lock.release() # self.lock.release()
continue continue
self.local.time_array = time.strptime(item['call_time'], '%Y-%m-%d %H:%M:%S') self.local.time_array = time.strptime(item['call_time'], '%Y-%m-%d %H:%M:%S')
...@@ -148,21 +148,21 @@ class DownFile: ...@@ -148,21 +148,21 @@ class DownFile:
continue continue
if self.check_file(self.local.local_file): if self.check_file(self.local.local_file):
self.lock.acquire() # self.lock.acquire()
self.old_num = self.old_num + 1 # self.old_num = self.old_num + 1
self.lock.release() # self.lock.release()
continue continue
self.check_dir(self.save_path + self.local.local_dir) self.check_dir(self.save_path + self.local.local_dir)
self.local.result = request.urlretrieve(self.local.url, self.local.local_file) self.local.result = request.urlretrieve(self.local.url, self.local.local_file)
self.lock.acquire() # self.lock.acquire()
self.download_num = self.download_num + 1 # self.download_num = self.download_num + 1
# self.log('url', self.local.url) # self.log('url', self.local.url)
# self.log('download_file', self.local.result) # self.log('download_file', self.local.result)
# self.log("download_num", self.download_num) # self.log("download_num", self.download_num)
# self.log("old_num", self.old_num) # self.log("old_num", self.old_num)
self.lock.release() # self.lock.release()
def download_remote(self, data): def download_remote(self, data):
""" """
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment