-
-
Save anonymous/4050969 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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