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.app import App | |
from kivy.factory import Factory | |
from kivy.lang import Builder | |
from kivy.properties import ObjectProperty | |
from kivy.uix.boxlayout import BoxLayout | |
Builder.load_string(''' | |
<MilkshakeRoot>: | |
milkshakes: box_with_milkshakes | |
orientation: 'vertical' |
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
/Applications/Kivy.app/Contents/Resources/script /Users/roger/Library/Preferences/PyCharm40/scratches/scratch | |
2015-04-14 21:48:40+0200 [-] Log opened. | |
2015-04-14 21:48:40+0200 [-] Starting factory <autobahn.twisted.websocket.WampWebSocketClientFactory object at 0x1013e6590> | |
2015-04-14 21:48:40+0200 [Uninitialized] | |
[('debug', True, 'WampWebSocketClientFactory'), | |
('debugCodePaths', False, 'WampWebSocketClientFactory'), | |
('logOctets', True, 'WampWebSocketClientFactory'), | |
('logFrames', True, 'WampWebSocketClientFactory'), | |
('trackTimings', False, 'WampWebSocketClientFactory'), | |
('allowHixie76', False, 'WampWebSocketClientFactory'), |
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 twisted.internet import reactor | |
from twisted.internet.defer import inlineCallbacks | |
from autobahn.twisted.wamp import ApplicationSession | |
class Component(ApplicationSession): | |
@inlineCallbacks | |
def onJoin(self, details): | |
print('session attached') |
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
# As the Kivy docs ( http://kivy.org/docs/guide/other-frameworks.html ) state: | |
# install_twisted_rector must be called before importing and using the reactor. | |
from kivy.support import install_twisted_reactor | |
install_twisted_reactor() | |
from autobahn.twisted.websocket import WebSocketClientProtocol, \ | |
WebSocketClientFactory | |
class MyKivyClientProtocol(WebSocketClientProtocol): |