0

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:
Nicolas F
2019-03-16 20:43:25 +01:00
parent 99eebd5b69
commit e348a548b6
33 changed files with 369 additions and 625 deletions

View File

@@ -14,7 +14,7 @@
# with the Overviewer. If not, see <http://www.gnu.org/licenses/>.
from PIL import Image
import textures
from . import textures
"""The contents of this file are imported into the namespace of config files.
It also defines the render primitive objects, which are used by the C code.
@@ -31,13 +31,13 @@ class RenderPrimitive(object):
raise RuntimeError("RenderPrimitive cannot be used directly")
self.option_values = {}
for key, val in kwargs.iteritems():
for key, val in kwargs.items():
if not key in self.options:
raise ValueError("primitive `{0}' has no option `{1}'".format(self.name, key))
self.option_values[key] = val
# set up defaults
for name, (description, default) in self.options.iteritems():
for name, (description, default) in self.options.items():
if not name in self.option_values:
self.option_values[name] = default