Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python 2/3 compat fixes, and first demo apps with bundled python3.5 #32

Merged
merged 14 commits into from
Jul 24, 2017

Commits on Dec 12, 2016

  1. Replace implicit relative inports with absolute imports

    in Lib/vanilla/test/testAll.py, use `importlib.reload` as the built-in `reload` is no longer available in Python 3
    Cosimo Lupo committed Dec 12, 2016
    Configuration menu
    Copy the full SHA
    73da70f View commit details
    Browse the repository at this point in the history
  2. add 'py23' module; define 'unicode' and 'long' as aliases to 'str' an…

    …d 'int' for PY3
    Cosimo Lupo committed Dec 12, 2016
    Configuration menu
    Copy the full SHA
    ffd8e58 View commit details
    Browse the repository at this point in the history
  3. replace deprecated apply(func, args, kwargs) with with func(*args, **…

    …kwargs)
    Cosimo Lupo committed Dec 12, 2016
    Configuration menu
    Copy the full SHA
    1df134b View commit details
    Browse the repository at this point in the history
  4. replace comma with parentheses when Exception is raised

    Cosimo Lupo committed Dec 12, 2016
    Configuration menu
    Copy the full SHA
    b8473e8 View commit details
    Browse the repository at this point in the history
  5. py23: define basestring as str in PY3

    Cosimo Lupo committed Dec 12, 2016
    Configuration menu
    Copy the full SHA
    9993aad View commit details
    Browse the repository at this point in the history
  6. fix objc.BadPrototypeError by adding @objc.python_method decorator to…

    … methods that are only used from Python and never from Objective-C
    
    From https://pythonhosted.org/pyobjc/core/changelog.html, "Version 3.2":
    
    """
    Backward compatibility note: Due to a change in the way the default method signature is calculated PyObjC is now more strict in enforcing the Python<->Objective-C mapping for selectors and a number of code patterns that were allowed before are no longer allowed, in particular the following method definitions raise objc.BadPrototypeError:
    
    class MyObject (NSObject):
       def mymethod(self, a, b): ...
       def method_arg_(self, a, b, c): ...
    
    If these methods are only used from Python and are never used from Objective-C the error can be avoided by decorating these methods with objc.python_method:
    
    class MyObject (NSObject):
       @objc.python_method
       def mymethod(self, a, b): ...
    
    This cannnot be used for methods used from Objective-C, for those you will have to rename the method or you will have to provide an appropriate selector explictly
    """
    Cosimo Lupo committed Dec 12, 2016
    Configuration menu
    Copy the full SHA
    212123d View commit details
    Browse the repository at this point in the history
  7. replace print statements with print() function, including docstrings …

    …examples
    
    I didn't bother adding `from __future__ import print_function` in the docstring examples.
    That should be implied (hopefully).
    Cosimo Lupo committed Dec 12, 2016
    Configuration menu
    Copy the full SHA
    a0f89ec View commit details
    Browse the repository at this point in the history
  8. py23: define range = xrange, and fix up uses of range; use enumerate …

    …instead of range(len(...))
    
    Also, replace:
    
    for index in range(len(alist)):
        item = alist[index]
    
    with enumerate():
    
    for index, item in enumerate(alist):
        ...
    Cosimo Lupo committed Dec 12, 2016
    Configuration menu
    Copy the full SHA
    868450c View commit details
    Browse the repository at this point in the history
  9. TinyTextEditor.py: use io.open() with UTF-8 encoding when reading/wri…

    …ting text
    Cosimo Lupo committed Dec 12, 2016
    Configuration menu
    Copy the full SHA
    af6ba61 View commit details
    Browse the repository at this point in the history
  10. py23: define unichr == chr in PY3

    Cosimo Lupo committed Dec 12, 2016
    Configuration menu
    Copy the full SHA
    66ed220 View commit details
    Browse the repository at this point in the history
  11. convert dict.keys() to list where relevant; use sorted() to get sorte…

    …d list of dict.keys()
    Cosimo Lupo committed Dec 12, 2016
    Configuration menu
    Copy the full SHA
    a77ec1f View commit details
    Browse the repository at this point in the history
  12. replace has_key() with in

    Cosimo Lupo committed Dec 12, 2016
    Configuration menu
    Copy the full SHA
    8c6d102 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    a793989 View commit details
    Browse the repository at this point in the history

Commits on Dec 13, 2016

  1. dialogs.py: fix another objc.BadPrototypeError with @objc.python_meth…

    …od decorator
    
    same as 212123d
    Cosimo Lupo committed Dec 13, 2016
    Configuration menu
    Copy the full SHA
    8c06107 View commit details
    Browse the repository at this point in the history