Skip to content

Instantly share code, notes, and snippets.

View dolang's full-sized avatar

dolang

View GitHub Profile
@dolang
dolang / coding_test.pyx
Last active July 6, 2018 12:19
Cython oddity
# -*- coding: utf-8 -*-
from __future__ import print_function, unicode_literals
from libc.stdint cimport uint8_t # note: it's *cimport* not *import*
from random import randint
cpdef char* random_chars(int length=100):
cdef:
char[100] r_chars
uint8_t a_char
@dolang
dolang / kivy-dev-manjaro.yml
Created June 24, 2018 01:37
Manjaro 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.
# Manjaro, Python 3, Cython 0.28.3, HEAD of master branch.
#
# ~/
# ├── kivy (kivy_local_repo)
# │ └── ...
# ├── venv (venv)
# : └── ...
@dolang
dolang / kivy_asyncio_example.py
Created May 28, 2018 15:46
Kivy with an asyncio EventLoop example
"""
Kivy asyncio example app.
Kivy needs to run on the main thread and its graphical instructions have to be
called from there. But it's still possible to run an asyncio EventLoop, it
just has to happen on its own, separate thread.
Requires Python 3.5+.
"""
@dolang
dolang / kivy-dev-opensuse.yml
Created May 20, 2018 08:02
openSUSE 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.
# openSUSE, Python 3, Cython 0.28.2, HEAD of master branch.
#
# ~/
# ├── kivy (kivy_local_repo)
# │ └── ...
# ├── venv (venv)
# : └── ...
@dolang
dolang / kivy-dev-fedora.yml
Created May 19, 2018 01:40
Fedora Kivy dev Ansible playbook (draft)
---
# Kivy development installation into a virtualenv from the master branch
# of the GitHub repository. Meant to be run locally for the currently
# logged in user.
# Fedora, Python 3, Cython 0.28.2, HEAD of master branch.
#
# ~/
# ├── kivy (kivy_local_repo)
# │ └── ...
# ├── venv (venv)
@dolang
dolang / kivy-ppa-daily-test.yml
Last active May 18, 2018 17:45
Install Kivy from the daily PPA; download & run the tests. Ansible playbook.
---
# Ansible Playbook for Ubuntu which installs the Kivy daily PPA
# packages, then fetches and runs the tests.
#
# The PPA is: `ppa:kivy-team/kivy-daily`. The script creates a shallow
# Kivy clone into ~/kivy, so make sure that directory is either already
# a Kivy repository or nonexistant/empty.
#
# Test output is saved separately for py2/py3 as `~/py2-kivy-tests.log`
# and `~/py3-kivy-tests.log`. They contain raw characters, so open
@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
@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 / 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 / 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)
# : └── ...