Remove obsolete imports and code
- landscape.io pointed out obsolete imports - there is also an obsolete variable and lock in throttle.py - add Exception type to BMConfigParser().save
This commit is contained in:
parent
8cb0953401
commit
9bf17b34d1
|
@ -56,7 +56,7 @@ class BMConfigParser(ConfigParser.SafeConfigParser):
|
||||||
shutil.copyfile(fileName, fileNameBak)
|
shutil.copyfile(fileName, fileNameBak)
|
||||||
# The backup succeeded.
|
# The backup succeeded.
|
||||||
fileNameExisted = True
|
fileNameExisted = True
|
||||||
except:
|
except IOError, Error:
|
||||||
# The backup failed. This can happen if the file didn't exist before.
|
# The backup failed. This can happen if the file didn't exist before.
|
||||||
fileNameExisted = False
|
fileNameExisted = False
|
||||||
# write the file
|
# write the file
|
||||||
|
|
|
@ -16,8 +16,6 @@ import sys
|
||||||
import stat
|
import stat
|
||||||
import threading
|
import threading
|
||||||
import time
|
import time
|
||||||
import shutil # used for moving the data folder and copying keys.dat
|
|
||||||
import datetime
|
|
||||||
import traceback
|
import traceback
|
||||||
from binascii import hexlify
|
from binascii import hexlify
|
||||||
|
|
||||||
|
|
|
@ -26,8 +26,6 @@ class Throttle(object):
|
||||||
self.txLen = 0
|
self.txLen = 0
|
||||||
|
|
||||||
def wait(self, dataLen):
|
def wait(self, dataLen):
|
||||||
with self.lock:
|
|
||||||
self.waiting = True
|
|
||||||
with self.lock:
|
with self.lock:
|
||||||
self.txLen += dataLen
|
self.txLen += dataLen
|
||||||
self.total += dataLen
|
self.total += dataLen
|
||||||
|
@ -38,8 +36,6 @@ class Throttle(object):
|
||||||
if self.txLen < self.limit:
|
if self.txLen < self.limit:
|
||||||
break
|
break
|
||||||
self.timer.wait(0.2)
|
self.timer.wait(0.2)
|
||||||
with self.lock:
|
|
||||||
self.waiting = False
|
|
||||||
|
|
||||||
def getSpeed(self):
|
def getSpeed(self):
|
||||||
self.recalculate()
|
self.recalculate()
|
||||||
|
|
Reference in New Issue
Block a user