7 Commits
1.3 ... 1.4

Author SHA1 Message Date
Georgios Verigakis
f5c911ed83 Bump 2018-06-25 09:06:26 +03:00
Georgios Verigakis
5d52c5b299 Avoid unprintable chars on Windows
Fixes #36
2018-05-31 09:47:00 +03:00
Georgios Verigakis
a83f91f4b8 Handles the case where self.file is None
Fixes #46
2018-03-13 15:53:27 +02:00
Georgios Verigakis
292a031c4b Revert "Fixed broken character in windows" 2018-01-31 10:22:22 +02:00
Georgios Verigakis
83f3b79137 Merge pull request #44 from LiamGow/patch-1
Fixed broken character in windows
2018-01-30 09:43:54 +02:00
LiamGow
84c3b9197a Fixed broken character in windows 2018-01-29 21:39:28 -08:00
Georgios Verigakis
715a2e130f Fix copy paste typo 2017-04-10 14:40:06 +03:00
4 changed files with 19 additions and 13 deletions

View File

@@ -21,7 +21,7 @@ from sys import stderr
from time import time
__version__ = '1.3'
__version__ = '1.4'
class Infinite(object):

View File

@@ -15,6 +15,9 @@
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
from __future__ import unicode_literals
import sys
from . import Progress
from .helpers import WritelnMixin
@@ -61,7 +64,10 @@ class FillingCirclesBar(ChargingBar):
class IncrementalBar(Bar):
phases = (' ', '', '', '', '', '', '', '', '')
if sys.platform.startswith('win'):
phases = (u' ', u'', u'')
else:
phases = (' ', '', '', '', '', '', '', '', '')
def update(self):
nphases = len(self.phases)

View File

@@ -28,14 +28,14 @@ class WriteMixin(object):
if message:
self.message = message
if self.file.isatty():
if self.file and self.file.isatty():
if self.hide_cursor:
print(HIDE_CURSOR, end='', file=self.file)
print(self.message, end='', file=self.file)
self.file.flush()
def write(self, s):
if self.file.isatty():
if self.file and self.file.isatty():
b = '\b' * self._width
c = s.ljust(self._width)
print(b + c, end='', file=self.file)
@@ -43,7 +43,7 @@ class WriteMixin(object):
self.file.flush()
def finish(self):
if self.file.isatty() and self.hide_cursor:
if self.file and self.file.isatty() and self.hide_cursor:
print(SHOW_CURSOR, end='', file=self.file)
@@ -55,21 +55,21 @@ class WritelnMixin(object):
if message:
self.message = message
if self.file.isatty() and self.hide_cursor:
if self.file and self.file.isatty() and self.hide_cursor:
print(HIDE_CURSOR, end='', file=self.file)
def clearln(self):
if self.file.isatty():
if self.file and self.file.isatty():
print('\r\x1b[K', end='', file=self.file)
def writeln(self, line):
if self.file.isatty():
if self.file and self.file.isatty():
self.clearln()
print(line, end='', file=self.file)
self.file.flush()
def finish(self):
if self.file.isatty():
if self.file and self.file.isatty():
print(file=self.file)
if self.hide_cursor:
print(SHOW_CURSOR, end='', file=self.file)

View File

@@ -21,9 +21,9 @@ setup(
'License :: OSI Approved :: ISC License (ISCL)',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.3'
'Programming Language :: Python :: 3.4'
'Programming Language :: Python :: 3.5'
'Programming Language :: Python :: 3.6'
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
]
)