getheader now compiles python files

This commit is contained in:
Lieuwe
2011-03-03 20:33:48 +01:00
parent 9f8811159c
commit eab871c774
7 changed files with 177 additions and 32 deletions

View File

@@ -1,6 +1,7 @@
import tpt
import random
import time
import utils
# example script
def noise(typ,amount=50):

View File

@@ -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):