Skip to content

Commit

Permalink
Corrected size watcher thread
Browse files Browse the repository at this point in the history
  • Loading branch information
Uros Petrevski committed Jan 30, 2015
1 parent 94566aa commit efdc648
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions handlers/updaterHandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,20 +313,18 @@ def reinstallFw(self, data):
self.checkForUpdates()

def sizeWatcher(self):
print "sizeeee"
sizeOnDisk = 0
print "sizeeee", self.fwDownloadSize
sizeOnDisk = -1
while (sizeOnDisk<self.fwDownloadSize):
if os.path.exists(self.fwPath):
sizeOnDisk = os.path.getsize(self.fwPath)
else :
break
progress = int((100.0/self.fwDownloadSize)*sizeOnDisk)
print "SIZEEEEEE", sizeOnDisk, self.fwDownloadSize, "percent", progress
a = {}
a['serverPush'] = "downloadingFw"
a['data'] = progress
self.send(json.dumps(a))
sleep(1)
progress = int((100.0/self.fwDownloadSize)*sizeOnDisk)
print "SIZEEEEEE", sizeOnDisk, self.fwDownloadSize, "percent", progress
a = {}
a['serverPush'] = "downloadingFw"
a['data'] = progress
self.send(json.dumps(a))
sleep(1)

def on_open(self, info) :
global clients
Expand Down

0 comments on commit efdc648

Please sign in to comment.