From 100b2b2180579f968528682377aa3c0905f525f1 Mon Sep 17 00:00:00 2001 From: Christopher Denter Date: Sun, 30 Jan 2011 17:25:49 +0100 Subject: [PATCH 1/5] mactouch: Fix mactouch input provider. (I broke it during pep8 conversion, sorry) --- kivy/input/providers/mactouch.py | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/kivy/input/providers/mactouch.py b/kivy/input/providers/mactouch.py index cd68d5656..fcc1315c1 100644 --- a/kivy/input/providers/mactouch.py +++ b/kivy/input/providers/mactouch.py @@ -21,7 +21,7 @@ if 'KIVY_DOC' not in os.environ: dll = '/System/Library/PrivateFrameworks/' + \ 'MultitouchSupport.framework/MultitouchSupport' - MultitouchSupport = ctypes.CDLL() + MultitouchSupport = ctypes.CDLL(dll) CFArrayGetCount = MultitouchSupport.CFArrayGetCount CFArrayGetCount.argtypes = [CFArrayRef] @@ -66,23 +66,23 @@ if 'KIVY_DOC' not in os.environ: ('unknown5_2', ctypes.c_int), ('unknown6', ctypes.c_float), ] - MTDataRef = ctypes.POINTER(MTData) + MTDataRef = ctypes.POINTER(MTData) - MTContactCallbackFunction = ctypes.CFUNCTYPE(ctypes.c_int, ctypes.c_int, - MTDataRef, ctypes.c_int, - ctypes.c_double, ctypes.c_int) + MTContactCallbackFunction = ctypes.CFUNCTYPE(ctypes.c_int, ctypes.c_int, + MTDataRef, ctypes.c_int, + ctypes.c_double, ctypes.c_int) - MTDeviceRef = ctypes.c_void_p + MTDeviceRef = ctypes.c_void_p - MTRegisterContactFrameCallback = \ - MultitouchSupport.MTRegisterContactFrameCallback - MTRegisterContactFrameCallback.argtypes = \ - [MTDeviceRef, MTContactCallbackFunction] - MTRegisterContactFrameCallback.restype = None + MTRegisterContactFrameCallback = \ + MultitouchSupport.MTRegisterContactFrameCallback + MTRegisterContactFrameCallback.argtypes = \ + [MTDeviceRef, MTContactCallbackFunction] + MTRegisterContactFrameCallback.restype = None - MTDeviceStart = MultitouchSupport.MTDeviceStart - MTDeviceStart.argtypes = [MTDeviceRef, ctypes.c_int] - MTDeviceStart.restype = None + MTDeviceStart = MultitouchSupport.MTDeviceStart + MTDeviceStart.argtypes = [MTDeviceRef, ctypes.c_int] + MTDeviceStart.restype = None else: MTContactCallbackFunction = lambda x: None From cb66d524aabb677a7c6beb345ded2054ff481b95 Mon Sep 17 00:00:00 2001 From: Christopher Denter Date: Sun, 30 Jan 2011 18:08:43 +0100 Subject: [PATCH 2/5] mactouch: Disable two debug prints --- kivy/input/providers/mactouch.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kivy/input/providers/mactouch.py b/kivy/input/providers/mactouch.py index fcc1315c1..dbd5e4080 100644 --- a/kivy/input/providers/mactouch.py +++ b/kivy/input/providers/mactouch.py @@ -131,10 +131,10 @@ class MacMotionEventProvider(MotionEventProvider): # ok, listing devices, and attach ! devices = MultitouchSupport.MTDeviceCreateList() num_devices = CFArrayGetCount(devices) - print 'num_devices =', num_devices + # print 'num_devices =', num_devices for i in xrange(num_devices): device = CFArrayGetValueAtIndex(devices, i) - print 'device #%d: %016x' % (i, device) + # print 'device #%d: %016x' % (i, device) # create touch dict for this device data_id = str(device) self.touches[data_id] = {} From aa262561356db99603ce3d610291d27eb5881b17 Mon Sep 17 00:00:00 2001 From: Christopher Denter Date: Sun, 30 Jan 2011 19:20:30 +0100 Subject: [PATCH 3/5] docs: warn users that core image != widget image --- doc/sources/guide/architecture.rst | 2 ++ kivy/core/__init__.py | 9 +++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/doc/sources/guide/architecture.rst b/doc/sources/guide/architecture.rst index d1e702262..af700f1b6 100644 --- a/doc/sources/guide/architecture.rst +++ b/doc/sources/guide/architecture.rst @@ -14,6 +14,8 @@ Kivy consists of several building blocks that we will explain in the following. +.. _providers: + Core Providers and Input Providers ---------------------------------- diff --git a/kivy/core/__init__.py b/kivy/core/__init__.py index 7aae6ca7d..896fd3eba 100644 --- a/kivy/core/__init__.py +++ b/kivy/core/__init__.py @@ -4,13 +4,18 @@ Core Abstraction This module defines the abstraction layers for our core providers and their implementations. For further information, please refer to -`Architectural Overview` and the `Core Providers and Input Providers` section -of the documentation. +:ref:`architecture` and the :ref:`providers` section of the documentation. In most cases, you shouldn't directly use a library that's already covered by the core abstraction. Always try to use our providers first. In case we are missing a feature or method, please let us know by opening a new Bug report instead of relying on your library. + + **Note:** + These are **not** widgets! These are just abstractions of the respective + functionality. For example, you cannot add a core image to your window. + You have to use the image **widget** class instead. If you're really + looking for widgets, please refer to :mod:`kivy.uix` instead. ''' import os From 345a1e8da2e7f83c2d6dacbd51767861fcfc47d1 Mon Sep 17 00:00:00 2001 From: Christopher Denter Date: Sun, 30 Jan 2011 20:16:09 +0100 Subject: [PATCH 4/5] docs: re-add basic install commands for beginners --- doc/sources/contribute.rst | 9 ++++---- doc/sources/guide/installation.rst | 37 ++++++++++++++++++++++++++---- 2 files changed, 36 insertions(+), 10 deletions(-) diff --git a/doc/sources/contribute.rst b/doc/sources/contribute.rst index 7c8cf7336..e5bd5be23 100644 --- a/doc/sources/contribute.rst +++ b/doc/sources/contribute.rst @@ -42,21 +42,20 @@ Code Workflow ~~~~~~~~~~~~~ So here is the initial setup to begin with our workflow (you only need to do -this once to install Kivy): +this once to install Kivy). Basically you follow the installation +instructions from :ref:`dev-install`, but you don't clone our repository, +but the fork you create with the following steps: #. Log in to GitHub #. Create a fork of the `Kivy repository `_ by clicking the *fork* button. #. Clone your fork of our repository to your computer. Your fork will have the git remote name 'origin' and you will be on branch 'master'. + #. Compile and set up PYTHONPATH or install (see :ref:`dev-install`). #. Install our pre-commit hook that ensures your code doesn't violate our styleguide by executing 'make hook' in your clone. This will run our styleguide check whenever you do a commit, and if there are violations in the parts that you changed, your commit will be aborted. Fix & retry. - #. Set up the `PYTHONPATH environment variable `_ - to point at your clone. - This way you don't have to install (``setup.py install``) after every tiny - modification. Python will instead import Kivy from your clone. Now, whenever you want to create a patch, you follow the following steps: diff --git a/doc/sources/guide/installation.rst b/doc/sources/guide/installation.rst index 690f2d710..79d2adf57 100644 --- a/doc/sources/guide/installation.rst +++ b/doc/sources/guide/installation.rst @@ -64,10 +64,37 @@ necessary packages: python-gst0.10 python-enchant gstreamer0.10-plugins-good cython python-dev \ build-essential libgl1-mesa-dev libgles2-mesa-dev +.. _dev-install: -Installing Kivy -~~~~~~~~~~~~~~~ +Installing Kivy for Development +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -In order to set up Kivy for development, please set up a development -environment for Kivy on your computer. Follow the steps mentioned in -:ref:`contributing`. +Now that you've installed all the required dependencies, it's time to +download and compile a development version of Kivy:: + + $ # Download Kivy from GitHub + $ git clone git://github.com/tito/kivy.git + $ cd kivy + + $ # Compile: + $ python setup.py build_ext --inplace + $ python setup.py build_factory + +If you have the ``make`` command available, you can also use the +following shortcut to compile (does the same as the last two commands):: + + $ make build + +If you want to modify the Kivy codebase itself, +set up the `PYTHONPATH environment variable `_ +to point at your clone. +This way you don't have to install (``setup.py install``) after every tiny +modification. Python will instead import Kivy from your clone. + +Or, if you don't want to make any changes to Kivy itself, you can also run +(as admin, e.g. with sudo):: + + $ python setup.py install + +If you want to contribute code (patches, new features) to the Kivy +codebase, please read :ref:`contributing`. From 19b02bf5a7e5399a7405512c3c4ca2b62b3d6093 Mon Sep 17 00:00:00 2001 From: Christopher Denter Date: Sun, 30 Jan 2011 20:25:47 +0100 Subject: [PATCH 5/5] docs: remove build_factory command --- doc/sources/guide/installation.rst | 1 - 1 file changed, 1 deletion(-) diff --git a/doc/sources/guide/installation.rst b/doc/sources/guide/installation.rst index 79d2adf57..7d10693f9 100644 --- a/doc/sources/guide/installation.rst +++ b/doc/sources/guide/installation.rst @@ -78,7 +78,6 @@ download and compile a development version of Kivy:: $ # Compile: $ python setup.py build_ext --inplace - $ python setup.py build_factory If you have the ``make`` command available, you can also use the following shortcut to compile (does the same as the last two commands)::