Skip to content

Instantly share code, notes, and snippets.

/.env

Created Nov 10, 2012
Embed
What would you like to do?
export KIVYANDROID=~/python-for-android/dist/goulbi
export PACKAGE=org.kivy.popmtprocess
set -x
function deploy(){
pushd $KIVYANDROID
apk=$(ls bin/*.apk -t | grep -v unaligned| tail -n 1)
tar -c $apk|ssh root@$1 'cd /sdcard/ && tar -x'
popd
ssh root@$1 "source /sdcard/adb_env &&\
pm uninstall $PACKAGE &&\
pm install /sdcard/$apk"
}
function build(){
pushd ${KIVYANDROID}
rm bin/*.apk -fr
./build.py\
--dir ~/pop_mtprocess\
--package $PACKAGE\
--name "Pop"\
--orientation portrait\
--version 1.0\
debug
popd
deploy $1
run $1
}
function run(){
ssh $1 "source /sdcard/adb_env &&\
am start -n $PACKAGE/org.renpy.android.PythonActivity -a org.renpy.android.PythonActivity &&\
logcat" | logcat
}
# encoding:utf-8
import time
from random import randint, choice
from string import ascii_letters
print "before import"
from multiprocessing import Process, Queue
print "connect now so you can create breakpoints on sem_new !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
time.sleep(15)
print "tooo late! start again"
def pooler(queue):
while True:
time.sleep(.1)
queue.put(choice(ascii_letters))
def check_queue():
message = ""
while not queue.empty():
message += queue.get()
if message:
print 'got', message
queue = Queue()
worker = Process(target=pooler, args=(queue, ))
worker.daemon = True
worker.start()
while True:
time.sleep(randint(1, 5))
check_queue()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment