Skip to content

Instantly share code, notes, and snippets.

View tito's full-sized avatar

Mathieu Virbel tito

View GitHub Profile
>> FAIL WITH 8930161ac7793fdb7b9f29d0403b89d0ed9cddf9
<FabreDescriptionPart>:
font_size: 18
font_name: "data/fonts/Optima Medium.ttf"
size_hint_y: None
text_size: self.width, None
height: self.texture_size[1]
halign: "left"
markup: True
@tito
tito / mjpegviewer.py
Last active March 11, 2025 16:14
MJpeg Viewer in Kivy
"""
MJpeg Viewer using pure Kivy + urllib
=====================================
.. author:: Mathieu Virbel <[email protected]>
"""
import io
import urllib
import threading
@tito
tito / mainsmoothed.py
Last active August 29, 2015 14:22
Demo of a Smoothed-Scatter. Put the file into the demo/pictures directory, and try.
#!/usr/bin/kivy
import kivy
kivy.require('1.0.6')
from glob import glob
from random import randint
from os.path import join, dirname
from kivy.app import App
from kivy.logger import Logger
@tito
tito / test.py
Created April 26, 2015 17:03
Kivy crash
from kivy.uix.button import Button
from kivy.uix.label import Label
from kivy.uix.floatlayout import FloatLayout
from kivy.lang import Builder, global_idmap
from kivy.event import EventDispatcher
from kivy.properties import StringProperty
from kivy.app import App
Builder.load_string("""
@tito
tito / buildozer.spec
Last active August 29, 2015 14:17
Recycle View (reboot of ListView, kv ready, better performance, and easier to use.)
[app]
# (str) Title of your application
title = _recycleview
# (str) Package name
package.name = recycleview
# (str) Package domain (needed for android/ios packaging)
package.domain = org.kivy
@tito
tito / cover.py
Created March 20, 2015 17:40
Cover image in kivy
from kivy.lang import Builder
from kivy.uix.image import Image
from kivy.uix.properties import AliasProperty
Builder.load_string("""
<-CoverImage>:
canvas.before:
Color:
rgba: self.color
Rectangle:
@tito
tito / avplayer.py
Created March 14, 2015 11:40
Pyobjus media player
from pyobjus import autoclass
from pyobjus.dylib_manager import load_framework, INCLUDE
import sys
load_framework(INCLUDE.AVFoundation)
AVAudioPlayer = autoclass("AVAudioPlayer")
NSURL = autoclass("NSURL")
NSString = autoclass("NSString")
fn = NSString.alloc().initWithUTF8String_(sys.argv[1])
@tito
tito / speedtest.py
Created March 4, 2015 17:11
Performance test of remove_widget()
import time
def timeit(method):
def timed(*args, **kw):
ts = time.time()
result = method(*args, **kw)
te = time.time()
print '%r (%r, %r) %2.2f sec' % \
@tito
tito / utmotionevent.py
Last active August 29, 2015 14:16
Example of mock-MotionEvent for unittest
# subclass for touch event in unit test
class UTMotionEvent(MotionEvent):
def depack(self, args):
self.is_touch = True
self.sx = args['x']
self.sy = args['y']
self.profile = ['pos']
super(UTMotionEvent, self).depack(args)
@tito
tito / release.py
Created January 27, 2015 16:22
Release script (buildozer, plyer)
#!/usr/bin/env python
from os.path import join, basename, realpath
import sh
# ensure we start from a clean git
git_status = sh.git.status("--porcelain")
if list(git_status):
print "UNCOMMITED CHANGES ----"
print git_status