Commits

Ronald Oussoren  committed 4c62166

Generic setup.py; don't hardcode setuptools/distribute versions

  • Participants
  • Parent commits 20b207c
  • Branches pyobjc-ancient

Comments (0)

Files changed (3)

File pyobjc-framework-InputMethodKit/Lib/InputMethodKit/PyObjC.bridgesupport

     <method selector='mouseDownOnCharacterIndex:coordinate:withModifier:continueTracking:client:'>
       <retval type='B' />
       <arg index='0' type='I' type64='Q' />
-      <arg index='1' type='{_NSPoint=ff}' type64='{_CGPoint=dd}' />
+      <arg index='1' type='{_NSPoint=ff}' type64='{CGPoint=dd}' />
       <arg index='2' type='I' type64='Q' />
       <arg index='3' type='^B' type_modifier='o' />
     </method>
     <method selector='mouseMovedOnCharacterIndex:coordinate:withModifier:client:'>
       <retval type='B' />
       <arg index='0' type='I' type64='Q' />
-      <arg index='1' type='{_NSPoint=ff}' type64='{_CGPoint=dd}' />
+      <arg index='1' type='{_NSPoint=ff}' type64='{CGPoint=dd}' />
       <arg index='2' type='I' type64='Q' />
     </method>
     <method selector='mouseUpOnCharacterIndex:coordinate:withModifier:client:'>
       <retval type='B' />
       <arg index='0' type='I' type64='Q' />
-      <arg index='1' type='{_NSPoint=ff}' type64='{_CGPoint=dd}' />
+      <arg index='1' type='{_NSPoint=ff}' type64='{CGPoint=dd}' />
       <arg index='2' type='I' type64='Q' />
     </method>
   </class>

File pyobjc-framework-InputMethodKit/PyObjCTest/test_imkinputcontroller.py

-
 from PyObjCTools.TestSupport import *
 from InputMethodKit import *
+import sys
 
 class TestIMKInputControllerHelper (NSObject):
     def inputText_key_modifiers_client_(self, s, k, m, snd):
         self.assertResultIsBOOL(TestIMKInputControllerHelper.mouseDownOnCharacterIndex_coordinate_withModifier_continueTracking_client_)
         self.assertArgHasType(TestIMKInputControllerHelper.mouseDownOnCharacterIndex_coordinate_withModifier_continueTracking_client_, 0, objc._C_NSUInteger)
         self.assertArgHasType(TestIMKInputControllerHelper.mouseDownOnCharacterIndex_coordinate_withModifier_continueTracking_client_, 1, NSPoint.__typestr__)
+
         self.assertArgHasType(TestIMKInputControllerHelper.mouseDownOnCharacterIndex_coordinate_withModifier_continueTracking_client_, 2, objc._C_NSUInteger)
         self.assertArgHasType(TestIMKInputControllerHelper.mouseDownOnCharacterIndex_coordinate_withModifier_continueTracking_client_, 3, objc._C_OUT+objc._C_PTR+objc._C_NSBOOL)
 

File pyobjc-framework-InputMethodKit/pyobjc_setup.py

 __all__ = ('setup', 'Extension', 'Command')
 
 import sys
-if sys.version_info[:2] < (3, 0):
-    import ez_setup
-    ez_setup.use_setuptools()
 
-    from setuptools.command.test import test as oc_test
-    from setuptools.command.build_py import build_py as oc_build_py
+try:
+    import setuptools
 
-    extra_args = {}
-
-
-else:
+except ImportError:
     import distribute_setup
     distribute_setup.use_setuptools()
 
-    from setuptools.command import test
-    from setuptools.command import build_py
+from setuptools.command import test
+from setuptools.command import build_py
 
-    from distutils import log
+from distutils import log
 
-    extra_args=dict(
-        use_2to3 = True,
-    )
+extra_args=dict(
+    use_2to3 = True,
+)
 
 
-    class oc_build_py (build_py.build_py):
-        def build_packages(self):
-            log.info("Overriding build_packages to copy PyObjCTest")
-            p = self.packages
-            self.packages = list(self.packages) + ['PyObjCTest']
-            try:
-                build_py.build_py.build_packages(self)
-            finally:
-                self.packages = p
+class oc_build_py (build_py.build_py):
+    def build_packages(self):
+        log.info("Overriding build_packages to copy PyObjCTest")
+        p = self.packages
+        self.packages = list(self.packages) + ['PyObjCTest']
+        try:
+            build_py.build_py.build_packages(self)
+        finally:
+            self.packages = p
 
 
 
-    class oc_test (test.test):
-        def run_tests(self):
-            import sys, os
+class oc_test (test.test):
+    def run_tests(self):
+        import sys, os
 
-            rootdir =  os.path.dirname(os.path.abspath(__file__))
-            if rootdir in sys.path:
-                sys.path.remove(rootdir)
+        rootdir =  os.path.dirname(os.path.abspath(__file__))
+        if rootdir in sys.path:
+            sys.path.remove(rootdir)
 
-            import PyObjCTest
-            import unittest
-            from pkg_resources import EntryPoint
-            loader_ep = EntryPoint.parse("x="+self.test_loader)
-            loader_class = loader_ep.load(require=False)
+        import PyObjCTest
+        import unittest
+        from pkg_resources import EntryPoint
+        loader_ep = EntryPoint.parse("x="+self.test_loader)
+        loader_class = loader_ep.load(require=False)
 
-            unittest.main(None, None, [unittest.__file__]+self.test_args, testLoader=loader_class())
+        unittest.main(None, None, [unittest.__file__]+self.test_args, testLoader=loader_class())