diff options
| author | Lieuwe <lieuwemo@gmail.com> | 2011-03-03 19:33:48 (GMT) |
|---|---|---|
| committer | Lieuwe <lieuwemo@gmail.com> | 2011-03-03 19:33:48 (GMT) |
| commit | eab871c77487714cab68b9e4753a2bcf7ece79f4 (patch) | |
| tree | da70ee33dff5e931415614528a0b224b386670e2 /build | |
| parent | 9f8811159cc80eed0cf30408fdca139a6604fffe (diff) | |
| download | powder-eab871c77487714cab68b9e4753a2bcf7ece79f4.zip powder-eab871c77487714cab68b9e4753a2bcf7ece79f4.tar.gz | |
getheader now compiles python files
Diffstat (limited to 'build')
| -rw-r--r-- | build/example.py | 1 | ||||
| -rw-r--r-- | build/tpt_console.py | 34 |
2 files changed, 4 insertions, 31 deletions
diff --git a/build/example.py b/build/example.py index 6b0b7c1..ade32b7 100644 --- a/build/example.py +++ b/build/example.py @@ -1,6 +1,7 @@ import tpt import random import time +import utils # example script def noise(typ,amount=50): diff --git a/build/tpt_console.py b/build/tpt_console.py index ab427e3..864fed8 100644 --- a/build/tpt_console.py +++ b/build/tpt_console.py @@ -1,11 +1,11 @@ import tpt from tpt import * +from utils import * import sys import code import ctypes import traceback -from threading import Thread -print "console module loaded." +#print "console module loaded." #redirect stdout like this: class logger: def write(self,txt): @@ -39,35 +39,7 @@ element={"none":0,"dust":1,"watr":2,"oil":3,"fire":4,"stne":5,"lava":6,"gunp":7, "lote":142,"frg2":143,"star":144,"frog":145,"bran":146,"wind":147, "num":148} -class _fork(Thread): - def __init__ (self,func): - Thread.__init__(self) - self.func=func - def run(self): - self.func(self) -def fork(func): - try: - a=fork.threads - except: - fork.threads={} - fork.i=0 - tmp=_fork(func) - fork.threads[fork.i]=tmp - fork.i+=1 - tmp.start() - return tmp - tpt.log("Thread #%d started"%(fork.i-1)) -def fork_status(): - count=0 - remove=[] - for key in fork.threads: - if(fork.threads[key].is_alive()): - count+=1 - else: - remove.append[key] - for item in remove: - del fork.threads[item] - tpt.log("%d threads alive. %d threads stopped since last status."%(count,len(remove))) + def fork_unblock(): pass#i need to implement this some day. def error(ex): |
