Skip to content

Instantly share code, notes, and snippets.

View dolang's full-sized avatar

dolang

View GitHub Profile
@dolang
dolang / carousel_shader.py
Last active March 20, 2018 16:14
Simple carousel example with Kivy using ScreenManager, doing automatic transitions.
@dolang
dolang / README.md
Last active March 21, 2018 14:22 — forked from tito/README.md
Find GL leaks from a apitrace dump

Find leaks from a apitrace dump trace

  1. Trace your program: apitrace trace python main.py
  2. Dump the trace: apitrace dump python.2.7.trace > log
  3. Check for leaks: python findleak.py log
@dolang
dolang / issue2120.py
Created March 22, 2018 07:41
Test app for Kivy issue #2120
"""
https://github.com/kivy/kivy/issues/2120
Issue was created 2014-04-28. Confirming this has not been fixed yet.
"""
from kivy.logger import Logger
from kivy.app import App
from kivy.lang import Builder
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.button import Button
@dolang
dolang / sdl2-dependency-matrix.org
Created April 3, 2018 20:49
SDL2 Build: Package Dependency Matrix (Families: Red Hat, Ubuntu)

SDL2 Dependency Matrix (as of 2018-04-03)

Red Hat Family

Package NameFRHF27F26EL7WkF
alsa-lib-develxxxxx
audiofile-develxxxx
dbus-develx
libX11-develxxxxx
@dolang
dolang / kivy_thread_worker.py
Last active April 25, 2018 19:20
Kivy ThreadWorker Example
"""
Kivy ThreadWorker example app.
"""
import kivy
kivy.require('1.10.0')
import threading
import time
@dolang
dolang / kivy-kv-encoding.md
Last active June 30, 2018 13:22
[Draft] New Default Encoding for .kv Files: Pros / Cons

New Default Encoding for .kv Files: Pros / Cons

Note: This would be in addition to a directive like in Python files: coding: ...

UTF-8 Everywhere

  • (+) Simple, straight-forward
  • (-) Builder.load_file(...) and Builder.load_string(open(...)) would have differing behaviours (Windows, Linux without UTF-8 locale) because default open(...) uses preferred system encoding
  • (?) can't say what the impact on mobile devices is (Android/iOS)
@dolang
dolang / kivy-dev.yml
Last active May 20, 2018 06:44
Ubuntu Kivy dev Ansible playbook (draft)
---
# Kivy development installation into a virtualenv from the GitHub master
# repository. Meant to be run locally for the currently logged in user.
# Ubuntu, Python 3, Cython 0.28.2, HEAD of master branch.
#
# ~/
# ├── kivy (kivy_local_repo)
# │ └── ...
# ├── venv (venv)
# : └── ...
@dolang
dolang / known-problems.md
Last active July 2, 2018 18:40
Known Problems

Known Problems

  • Travis CI: Some problem with the Inspector can cause the tests # 121 test_widget_multipopup and # 122 test_widget_popup to hang on Travis CI and in VirtualBox VMs. Manual minimise/maximise/restore/resize fixes it. Current workaround in 55200ee.

  • Appveyor: MinGW tests fail due to lack of proper OpenGL support. Potential fix: see how

@dolang
dolang / example.py
Created May 14, 2018 23:13
Logger example which puts messages for each level in their respective files
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import logging.config
class F(logging.Filter):
def __init__(self, level):
super(F, self).__init__(logging.getLevelName(level))
@dolang
dolang / actionbar_input_example.py
Created May 15, 2018 14:17
Kivy ActionBar with TextInput example.
"""
Kivy App.
"""
import kivy
kivy.require('1.10.0')
from kivy.app import App
from kivy.lang import Builder
from kivy.uix.actionbar import ActionItem