Skip to content

Commit 5e2fea0

Browse files
committed
Merge pull request #9 from Pegase745/develop
Allowing to run with python 3.*
2 parents 5a8ba2b + b435f5c commit 5e2fea0

File tree

5 files changed

+36
-7
lines changed

5 files changed

+36
-7
lines changed

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ language: python
22
python:
33
- "2.6"
44
- "2.7"
5+
- "3.2"
6+
- "3.3"
57
install:
68
- pip install . --use-mirrors
79
- pip install -r requirements.txt --use-mirrors

README.rst

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ sqlalchemy-datatables |Build Status|
99
Usage
1010
-----
1111

12-
The package is available on `PyPI <https://pypi.python.org/pypi/sqlalchemy-datatables/0.1.5>`_
12+
The package is available on `PyPI <https://pypi.python.org/pypi/sqlalchemy-datatables/0.1.6>`_
1313

1414
.. code-block:: bash
1515
@@ -132,6 +132,12 @@ Testing the Pyramid based ''test-project''
132132
Changelog
133133
---------
134134

135+
**v0.1.6 (16/12/2013)**
136+
137+
138+
- Allow package to run with python 3.*
139+
- README modifications
140+
135141
**v0.1.5 (18/10/2013)**
136142

137143

datatables/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# -*- coding: utf-8 -*-
2-
__VERSION__ = '0.1.5'
2+
__VERSION__ = '0.1.6'
33

44
from datatables import *

setup.py

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,20 @@
11
#!/usr/bin/env python
22
from setuptools import setup, find_packages
33

4-
__VERSION__ = [line for line in file('datatables/__init__.py', 'rb') \
5-
if line.startswith('__VERSION__')][0].split(\
6-
'=')[1].strip().lstrip('\'').rstrip('\'')
4+
import sys
5+
6+
if sys.version_info >= (3,0):
7+
def my_open(path, mode):
8+
return open(path, mode, newline='')
9+
else:
10+
def my_open(path, mode):
11+
return open(path, mode+'b')
12+
13+
14+
__VERSION__ = [line for line in my_open('datatables/__init__.py', 'r') \
15+
if line.startswith('__VERSION__')][0].split(\
16+
'=')[1].strip().lstrip('\'').rstrip('\'')
17+
718

819
setup(
920
name='sqlalchemy-datatables',
@@ -21,14 +32,21 @@
2132
install_requires=['sqlalchemy'],
2233
py_modules=['datatables'],
2334
classifiers=[
24-
'Development Status :: 4 - Beta',
35+
'Development Status :: 5 - Production/Stable',
2536
'Environment :: Web Environment',
2637
'Framework :: Pyramid',
38+
'Framework :: Flask',
2739
'Intended Audience :: Developers',
2840
'License :: OSI Approved :: MIT License',
41+
'Natural Language :: English',
2942
'Operating System :: OS Independent',
3043
'Programming Language :: Python',
44+
'Programming Language :: Python :: 2',
45+
'Programming Language :: Python :: 2.6',
3146
'Programming Language :: Python :: 2.7',
47+
'Programming Language :: Python :: 3',
48+
'Programming Language :: Python :: 3.2',
49+
'Programming Language :: Python :: 3.3',
3250
'Topic :: Internet :: WWW/HTTP',
3351
'Topic :: Software Development :: Libraries',
3452
'Topic :: Software Development :: Libraries :: Python Modules',

test-project/testproject/models.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1+
from __future__ import absolute_import, unicode_literals
2+
13
import datetime, json
4+
25
from sqlalchemy import (
36
Column,
47
Integer,
@@ -33,7 +36,7 @@ def __init__(self, name):
3336
self.name = name
3437

3538
def __str__(self):
36-
return u"%s" % self.name
39+
return "%s" % self.name
3740

3841
def __repr__(self):
3942
return '<%s#%s>' % (self.__class__.__name__, self.id)

0 commit comments

Comments
 (0)