Skip to content

Instantly share code, notes, and snippets.

View geojeff's full-sized avatar

Jeff Pittman geojeff

View GitHub Profile
cdef inline void observable_list_dispatch(object self):
cdef Property prop = self.prop
obj = self.obj()
if obj is not None:
prop.dispatch(obj)
class ObservableList(list):
# Internal class to observe changes inside a native python list.
def __init__(self, *largs):
def scroll_after_add(self):
if not self.scrolling:
available_height = self.height
index = self._index
while available_height > 0:
item_view = self.adapter.get_view(index)
if item_view is None:
break
index += 1
def delete_data_item(self, item):
if item in self.data:
index = self.data.index(item)
if item in self.selection:
self.dispatch('on_selection_change')
self.data.remove(item)
self.dispatch('on_data_item_delete', index)
def delete_data_item_at_index(self, index):
if 0 <= index < len(self.data):
bin/pip install -r https://raw.github.com/Kotti/Kotti/master/requirements.txt
Traceback (most recent call last):
File "bin/pip", line 5, in <module>
from pkg_resources import load_entry_point
ImportError: No module named pkg_resources
3 Downloading/unpacking Babel==0.9.6 (from -r https://raw.github.com/Kotti/Kotti/master/requirements.txt (line 1))
4
5 Getting page http://pypi.python.org/simple/Babel
6 URLs to search for versions for Babel==0.9.6 (from -r https://raw.github.com/Kotti/Kotti/master/requirements.txt (line 1)):
7 * http://pypi.python.org/simple/Babel/0.9.6
8 * http://pypi.python.org/simple/Babel/
9 Getting page http://pypi.python.org/simple/Babel/0.9.6
10 Getting page http://babel.edgewall.org/
11 Could not fetch URL http://pypi.python.org/simple/Babel/0.9.6: HTTP Error 404: Not Found (Babel/0.9.6)
12 Will skip URL http://pypi.python.org/simple/Babel/0.9.6 when looking for download links for Babel==0.9.6 (from -r https://raw.github.com/Kotti/Kotti/master/requirements.txt (line 1))
from kivy.uix.widget import Widget
from kivy.properties import ListProperty
from kivy.properties import FloatProperty
class GraphicsElement(Widget):
label = StringProperty('')
# label_containment is either ``inside`` or ``outside`` the element.
(kivy)ibis~/Development/kivy/contrib/kivy(mrbob|…) % cdvirtualenv 1 ↵
(kivy)ibis~VIRTUAL_ENV % ls lib/python2.7/site-packages
Cython coverage-3.6-py2.7-macosx-10.4-x86_64.egg hgext pip-1.2.1-py2.7.egg setuptools-0.6c11-py2.7.egg
Cython-0.17.4-py2.7.egg-info cython.py mercurial pygame setuptools.pth
PIL cython.pyc mercurial-2.4.2-py2.7.egg-info pygame-1.9.2pre-py2.7.egg-info
PIL.pth easy-install.pth nose-1.2.1-py2.7.egg pyximport
import kivy
kivy.require('{{{ kivy.target_version }}}')
from kivy.uix.floatlayout import FloatLayout
from kivy.app import App
from kivy.properties import ObjectProperty, StringProperty
class {{{ widget.class_name}}}(FloatLayout):
'''{{{ widget.description }}}
from kivy.uix.modalview import ModalView
from kivy.uix.listview import ListView
from kivy.uix.gridlayout import GridLayout
from kivy.lang import Builder
from kivy.factory import Factory
# Note the special nature of indentation in the adapter declaration, where
# the adapter: is on one line, then the value side must be given at one level
# of indentation.
def events_below_context(self, context, request, permission='view'):
"""
Get recursive all children of the given context.
:result: List with all children of a given context.
:rtype: list
"""
tree = nodes_tree(request,
context=context,
permission=permission)