This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Solution 1 | |
# original solution proposed in the PR | |
# pro: easy declaration | |
# cons: instanciation is a little bit hard to write | |
# possible method conflict with multiple protocols | |
class MyObjcDelegate: | |
def connection_didFailWithError_(self, connection, error): | |
print("Protocol method got called!!", connection, error) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ls -lah scatter.py | |
-rw-rw-r-- 1 tito tito 19K févr. 11 15:13 scatter.py | |
$ python -OO -m compileall scatter.py | |
$ ls -lah scatter.pyo | |
-rw-rw-r-- 1 tito tito 12K févr. 19 14:27 scatter.pyo | |
$ cython scatter.py | |
$ gcc $(pkg-config --libs --cflags python) -fPIC -shared -o scatter.so scatter.c | |
$ ls -lah scatter.so |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
----- pid 10622 at 2014-03-19 17:19:32 ----- | |
Cmd line: com.meltingrocks.kivy2048:python | |
JNI: CheckJNI is off; workarounds are off; pins=0; globals=727 | |
DALVIK THREADS: | |
(mutexes: tll=0 tsl=0 tscl=0 ghl=0) | |
"main" prio=5 tid=1 NATIVE | |
| group="main" sCount=1 dsCount=0 obj=0x41586ca8 self=0x414c0408 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
doc/sources/installation/installation-linux.rst | |
394: $ python main.py | |
399: $ python main.py | |
413:If you wish to start your Kivy programs as scripts (by typing `./main.py`) or by double-clicking them, | |
422:Then, inside each main.py, add a new first line:: | |
doc/sources/installation/installation-rpi.rst | |
59: python main.py | |
64: python main.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from kivy.properties import NumericProperty | |
from kivy.graphics import Mesh, Line, Rectangle, ClearBuffers | |
from kivy.graphics.texture import Texture | |
from kivy.graphics.fbo import Fbo | |
from kivy.uix.widget import Widget | |
from kivy.uix.label import Label | |
from kivy.app import App | |
from math import pi, atan2, cos, sin | |
from kivy.clock import Clock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def on_index_pos(self, instance, index_pos): | |
slide = self.current_slide | |
if not hasattr(self, '_old_slide'): | |
self._old_slide = None | |
if self._old_slide: | |
self._old_slide.is_focused = False | |
if slide: | |
slide.is_focused = True | |
self._old_slide = slide | |
self.ensure_slides() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Animator | |
======== | |
An `Animator` describe an event timeline that can be executed in top of any | |
widget. An `Executor` is responsible of executing an `Animator` on a `Widget`. | |
.. todo:: | |
- relative attribute movement |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
P4A_pyjnius_DIR=~/code/pyjnius ./distribute.sh -b minimal -m 'pyjnius python' -u pyjnius | |
cd .; ./build.py --package org.minimal.test --name _MINIMAL --version 1 --private ~/code/testmininal --asset debug installd | |
adb logcat *:S python:D | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import operator | |
from types import GeneratorType | |
from kivy.compat import string_types, iteritems | |
class Selector(object): | |
def __init__(self, children=[]): | |
super(Selector, self).__init__() | |
if not isinstance(children, (list, tuple, GeneratorType)): | |
self.children = (children, ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/kivy | |
__version__ = '1.0' | |
import kivy | |
kivy.require('1.0.6') | |
from kivy.app import App | |
from kivy.uix.floatlayout import FloatLayout | |
from kivy.uix.label import Label | |
from kivy.graphics import Color, Rectangle, Point, GraphicException |
OlderNewer