Skip to content

Commit

Permalink
Merge pull request #25 from dbrgn/py3
Browse files Browse the repository at this point in the history
Declare Python 3 compatibility
  • Loading branch information
dbrgn committed Nov 27, 2017
2 parents 9f2fca3 + b4e54f8 commit 510d305
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ sudo: false
language: python
python:
- 2.7
- 3.4
- 3.5
- 3.6
matrix:
allow_failures:
- python: 3.5
fast_finish: true
install:
- pip install -r requirements-dev.txt
Expand Down
3 changes: 1 addition & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ Of these, *Tangible* does the first three steps. The fourth step is handled by
a programmatic CAD tool like *OpenSCAD* or *ImplicitSCAD* and the last four
steps are handled by the specific 3D printer software.

Currently supported Python version is 2.7. Support for 3.4+ is
planned.
Currently supported Python version is 2.7 and 3.4+.

This library was my student research project thesis at `HSR <http://hsr.ch/>`_.
You can find the thesis paper here: https://files.dbrgn.ch/sa-thesis.pdf
Expand Down
4 changes: 2 additions & 2 deletions docs/examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ example <example_csv>` into months, a :class:`BarsND
from tangible.backends.openscad import OpenScadBackend

# Read data into list
datapoints = [list() for i in xrange(9)]
datapoints = [list() for i in range(9)]
with open('analytics-full-13.csv', 'r') as datafile:
reader = csv.DictReader(datafile)
for row in reader:
Expand Down Expand Up @@ -209,7 +209,7 @@ The easiest and cleanest way to do this, is to create a subclass of the
class Cogwheel(BaseShape):
def _build_ast(self):
cogs = []
for i in xrange(18):
for i in range(18):
cog = ast.Rectangle(2, 2)
translated = ast.Translate(9.5, -1, 0, cog)
rotated = ast.Rotate(i * 30, (0, 0, 1), translated)
Expand Down
5 changes: 5 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Topic :: Artistic Software',
'Topic :: Multimedia :: Graphics :: 3D Modeling',
'Topic :: Scientific/Engineering :: Visualization',
Expand Down
6 changes: 3 additions & 3 deletions tangible/backends/openscad.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class Statement(object):
def __init__(self, text, *args, **kwargs):
self.suffix = kwargs.pop('suffix', ';')
if kwargs:
raise TypeError('invalid keyword arguments %r' % (kwargs.keys(),))
raise TypeError('invalid keyword arguments %r' % list(kwargs.keys()))
if args:
text = text.format(*args)
self.text = text
Expand All @@ -29,7 +29,7 @@ def __init__(self, text, *args, **kwargs):
self.prefix = kwargs.pop('prefix', '{')
self.suffix = kwargs.pop('suffix', '};')
if kwargs:
raise TypeError('invalid keyword arguments %r' % (kwargs.keys(),))
raise TypeError('invalid keyword arguments %r' % list(kwargs.keys()))
self.title = Statement(text, *args, suffix='')
self.children = []
self.stack = []
Expand All @@ -41,7 +41,7 @@ def _get_head(self):
return self.stack[-1]

def emptyline(self, count=1):
for i in xrange(count):
for i in range(count):
self._get_head().children.append(EmptyStatement)

def statement(self, *args, **kwargs):
Expand Down

0 comments on commit 510d305

Please sign in to comment.