# HG changeset patch # User Christophe Lincoln # Date 1398273730 -7200 # Node ID 96b7a0fabed374938374d98fd48a3c6fc155519a # Parent 351577bd7833b9261764540d2eb120a85eb75a10 Addpython-rpi-pyglow with custom pyglow tool to easily test Pyglow (tested by myself) diff -r 351577bd7833 -r 96b7a0fabed3 python-rpi-pyglow/receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/python-rpi-pyglow/receipt Wed Apr 23 19:22:10 2014 +0200 @@ -0,0 +1,25 @@ +# SliTaz package receipt. + +PACKAGE="python-rpi-pyglow" +VERSION="git-1" +CATEGORY="system-tools" +SHORT_DESC="Controlling the PiGlow from Python." +MAINTAINER="pankso@slitaz.org" +LICENSE="BSD" +TARBALL="$PACKAGE-$VERSION.tar.bz2" +WEB_SITE="https://github.com/benleb/PyGlow" +WGET_URL="git|git://github.com/benleb/PyGlow.git" +TAGS="raspberrypi rpi" +HOST_ARCH="arm" + +DEPENDS="python python-smbus python-rpi-gpio" + +# Rules to gen a SliTaz package suitable for Tazpkg. +genpkg_rules() +{ + pylibs="/usr/lib/python2.7" + mkdir -p $fs/${pylibs} $fs/usr/share $fs/usr/bin + cp -a ${src}/pyglow.py $fs/${pylibs} + cp -a ${src}/examples $fs/usr/share/pyglow + cp ${stuff}/pyglow $fs/usr/bin +} diff -r 351577bd7833 -r 96b7a0fabed3 python-rpi-pyglow/stuff/pyglow --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/python-rpi-pyglow/stuff/pyglow Wed Apr 23 19:22:10 2014 +0200 @@ -0,0 +1,26 @@ +#!/bin/sh +# +# Tiny wrapper to Python Pyglow examples +# + +ex="/usr/share/pyglow" + +# Make sure we have i2c-dev module loaded +if ! lsmod | fgrep -q 'iec_dev'; then + modprobe i2c-dev +fi + +case "$1" in + cpu) + python ${ex}/cpu.py ;; + clock) + python ${ex}/clock.py ;; + set-leds) + python ${ex}/set_leds.py ;; + 'test') + python ${ex}/test.py ;; + *) + echo "Usage: $(basename $0) [test|cpu|clock|set-leds]" ;; +esac + +exit 0