Commits

Pedro Romano committed 88eeab0

Use 'future' package to make code compatible with Python 2.6, 2.7 and 3.3+. Update package version.

Comments (0)

Files changed (2)

ropemacs/__init__.py

 """ropemacs, an emacs mode for using rope refactoring library"""
+from future.builtins import chr, int
+
 import sys
 
 import ropemode.decorators
         return ''.join(result)
 
     def _set_interaction(self, callback, prefix):
-        if hasattr(callback, 'im_func'):
-            callback = callback.im_func
+        if hasattr(callback, '__func__'):
+            callback = callback.__func__
         if prefix:
             callback.interaction = 'P'
         else:
+import sys
+
+if sys.version < '3':
+    rope_package = 'rope'
+else:
+    rope_package = 'rope_py3k'
+
 extra_kwargs = {}
 try:
     from setuptools import setup
-    extra_kwargs['install_requires'] = ['rope >= 0.9.4', 'ropemode >= 0.2']
+    extra_kwargs['install_requires'] = [
+        'future >= 0.11.2',
+        rope_package + ' >= 0.9.4',
+        'ropemode >= 0.3a1'
+    ]
 except ImportError:
     from distutils.core import setup
 
     'Topic :: Software Development']
 
 def get_long_description():
+    from future.builtins import open
     lines = open('README.txt').read().splitlines(False)
     end = lines.index('Setting Up')
     return '\n' + '\n'.join(lines[:end]) + '\n'
 
 setup(name='ropemacs',
-      version='0.7',
+      version='0.8a1',
       description='An emacs mode for using rope python refactoring library',
       long_description=get_long_description(),
       packages=['ropemacs'],
       url='http://rope.sf.net/ropemacs.html',
       license='GNU GPL',
       classifiers=classifiers,
-      requires=['ropemode'],
+      requires=['future (>= 0.11.2)', 'ropemode (>= 0.3a1)'],
       **extra_kwargs)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.