From c1fc16ea4eeeef3a76383985ea01999894d0ee72 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Tue, 28 Feb 2012 18:20:49 +0100 Subject: [PATCH] fix typo, better time remaining --- pandora_client/__init__.py | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/pandora_client/__init__.py b/pandora_client/__init__.py index b77fc85..0827f40 100644 --- a/pandora_client/__init__.py +++ b/pandora_client/__init__.py @@ -3,14 +3,16 @@ # vi:si:et:sw=4:sts=4:ts=4 # GPL 2012 from __future__ import division, with_statement -import os -import json -import sqlite3 -import time -import shutil -import sys -import socket + import getpass +import json +import math +import os +import shutil +import socket +import sqlite3 +import sys +import time import ox @@ -530,7 +532,7 @@ class API(ox.API): self.media_cache = media_cache if not self.media_cache: - self.media_cache = os.path.exanduser(default_media_cache) + self.media_cache = os.path.expanduser(default_media_cache) self._resume_file = '/tmp/pandora_client.%s.json' % os.environ.get('USER') def uploadVideo(self, filename, data, profile, info=None): @@ -612,7 +614,7 @@ class API(ox.API): elapsed = time.mktime(time.localtime()) - start remaining = "" if done: - r = int((elapsed / (done/fsize) - elapsed)/60) * 60 * 1000 + r = math.ceil((elapsed / (done/fsize) - elapsed)/60) * 60 * 1000 r = ox.formatDuration(r, milliseconds=False, verbosity=2) if r: remaining = ", %s remaining" % r