mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
pep8
This commit is contained in:
parent
392e89ccd4
commit
9679a1c4f3
@ -190,18 +190,15 @@ class ProgressBar:
|
|||||||
self.cleared = 0
|
self.cleared = 0
|
||||||
n = int((self.width-10)*percent)
|
n = int((self.width-10)*percent)
|
||||||
msg = message.center(self.width)
|
msg = message.center(self.width)
|
||||||
msg = (self.term.BOL + self.term.UP + self.term.CLEAR_EOL +
|
msg = (self.term.BOL + self.term.UP + self.term.CLEAR_EOL + (
|
||||||
(self.bar % (100*percent, '='*n, '-'*(self.width-10-n))) +
|
self.bar % (100*percent, '='*n, '-'*(self.width-10-n))) + self.term.CLEAR_EOL + msg).encode(enc)
|
||||||
self.term.CLEAR_EOL + msg).encode(enc)
|
|
||||||
out.write(msg)
|
out.write(msg)
|
||||||
out.flush()
|
out.flush()
|
||||||
|
|
||||||
def clear(self):
|
def clear(self):
|
||||||
out = (sys.stdout.buffer if py3 else sys.stdout)
|
out = (sys.stdout.buffer if py3 else sys.stdout)
|
||||||
if not self.cleared:
|
if not self.cleared:
|
||||||
out.write((self.term.BOL + self.term.CLEAR_EOL +
|
out.write((self.term.BOL + self.term.CLEAR_EOL + self.term.UP + self.term.CLEAR_EOL + self.term.UP + self.term.CLEAR_EOL).encode(enc))
|
||||||
self.term.UP + self.term.CLEAR_EOL +
|
|
||||||
self.term.UP + self.term.CLEAR_EOL).encode(enc))
|
|
||||||
self.cleared = 1
|
self.cleared = 1
|
||||||
out.flush()
|
out.flush()
|
||||||
# }}}
|
# }}}
|
||||||
@ -637,8 +634,8 @@ def extract_tarball(raw, destdir):
|
|||||||
def get_tarball_info():
|
def get_tarball_info():
|
||||||
global signature, calibre_version
|
global signature, calibre_version
|
||||||
print ('Downloading tarball signature securely...')
|
print ('Downloading tarball signature securely...')
|
||||||
raw = get_https_resource_securely('https://code.calibre-ebook.com/tarball-info/' +
|
raw = get_https_resource_securely(
|
||||||
('x86_64' if is64bit else 'i686'))
|
'https://code.calibre-ebook.com/tarball-info/' + ('x86_64' if is64bit else 'i686'))
|
||||||
signature, calibre_version = raw.rpartition(b'@')[::2]
|
signature, calibre_version = raw.rpartition(b'@')[::2]
|
||||||
if not signature or not calibre_version:
|
if not signature or not calibre_version:
|
||||||
raise ValueError('Failed to get install file signature, invalid signature returned')
|
raise ValueError('Failed to get install file signature, invalid signature returned')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user