Skip to content

Instantly share code, notes, and snippets.

/.env

Created November 10, 2012 12:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/4050969 to your computer and use it in GitHub Desktop.
Save anonymous/4050969 to your computer and use it in GitHub Desktop.
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