Skip to content

Instantly share code, notes, and snippets.

from kivy.app import App
from kivy.lang import Builder
from kivy.graphics import Color, Rectangle
from kivy.properties import ObjectProperty
from kivy.uix.behaviors import ButtonBehavior
from kivy.uix.screenmanager import ScreenManager, Screen
from kivy.uix.floatlayout import FloatLayout
from kivy.uix.scrollview import ScrollView
__author__ = 'Cheaterman'
from kivy.app import App
from kivy.uix.screenmanager import ScreenManager
from kivy.lang import Builder
kv = """
<TestWidget>:
#:import F kivy.factory.Factory
<TestView@ModalView>:
size_hint: .5, .5
ScrollView:
size_hint: .9, .9
pos_hint: {'center': (.5, .5)}
GridLayout:
cols: 10
size_hint_y: None
@kived
kived / trigger_decorator.py
Last active August 29, 2015 14:25 — forked from clayote/trigger_decorator.py
Trying to make a decorator to make triggers lazily
from kivy.event import EventDispatcher
from kivy.clock import Clock
from functools import partial
class trigger(object):
"""Make a trigger from a method outside of your class's __init__."""
def __init__(self, func_or_timeout):
if callable(func_or_timeout):
self.func = func_or_timeout
from twisted.internet.protocol import Protocol, ClientFactory
from twisted.internet.defer import inlineCallbacks
from twisted.internet.threads import deferToThread
import pdb
# audio imports
import pyaudio,wave
class AudioClientFactory(ClientFactory):
def __init__(self, canvas_obj):
self.canvas_obj = canvas_obj