Initial Python 3 port
Many things work, some don't. Notably, genPOI doesn't work, and there's some signedness comparison stuff going on in the C extension. This also completely drops support for Python 2, as maintaining a C extension for both Python 2 and 3 is a pain and not worth it for the 9 months that Python 2 is still going to be supported upstream. The documentation needs to be adjusted as well. All of the few tests we have pass, and rendering a map works, both with a configuration file and without. We can also use optimizeimages. Concerns #1528.
This commit is contained in:
@@ -189,13 +189,13 @@ class Bar(ProgressBarWidgetHFill):
|
||||
self.left = left
|
||||
self.right = right
|
||||
def _format_marker(self, pbar):
|
||||
if isinstance(self.marker, (str, unicode)):
|
||||
if isinstance(self.marker, str):
|
||||
return self.marker
|
||||
else:
|
||||
return self.marker.update(pbar)
|
||||
def update(self, pbar, width):
|
||||
percent = pbar.percentage()
|
||||
cwidth = width - len(self.left) - len(self.right)
|
||||
cwidth = int(width - len(self.left) - len(self.right))
|
||||
marked_width = int(percent * cwidth / 100)
|
||||
m = self._format_marker(pbar)
|
||||
bar = (self.left + (m*marked_width).ljust(cwidth) + self.right)
|
||||
@@ -283,7 +283,7 @@ class ProgressBar(object):
|
||||
r.append(w)
|
||||
hfill_inds.append(i)
|
||||
num_hfill += 1
|
||||
elif isinstance(w, (str, unicode)):
|
||||
elif isinstance(w, str):
|
||||
r.append(w)
|
||||
currwidth += len(w)
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user