Skip to content

Instantly share code, notes, and snippets.

View chozabu's full-sized avatar

Alex P-B chozabu

View GitHub Profile
Verifying that +chozabu is my blockchain ID. https://onename.com/chozabu
win = Window
win.bind(on_keyboard=self.my_key_handler)
win.bind(on_joy_axis=self.my_axis_handler)
win.bind(on_joy_hat=self.printe)
win.bind(on_joy_ball=self.printe)
win.bind(on_joy_button_down=self.my_jbutton_down)
win.bind(on_joy_button_up=self.printe)
def printe(self, window, stickid, a=0,b=0,c=0,d=0,e=0):
print a,b,c,d,e
return False
@chozabu
chozabu / zordertest
Last active August 29, 2015 14:12
testing zorder in kivy
from kivy.uix.widget import Widget
from random import randint
def getzs(tw):
zs = []
for i in tw.children:
zs.append(i.zindy)
return zs
order = [1,0,9,3,7,5,4,6,8,2]
@chozabu
chozabu / buildozer.spec
Created December 24, 2014 15:11
Profiles?
# Profiles
#
# You can extend section / key with a profile
# For example, you want to deploy a demo version of your application without
# HD content. You could first change the title to add "(free)" in the name
# and extend the excluded directories to remove the HD content.
#
[app@free]
title = Boardz free
#package.name = freeboardz
[INFO ] [Base ] Leaving application in progress...
Traceback (most recent call last):
File "/home/chozabu/git/KivEnt/kivent_tutorials/8_airhockey_table/main.py", line 521, in <module>
cProfile.run('YourAppNameApp().run()', pfile)
File "/usr/lib/python2.7/cProfile.py", line 29, in run
prof = prof.run(statement)
File "/usr/lib/python2.7/cProfile.py", line 135, in run
return self.runctx(cmd, dict, dict)
File "/usr/lib/python2.7/cProfile.py", line 140, in runctx
exec cmd in globals, locals
@chozabu
chozabu / main.py
Created October 7, 2014 04:58
testing kivysdl2 joystickaccess
win = Window
win.bind(on_keyboard=self.my_key_handler)
win.bind(on_joy_axis=self.my_axis_handler)
def my_axis_handler(self, window, stickid, axisid, value):
print "axisevent", stickid, axisid, value
return False
@chozabu
chozabu / passenger_wsgi.py
Created September 29, 2014 11:27
crash saver server code
class uploadCrash:
def POST(self):
i = web.input()
print "POST uploading crash"
now = str(datetime.datetime.now())
namepath = "crashs/" + now+"--" + str(i.version)
output = open(namepath, 'wb')
output.write(i.crashData)
@chozabu
chozabu / main.py
Created September 29, 2014 11:17
Uploading unexpected crash in kivy
def uploadCrash(crashstr):
print "uploading crash to ", ui_elements.serverURL
#req = UrlRequest('/listLevels', on_success=self.got_levels, timeout=1000)
import urllib
from kivy.network.urlrequest import UrlRequest
params = urllib.urlencode({
'version':__version__,
"crashData":crashstr
})
headers = {'Content-type': 'application/x-www-form-urlencoded',
@chozabu
chozabu / soundz.py
Created September 27, 2014 16:50
kivy sounds in boardz
__author__ = 'chozabu'
#import cymunk as cy
from kivy.core.audio import SoundLoader, Sound
skidlow = SoundLoader.load('sounds/skidlow.wav')
skidlow.volume = 0.1
skidlow.loop = True
skidmid = SoundLoader.load('sounds/skidmid.wav')
@chozabu
chozabu / soundz.py
Created September 3, 2014 20:52
crash testing kivy audio
'''
Audio example
=============
altered to loop. set several sounds playing and wibble volume to induce crash
All the sounds are from the http://woolyss.com/chipmusic-samples.php
"THE FREESOUND PROJECT", Under Creative Commons Sampling Plus 1.0 License.