From e46ef289e142982d7bd592faa7b0f85470364c01 Mon Sep 17 00:00:00 2001 From: Simon Robertshaw Date: Wed, 26 Oct 2011 14:50:50 +0100 Subject: Remove Python console stuff diff --git a/addzip.py b/addzip.py deleted file mode 100644 index b80d346..0000000 --- a/addzip.py +++ /dev/null @@ -1,49 +0,0 @@ -import zipfile -import os -import os.path -import sys - -if(len(sys.argv)>1 and sys.argv[1]=="--clean"): - print "cleaning" - for dirpath,dirnames,filenames in os.walk("./src/python/stdlib"): - for fname in filenames: - if(fname.endswith(".pyc") or fname.endswith(".pyo")): - os.remove(os.path.join(dirpath,fname)) - raise SystemExit - -print "zipping stdlib" -fid=zipfile.ZipFile("./build/tptPython.zip","w",zipfile.ZIP_DEFLATED) - -#ZipFile.write(filename) -files=os.walk("./src/python/stdlib") -num=0 -pn=0 -for dirpath,dirnames,filenames in files: - for fname in filenames: - if(fname.endswith(".py")): - continue - fid.write(os.path.join(dirpath,fname)) - num+=1 - if(num-5>=pn): - pn=num - print "%d done."%num - -print "writing zipfile" -fid.close() - -raise SystemExit - -"""not needed.""" -print "generating pystdlib.h" -with open("stdlib.zip","r") as fid: - with open("./includes/pystdlib.h","w") as outfid: - outfid.write("unsigned char tpt_console_stdlib[] = {") - tmp=0 - for char in fid.read(): - outfid.write(hex(ord(char))) - outfid.write(",") - tmp+=1 - outfid.write("};\n") - outfid.write("size_t tpt_console_stdlibsize=%d;"%tmp) -print "done" - diff --git a/build/example.py b/build/example.py deleted file mode 100644 index 850d8ae..0000000 --- a/build/example.py +++ /dev/null @@ -1,21 +0,0 @@ -import utils -# example script - -def noise(typ,amount=50): - for xx in range(4,612): - for yy in range(4,384): - if(random.randrange(0,100)>8 - t = tpt.get_prop(i,"type")+amount - if t>=148: - t=t-148 - if t==128: - t=129 - if t==55: - t=56 - tpt.set_type(i=i,settoint=t) \ No newline at end of file diff --git a/build/ext_chat.py b/build/ext_chat.py deleted file mode 100644 index 56a58e5..0000000 --- a/build/ext_chat.py +++ /dev/null @@ -1,211 +0,0 @@ -import tpt -import sys -import time -import socket -import tpt_console - -HOST="irc.freenode.net" -PORT=6667 -name=tpt.get_name() -print "name is %s"%repr(name) -if(name==""): - #fuck. abort? - raise SystemExit("please log in!") - -def raw(s,st): - s.send("%s\n\r"%st) - -def init(): - global frame,s,rec,readbuffer,namelist,typing,typed,IDENT,NICK - global REALNAME,CHANNEL - frame=0 - s=None - rec=([("",0,0,0,255)]*20)+[("connected.",255,0,0,128)] - readbuffer="" - namelist=[] - typing=False - typed="" - NICK=name+"[tpt]" - IDENT=name+"[tpt]" - REALNAME=name - CHANNEL="#powder" - readbuffer="" - -def exit(): - raw(s,"QUIT") - s.close() - -def console_handle(txt): - """ - :doxin!~lieuwe@unaffiliated/lieuwe JOIN :#foobar7 - :doxin!~lieuwe@unaffiliated/lieuwe PRIVMSG #foobar7 :there - :doxin!~lieuwe@unaffiliated/lieuwe PRIVMSG #foobar7 :ACTION is fat - """ - lst=txt.split(" ") - if(lst[0]=="/me"): - rec.append(("%s %s"%(NICK,txt[4:]),255,0,255,128)) - raw(s,"PRIVMSG %s :\x01ACTION %s\x01"%(CHANNEL,txt[4:])) - tpt.console_close() - else: - rec.append(("<%s>: %s"%(NICK,txt),255,255,0,128)) - raw(s,"PRIVMSG %s :%s"%(CHANNEL,txt)) - tpt.console_close() - -def key(keyy) : - try: - a=key.pmod - except: - key.pmod=(False,False,False) - global typing,typed - #print "got %s"%repr(keyy) - ctrl1,ctrl2,alt1,alt2,shift1,shift2=tpt.get_modifier() - mod=(ctrl1 or ctrl2,alt1 or alt2,shift1 or shift2) - skip=False - if(not key.pmod[0] and mod[0]): - skip=True - if(not key.pmod[1] and mod[1]): - skip=True - if(not key.pmod[2] and mod[2]): - skip=True - key.pmod=mod - if(skip): - return - - if(typing and ord(keyy)>=32 and ord(keyy)<=126): - if(mod[2]): - typed+=keyy.upper()#needs to be fixed for special chars - else: - typed+=keyy - if(keyy=="\x1b" and typing): - typing=False - typed="" - tpt.shortcuts_enable() - if(keyy=="t" and typing==False): - typing=True - tpt.shortcuts_disable() - if(keyy=="\r" and typing==True): - console_handle(typed) - typed="" - typing=False - tpt.shortcuts_enable() - #got '\t' - #got '\x08' - if(keyy=="\x08"): - typed=typed[:-1] - #if(keyy=="\t"): - # startswith= - - -def step(): - global frame,s,rec,readbuffer,namelist - frame+=1 - if(frame==1): - tpt.console_close() - #lets see if we can seize the console: - tpt_console._handle=console_handle - if(frame==2): - tpt.draw_fillrect(0,0,612,384,0,0,0,128) - tpt.draw_text(32,32,"opening connection\nhold on to your pants.",255,255,255) - if(frame==3): - s=socket.socket() - s.settimeout(5) - s.connect((HOST, PORT)) - raw(s,"NICK %s" % NICK) - raw(s,"USER %s %s bla :%s" % (IDENT, HOST, REALNAME)) - s.settimeout(0) - if(frame==120): - raw(s,"JOIN %s"%CHANNEL) - rec.append(("joined",255,0,0,255)) - if(frame>=3): - try: - readbuffer=readbuffer+s.recv(1024) - except IOError: - pass - else: - temp=readbuffer.split("\n") - readbuffer=temp.pop() - - for line in temp: - line=line.strip() - #print repr(line) - line=line.split() - if(line[1]=="PRIVMSG"): - #:doxin!~lieuwe@unaffiliated/lieuwe PRIVMSG doxin[tpt] :some shit - frm=line[0][1:].partition("!")[0] - msg=' '.join(line[3:])[1:] - tmp=["<",frm,"> ",msg] - if(msg[0]=="\x01" and msg[-1]=="\x01"): - msg=msg[8:-1]#ACTION - tmp=[frm," ",msg] - if(line[2]==NICK): - rec.append((''.join(tmp),255,255,255,255)) - else: - rec.append((''.join(tmp),255,255,255,128)) - elif(line[0]=="PING"): - raw(s,"PONG %s"%line[1]) - elif(line[1]=="353"): - #:leguin.freenode.net 353 doxin[tpt] = #powder :doxin[tpt] ZebraineZ _-_Rafael_-_ doxin bildramer BlueMaxima TheRazorsEDGE raj-k webb|AP where @devast8a Merbo FrozenKnight EppyMoon EvilJStoker Mortvert SpitfireWP @frankbro Ares - names=line[4:] - namelist=[] - for item in names: - item=item.strip() - r=255 - g=255 - b=255 - if(item[0]==":"): - item=item[1:] - elif(item[0]=="@"): - g=0 - b=0 - namelist.append((item,r,g,b,128)) - elif(line[1]=="JOIN"): - #':savask!~savask@95-190-25-195-xdsl-dynamic.kuzbass.net JOIN :#powder' - tmp=line[0][1:].partition("!")[0] - namelist.append((tmp,255,255,255,128)) - rec.append(("%s joined"%name,0,255,0,128)) - elif(line[1]=="PART"): - #':savask!~savask@95-190-25-195-xdsl-dynamic.kuzbass.net PART #powder :"Leaving."' - tmp=line[0][1:].partition("!")[0] - msg=' '.join(line[2:])[1:] - rem=None - for item in namelist: - if(item[0]==tmp or item[0]=="@"+tmp): - rem=item - rec.append(("%s parted: %s"%(name,msg),0,255,0,128)) - if(rem!=None): - namelist.remove(rem) - elif(line[1]=="NICK"): - #:doxin!~lieuwe@unaffiliated/lieuwe NICK :d0x1n - tmp=line[0][1:].partition("!")[0] - rem=None - for item in namelist: - if(item[0]==tmp or item[0]=="@"+tmp): - rem=item - rec.append(("%s is now known as %s"%(name,line[2]),0,255,0,128)) - if(rem!=None): - if(rem[0][0]=="@"): - namelist.append(("@"+line[2][1:],rem[1],rem[2],rem[3],rem[4])) - else: - namelist.append((line[2][1:],rem[1],rem[2],rem[3],rem[4])) - namelist.remove(rem) - - - - - yy=32 - if(len(rec)>20): - rec=rec[-20:] - for item in rec: - tpt.draw_text(8,yy,item[0],item[1],item[2],item[3],item[4]) - yy+=8 - if(typing): - if(frame%30<15): - tpt.draw_text(8,yy,typed+"|",255,255,255,255) - else: - tpt.draw_text(8,yy,typed,255,255,255,255) - #print namelist - yy=32 - for item in namelist: - tpt.draw_text(604-tpt.get_width(item[0]),yy,item[0],item[1],item[2],item[3],item[4]) - yy+=8 - diff --git a/build/ext_fun.py b/build/ext_fun.py deleted file mode 100644 index 35c93a1..0000000 --- a/build/ext_fun.py +++ /dev/null @@ -1,9 +0,0 @@ -import tpt -def init(): - pass -def key(keyy): - pass -def step(): - tpt.draw_text(100,100,"FUCK YEAH!",255,255,255,255) -def exit(): - pass diff --git a/build/tpt_console.py b/build/tpt_console.py deleted file mode 100644 index b26ecef..0000000 --- a/build/tpt_console.py +++ /dev/null @@ -1,116 +0,0 @@ -import tpt -from tpt import * -import sys -import code -import ctypes -import traceback -DEBUG=False - -#print "console module loaded." -#redirect stdout like this: -class logger: - def write(self,txt): - txt=txt.strip().split("\n")[-1] - repr(txt) - tpt.log(txt) -if(DEBUG==False): - sys.stdout=logger() - sys.stderr=logger() - - -element={"none":0,"dust":1,"watr":2,"oil":3,"fire":4,"stne":5,"lava":6,"gunp":7, - "nitr":8,"clne":9,"gas":10,"plex":11,"goo":12,"icei":13,"metl":14,"sprk":15, - "snow":16,"wood":17,"neut":18,"plut":19,"plnt":20,"acid":21,"void":22, - "wtrv":23,"cnct":24,"dstw":25,"salt":26,"sltw":27,"dmnd":28,"bmtl":29, - "brmt":30,"phot":31,"uran":32,"wax":33,"mwax":34,"pscn":35,"nscn":36, - "lntg":37,"insl":38,"bhol":39,"whol":40,"rbdm":41,"lrbd":42,"ntct":43, - "sand":44,"glas":45,"ptct":46,"bgla":47,"thdr":48,"plsm":49,"etrd":50, - "nice":51,"nble":52,"btry":53,"lcry":54,"stkm":55,"swch":56,"smke":57, - "desl":58,"coal":59,"lo2":60,"o2":61,"inwr":62,"yest":63,"dyst":64, - "thrm":65,"glow":66,"brck":67,"hflm":68,"firw":69,"fuse":70,"fsep":71, - "amtr":72,"bcol":73,"pcln":74,"hswc":75,"iron":76,"mort":77,"gol":78, - "hlif":79,"asim":80,"2x2":81,"dani":82,"amoe":83,"move":84,"pgol":85, - "dmoe":86,"34":87,"llif":88,"stan":89,"spng":90,"rime":91,"fog":92, - "bcln":93,"love":94,"deut":95,"warp":96,"pump":97,"fwrk":98,"pipe":99, - "frzz":100,"frzw":101,"grav":102,"bizr":103,"bizrg":104,"bizrs":105, - "inst":106,"isoz":107,"iszs":108,"prti":109,"prto":110,"pste":111, - "psts":112,"anar":113,"vine":114,"invis":115,"equalvel":116,"spawn2":117, - "spawn":118,"shld1":119,"shld2":120,"shld3":121,"shld4":122,"lolz":123, - "wifi":124,"filt":125,"aray":126,"bray":127,"stkm2":128,"bomb":129, - "c5":130,"sing":131,"qrtz":132,"pqrt":133,"seed":134,"maze":135, - "coag":136,"wall":137,"gnar":138,"repl":139,"myst":140,"boyl":141, - "lote":142,"frg2":143,"star":144,"frog":145,"bran":146,"wind":147, - "num":148} - - -def fork_unblock(): - pass#i need to implement this some day. -def error(ex): - traceback.print_exc() - err=traceback.format_exc() - sys.stdout.write(err) - -def clean(): - #add any functions that must be reachable here. - """copy=["__builtins__","__name__","__doc__","__package__",'tpt','clean', - 'element','fork','_fork','fork_status','fork_unblock','sys'] - handle.glob={} - for item in copy: - handle.glob[item]=globals()[item]""" - handle.glob=globals() - handle.buf="" - -def handle(txt): - try: - a=handle.glob - except: - clean() - try: - _handle(txt) - except Exception as ex: - error(ex) - -def _handle(txt): - #print "handling '%s'"%txt - try: - sys.stdout.write(repr(eval(txt,handle.glob))) - except: - try: - exec txt in handle.glob - except Exception as ex: - error(ex) - - -_extensions=[] -def loadext(fname): - ext=__import__(fname) - ext.init() - _extensions.append(ext) - -def keypress(key): - unload=[] - for item in _extensions: - try: - item.key(key) - except Exception as ex: - error(ex) - unload.append(item) - for item in unload: - item.exit() - _extensions.remove(item) - - -def step(): - unload=[] - for item in _extensions: - try: - item.step() - except Exception as ex: - error(ex) - unload.append(item) - for item in unload: - try: - item.exit() - except Exception as ex: - error(ex) - _extensions.remove(item) diff --git a/console_README b/console_README deleted file mode 100644 index b94053e..0000000 --- a/console_README +++ /dev/null @@ -1,45 +0,0 @@ -### CONSOLE ### -the console in this version is a python console and will execute any command you enter. -the api for interacting with the powder toy is contained in the tpt module and is already imported at startup. -currently implemented api functions: - create(x,y,type) create a particle of type at , - reset_velocity() resets all velocity - reset_pressure() resets all pressure - reset_sparks() resets all sparks - -### USING SET COMMANDS ### -the console uses keywords to identify variables of what to set, you can specify x and y coords with x=100 y=100, ect. -i is the particle number -name will change all of name's type to the setto variable. It needs to be a string "dust" ect, "all" for all. -the setto is what the particle(s) will be set to, it is a string for the type/ctype commands, and an int for the rest. -you need to set the to* variable and one location/name/coords for it to work. - set_type(x=,y=,i=,name="",setto="") - set_life() - set_temp() - set_tmp() - set_x() - set_y() - set_vx() - set_vy() - set_ctype() - - pause() pause the game(note that closing the console - pauses the game) - unpause() unpause the game(note that closing the console - pauses the game) - toggle_pause() toggle pause(note that closing the console - pauses the game) - close_console() closes the console and pauses the game - open_console() opens the console - toggle_console() toggles the console - -NOTE: these functions don't do bounds checking, which means that they CAN AND - WILL CRASH the powder toy. be carefull. - -### TIPS&TRICKS ### -all functions that need a particle type expect a number. but instead of doing -tpt.set_life(32,life) you can do tpt.set_life(element['uran'],life) - -### COMPILING ### -before you compile you should have python 2.x installed. -you must run the "getheader.py" script to get the correct linking options, add these options to the makefile diff --git a/getheader.py b/getheader.py deleted file mode 100644 index 05fbe1b..0000000 --- a/getheader.py +++ /dev/null @@ -1,80 +0,0 @@ -import sys -import os.path -import compileall -class dummyfile(): - def write(self,txt): - pass -def log(*args): - try: - log.a - except: - log.a=sys.stdout - log.a.write(" ".join(args)+"\n") -log() -sys.stdout=dummyfile() - -path=os.path.join(sys.exec_prefix,"include","python%s"%sys.version[:3]) -#print "headers at ",repr(path) -#-lpython2.3 -lm -L/usr/lib/python2.3/config -args="-lpython%s -lm -L%s"%(sys.version[:3],os.path.join(sys.exec_prefix,"lib","python%s"%sys.version[:3],"config")) -log(args,"-I%s"%path) - -path=os.path.join(sys.exec_prefix,"include") -args="-lpython%s -lm -L%s"%(sys.version[:3],os.path.join(sys.exec_prefix,"lib","config"))#,"python%s"%sys.version[:3] -log(args,"-I%s"%path) - -ext=False -"""#see if we're on 64bit. -with open("./includes/defines.h") as fid: - for line in fid: - if(line.startswith("#define") and line.count("PYEXT")>0): - print "using external console.py" - ext=True""" -#print sys.argv -if(len(sys.argv)>=2 and sys.argv[1]=="--ext"): - ext=True -#raw_input("") - -if(ext): - log("external") - #raw_input(sys.argv) - with open("./src/python/tpt_console.py") as fid: - consolepy=fid.read() - script=""" -import tempfile,os.path,sys -dir=tempfile.gettempdir() -sys.path.append(dir) -tmp=%s -print "making console.py @ %%s"%%os.path.join(dir,"tpt_console.py") -with open(os.path.join(dir,"tpt_console.py"),"w") as fid: - fid.write(tmp) - """%repr(consolepy) - tmp=[hex(ord(char)) for char in script] - out=["unsigned char tpt_console_py[] = {",','.join(tmp),"};"] - with open("./includes/pyconsole.h","w") as fid: - fid.write(''.join(out)) -else: - log("internal") - #raw_input(sys.argv) - #unsigned char tpt_console_pyc[] = { 0x1B, 0x57}; - lst=[] - compileall.compile_dir("./src/python", force=0) - - print "generating pyconsole.h" - - fname="./src/python/tpt_console.pyc" - try: - fid=open(fname,"r") - except IOError: - fname="./src/python/tpt_console.pyo" - finally: - fid.close() - - with open(fname,"r") as fid: - for char in fid.read(): - lst.append(hex(ord(char))) - tmp=",".join(lst) - out=''.join(["#include \nunsigned char tpt_console_pyc[] = {",tmp,"};"]) - with open("./includes/pyconsole.h","w") as fid: - fid.write(out) -print "done" diff --git a/includes/pythonconsole.h b/includes/pythonconsole.h deleted file mode 100644 index e1e9a97..0000000 --- a/includes/pythonconsole.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef PYCONSOLEH -#define PYCONSOLEH -#include -#include - -extern char pyready, pygood; -extern PyMethodDef EmbMethods[]; -unsigned char tpt_console_pyc[] = {0x3,0xf3,0xd,0xa,0xc8,0x11,0x8a,0x4d,0x63,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x3,0x0,0x0,0x0,0x40,0x0,0x0,0x0,0x73,0xf1,0x4,0x0,0x0,0x64,0x0,0x0,0x64,0x1,0x0,0x6c,0x0,0x0,0x5a,0x0,0x0,0x64,0x0,0x0,0x64,0x2,0x0,0x6c,0x0,0x0,0x54,0x64,0x0,0x0,0x64,0x1,0x0,0x6c,0x1,0x0,0x5a,0x1,0x0,0x64,0x0,0x0,0x64,0x1,0x0,0x6c,0x2,0x0,0x5a,0x2,0x0,0x64,0x0,0x0,0x64,0x1,0x0,0x6c,0x3,0x0,0x5a,0x3,0x0,0x64,0x0,0x0,0x64,0x1,0x0,0x6c,0x4,0x0,0x5a,0x4,0x0,0x65,0x5,0x0,0x5a,0x6,0x0,0x64,0x3,0x0,0x64,0x37,0x1,0x64,0x4,0x0,0x84,0x0,0x0,0x83,0x0,0x0,0x59,0x5a,0x7,0x0,0x65,0x6,0x0,0x65,0x5,0x0,0x6b,0x2,0x0,0x72,0x86,0x0,0x65,0x7,0x0,0x83,0x0,0x0,0x65,0x1,0x0,0x5f,0x8,0x0,0x65,0x7,0x0,0x83,0x0,0x0,0x65,0x1,0x0,0x5f,0x9,0x0,0x6e,0x0,0x0,0x69,0x95,0x0,0x64,0x5,0x0,0x64,0x6,0x0,0x36,0x64,0x7,0x0,0x64,0x8,0x0,0x36,0x64,0x9,0x0,0x64,0xa,0x0,0x36,0x64,0xb,0x0,0x64,0xc,0x0,0x36,0x64,0xd,0x0,0x64,0xe,0x0,0x36,0x64,0xf,0x0,0x64,0x10,0x0,0x36,0x64,0x11,0x0,0x64,0x12,0x0,0x36,0x64,0x13,0x0,0x64,0x14,0x0,0x36,0x64,0x15,0x0,0x64,0x16,0x0,0x36,0x64,0x17,0x0,0x64,0x18,0x0,0x36,0x64,0x19,0x0,0x64,0x1a,0x0,0x36,0x64,0x1b,0x0,0x64,0x1c,0x0,0x36,0x64,0x1d,0x0,0x64,0x1e,0x0,0x36,0x64,0x1f,0x0,0x64,0x20,0x0,0x36,0x64,0x21,0x0,0x64,0x22,0x0,0x36,0x64,0x23,0x0,0x64,0x24,0x0,0x36,0x64,0x25,0x0,0x64,0x26,0x0,0x36,0x64,0x27,0x0,0x64,0x28,0x0,0x36,0x64,0x29,0x0,0x64,0x2a,0x0,0x36,0x64,0x2b,0x0,0x64,0x2c,0x0,0x36,0x64,0x2d,0x0,0x64,0x2e,0x0,0x36,0x64,0x2f,0x0,0x64,0x30,0x0,0x36,0x64,0x31,0x0,0x64,0x32,0x0,0x36,0x64,0x33,0x0,0x64,0x34,0x0,0x36,0x64,0x35,0x0,0x64,0x36,0x0,0x36,0x64,0x37,0x0,0x64,0x38,0x0,0x36,0x64,0x39,0x0,0x64,0x3a,0x0,0x36,0x64,0x3b,0x0,0x64,0x3c,0x0,0x36,0x64,0x3d,0x0,0x64,0x3e,0x0,0x36,0x64,0x3f,0x0,0x64,0x40,0x0,0x36,0x64,0x41,0x0,0x64,0x42,0x0,0x36,0x64,0x43,0x0,0x64,0x44,0x0,0x36,0x64,0x45,0x0,0x64,0x46,0x0,0x36,0x64,0x47,0x0,0x64,0x48,0x0,0x36,0x64,0x49,0x0,0x64,0x4a,0x0,0x36,0x64,0x4b,0x0,0x64,0x4c,0x0,0x36,0x64,0x4d,0x0,0x64,0x4e,0x0,0x36,0x64,0x4f,0x0,0x64,0x50,0x0,0x36,0x64,0x51,0x0,0x64,0x52,0x0,0x36,0x64,0x53,0x0,0x64,0x54,0x0,0x36,0x64,0x55,0x0,0x64,0x56,0x0,0x36,0x64,0x57,0x0,0x64,0x58,0x0,0x36,0x64,0x59,0x0,0x64,0x5a,0x0,0x36,0x64,0x5b,0x0,0x64,0x5c,0x0,0x36,0x64,0x5d,0x0,0x64,0x5e,0x0,0x36,0x64,0x5f,0x0,0x64,0x60,0x0,0x36,0x64,0x61,0x0,0x64,0x62,0x0,0x36,0x64,0x63,0x0,0x64,0x64,0x0,0x36,0x64,0x65,0x0,0x64,0x66,0x0,0x36,0x64,0x67,0x0,0x64,0x68,0x0,0x36,0x64,0x69,0x0,0x64,0x6a,0x0,0x36,0x64,0x6b,0x0,0x64,0x6c,0x0,0x36,0x64,0x6d,0x0,0x64,0x6e,0x0,0x36,0x64,0x6f,0x0,0x64,0x70,0x0,0x36,0x64,0x71,0x0,0x64,0x72,0x0,0x36,0x64,0x73,0x0,0x64,0x74,0x0,0x36,0x64,0x75,0x0,0x64,0x76,0x0,0x36,0x64,0x77,0x0,0x64,0x78,0x0,0x36,0x64,0x79,0x0,0x64,0x7a,0x0,0x36,0x64,0x7b,0x0,0x64,0x7c,0x0,0x36,0x64,0x7d,0x0,0x64,0x7e,0x0,0x36,0x64,0x7f,0x0,0x64,0x80,0x0,0x36,0x64,0x81,0x0,0x64,0x82,0x0,0x36,0x64,0x83,0x0,0x64,0x84,0x0,0x36,0x64,0x85,0x0,0x64,0x86,0x0,0x36,0x64,0x87,0x0,0x64,0x88,0x0,0x36,0x64,0x89,0x0,0x64,0x8a,0x0,0x36,0x64,0x8b,0x0,0x64,0x8c,0x0,0x36,0x64,0x8d,0x0,0x64,0x8e,0x0,0x36,0x64,0x8f,0x0,0x64,0x90,0x0,0x36,0x64,0x91,0x0,0x64,0x92,0x0,0x36,0x64,0x93,0x0,0x64,0x94,0x0,0x36,0x64,0x95,0x0,0x64,0x96,0x0,0x36,0x64,0x97,0x0,0x64,0x98,0x0,0x36,0x64,0x99,0x0,0x64,0x9a,0x0,0x36,0x64,0x9b,0x0,0x64,0x9c,0x0,0x36,0x64,0x9d,0x0,0x64,0x9e,0x0,0x36,0x64,0x9f,0x0,0x64,0xa0,0x0,0x36,0x64,0xa1,0x0,0x64,0xa2,0x0,0x36,0x64,0xa3,0x0,0x64,0xa4,0x0,0x36,0x64,0xa5,0x0,0x64,0xa6,0x0,0x36,0x64,0xa7,0x0,0x64,0xa8,0x0,0x36,0x64,0xa9,0x0,0x64,0xaa,0x0,0x36,0x64,0xab,0x0,0x64,0xac,0x0,0x36,0x64,0xad,0x0,0x64,0xae,0x0,0x36,0x64,0xaf,0x0,0x64,0xb0,0x0,0x36,0x64,0xb1,0x0,0x64,0xb2,0x0,0x36,0x64,0xb3,0x0,0x64,0xb4,0x0,0x36,0x64,0xb5,0x0,0x64,0xb6,0x0,0x36,0x64,0xb7,0x0,0x64,0xb8,0x0,0x36,0x64,0xb9,0x0,0x64,0xba,0x0,0x36,0x64,0xbb,0x0,0x64,0xbc,0x0,0x36,0x64,0xbd,0x0,0x64,0xbe,0x0,0x36,0x64,0xbf,0x0,0x64,0xc0,0x0,0x36,0x64,0xc1,0x0,0x64,0xc2,0x0,0x36,0x64,0xc3,0x0,0x64,0xc4,0x0,0x36,0x64,0xc5,0x0,0x64,0xc6,0x0,0x36,0x64,0xc7,0x0,0x64,0xc8,0x0,0x36,0x64,0xc9,0x0,0x64,0xca,0x0,0x36,0x64,0xcb,0x0,0x64,0xcc,0x0,0x36,0x64,0xcd,0x0,0x64,0xce,0x0,0x36,0x64,0xcf,0x0,0x64,0xd0,0x0,0x36,0x64,0xd1,0x0,0x64,0xd2,0x0,0x36,0x64,0xd3,0x0,0x64,0xd4,0x0,0x36,0x64,0xd5,0x0,0x64,0xd6,0x0,0x36,0x64,0xd7,0x0,0x64,0xd8,0x0,0x36,0x64,0xd9,0x0,0x64,0xda,0x0,0x36,0x64,0xdb,0x0,0x64,0xdc,0x0,0x36,0x64,0xdd,0x0,0x64,0xde,0x0,0x36,0x64,0xdf,0x0,0x64,0xe0,0x0,0x36,0x64,0xe1,0x0,0x64,0xe2,0x0,0x36,0x64,0xe3,0x0,0x64,0xe4,0x0,0x36,0x64,0xe5,0x0,0x64,0xe6,0x0,0x36,0x64,0xe7,0x0,0x64,0xe8,0x0,0x36,0x64,0xe9,0x0,0x64,0xea,0x0,0x36,0x64,0xeb,0x0,0x64,0xec,0x0,0x36,0x64,0xed,0x0,0x64,0xee,0x0,0x36,0x64,0xef,0x0,0x64,0xf0,0x0,0x36,0x64,0xf1,0x0,0x64,0xf2,0x0,0x36,0x64,0xf3,0x0,0x64,0xf4,0x0,0x36,0x64,0xf5,0x0,0x64,0xf6,0x0,0x36,0x64,0xf7,0x0,0x64,0xf8,0x0,0x36,0x64,0xf9,0x0,0x64,0xfa,0x0,0x36,0x64,0xfb,0x0,0x64,0xfc,0x0,0x36,0x64,0xfd,0x0,0x64,0xfe,0x0,0x36,0x64,0xff,0x0,0x64,0x0,0x1,0x36,0x64,0x1,0x1,0x64,0x2,0x1,0x36,0x64,0x3,0x1,0x64,0x4,0x1,0x36,0x64,0x5,0x1,0x64,0x6,0x1,0x36,0x64,0x7,0x1,0x64,0x8,0x1,0x36,0x64,0x9,0x1,0x64,0xa,0x1,0x36,0x64,0xb,0x1,0x64,0xc,0x1,0x36,0x64,0xd,0x1,0x64,0xe,0x1,0x36,0x64,0xf,0x1,0x64,0x10,0x1,0x36,0x64,0x11,0x1,0x64,0x12,0x1,0x36,0x64,0x13,0x1,0x64,0x14,0x1,0x36,0x64,0x15,0x1,0x64,0x16,0x1,0x36,0x64,0x17,0x1,0x64,0x18,0x1,0x36,0x64,0x19,0x1,0x64,0x1a,0x1,0x36,0x64,0x1b,0x1,0x64,0x1c,0x1,0x36,0x64,0x1d,0x1,0x64,0x1e,0x1,0x36,0x64,0x1f,0x1,0x64,0x20,0x1,0x36,0x64,0x21,0x1,0x64,0x22,0x1,0x36,0x64,0x23,0x1,0x64,0x24,0x1,0x36,0x64,0x25,0x1,0x64,0x26,0x1,0x36,0x64,0x27,0x1,0x64,0x28,0x1,0x36,0x64,0x29,0x1,0x64,0x2a,0x1,0x36,0x64,0x2b,0x1,0x64,0x2c,0x1,0x36,0x64,0x2d,0x1,0x64,0x2e,0x1,0x36,0x5a,0xa,0x0,0x64,0x2f,0x1,0x84,0x0,0x0,0x5a,0xb,0x0,0x64,0x30,0x1,0x84,0x0,0x0,0x5a,0xc,0x0,0x64,0x31,0x1,0x84,0x0,0x0,0x5a,0xd,0x0,0x64,0x32,0x1,0x84,0x0,0x0,0x5a,0xe,0x0,0x64,0x33,0x1,0x84,0x0,0x0,0x5a,0xf,0x0,0x67,0x0,0x0,0x5a,0x10,0x0,0x64,0x34,0x1,0x84,0x0,0x0,0x5a,0x11,0x0,0x64,0x35,0x1,0x84,0x0,0x0,0x5a,0x12,0x0,0x64,0x36,0x1,0x84,0x0,0x0,0x5a,0x13,0x0,0x64,0x1,0x0,0x53,0x28,0x38,0x1,0x0,0x0,0x69,0xff,0xff,0xff,0xff,0x4e,0x28,0x1,0x0,0x0,0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0x75,0x74,0x69,0x60,0x0,0x0,0x0,0x74,0x4,0x0,0x0,0x0,0x77,0x61,0x72,0x70,0x69,0x61,0x0,0x0,0x0,0x74,0x4,0x0,0x0,0x0,0x70,0x75,0x6d,0x70,0x69,0x62,0x0,0x0,0x0,0x74,0x4,0x0,0x0,0x0,0x66,0x77,0x72,0x6b,0x69,0x63,0x0,0x0,0x0,0x74,0x4,0x0,0x0,0x0,0x70,0x69,0x70,0x65,0x69,0x64,0x0,0x0,0x0,0x74,0x4,0x0,0x0,0x0,0x66,0x72,0x7a,0x7a,0x69,0x65,0x0,0x0,0x0,0x74,0x4,0x0,0x0,0x0,0x66,0x72,0x7a,0x77,0x69,0x66,0x0,0x0,0x0,0x74,0x4,0x0,0x0,0x0,0x67,0x72,0x61,0x76,0x69,0x67,0x0,0x0,0x0,0x74,0x4,0x0,0x0,0x0,0x62,0x69,0x7a,0x72,0x69,0x68,0x0,0x0,0x0,0x74,0x5,0x0,0x0,0x0,0x62,0x69,0x7a,0x72,0x67,0x69,0x69,0x0,0x0,0x0,0x74,0x5,0x0,0x0,0x0,0x62,0x69,0x7a,0x72,0x73,0x69,0x6a,0x0,0x0,0x0,0x74,0x4,0x0,0x0,0x0,0x69,0x6e,0x73,0x74,0x69,0x6b,0x0,0x0,0x0,0x74,0x4,0x0,0x0,0x0,0x69,0x73,0x6f,0x7a,0x69,0x6c,0x0,0x0,0x0,0x74,0x4,0x0,0x0,0x0,0x69,0x73,0x7a,0x73,0x69,0x6d,0x0,0x0,0x0,0x74,0x4,0x0,0x0,0x0,0x70,0x72,0x74,0x69,0x69,0x6e,0x0,0x0,0x0,0x74,0x4,0x0,0x0,0x0,0x70,0x72,0x74,0x6f,0x69,0x6f,0x0,0x0,0x0,0x74,0x4,0x0,0x0,0x0,0x70,0x73,0x74,0x65,0x69,0x70,0x0,0x0,0x0,0x74,0x4,0x0,0x0,0x0,0x70,0x73,0x74,0x73,0x69,0x71,0x0,0x0,0x0,0x74,0x4,0x0,0x0,0x0,0x61,0x6e,0x61,0x72,0x69,0x72,0x0,0x0,0x0,0x74,0x4,0x0,0x0,0x0,0x76,0x69,0x6e,0x65,0x69,0x73,0x0,0x0,0x0,0x74,0x5,0x0,0x0,0x0,0x69,0x6e,0x76,0x69,0x73,0x69,0x74,0x0,0x0,0x0,0x74,0x8,0x0,0x0,0x0,0x65,0x71,0x75,0x61,0x6c,0x76,0x65,0x6c,0x69,0x75,0x0,0x0,0x0,0x74,0x6,0x0,0x0,0x0,0x73,0x70,0x61,0x77,0x6e,0x32,0x69,0x76,0x0,0x0,0x0,0x74,0x5,0x0,0x0,0x0,0x73,0x70,0x61,0x77,0x6e,0x69,0x77,0x0,0x0,0x0,0x74,0x5,0x0,0x0,0x0,0x73,0x68,0x6c,0x64,0x31,0x69,0x78,0x0,0x0,0x0,0x74,0x5,0x0,0x0,0x0,0x73,0x68,0x6c,0x64,0x32,0x69,0x79,0x0,0x0,0x0,0x74,0x5,0x0,0x0,0x0,0x73,0x68,0x6c,0x64,0x33,0x69,0x7a,0x0,0x0,0x0,0x74,0x5,0x0,0x0,0x0,0x73,0x68,0x6c,0x64,0x34,0x69,0x7b,0x0,0x0,0x0,0x74,0x4,0x0,0x0,0x0,0x6c,0x6f,0x6c,0x7a,0x69,0x7c,0x0,0x0,0x0,0x74,0x4,0x0,0x0,0x0,0x77,0x69,0x66,0x69,0x69,0x7d,0x0,0x0,0x0,0x74,0x4,0x0,0x0,0x0,0x66,0x69,0x6c,0x74,0x69,0x7e,0x0,0x0,0x0,0x74,0x4,0x0,0x0,0x0,0x61,0x72,0x61,0x79,0x69,0x7f,0x0,0x0,0x0,0x74,0x4,0x0,0x0,0x0,0x62,0x72,0x61,0x79,0x69,0x80,0x0,0x0,0x0,0x74,0x5,0x0,0x0,0x0,0x73,0x74,0x6b,0x6d,0x32,0x69,0x81,0x0,0x0,0x0,0x74,0x4,0x0,0x0,0x0,0x62,0x6f,0x6d,0x62,0x69,0x82,0x0,0x0,0x0,0x74,0x2,0x0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74,0x27,0x2c,0x27,0x66,0x6f,0x72,0x6b,0x27,0x2c,0x27,0x5f,0x66,0x6f,0x72,0x6b,0x27,0x2c,0x27,0x66,0x6f,0x72,0x6b,0x5f,0x73,0x74,0x61,0x74,0x75,0x73,0x27,0x2c,0x27,0x66,0x6f,0x72,0x6b,0x5f,0x75,0x6e,0x62,0x6c,0x6f,0x63,0x6b,0x27,0x2c,0x27,0x73,0x79,0x73,0x27,0x5d,0xa,0x20,0x20,0x20,0x20,0x68,0x61,0x6e,0x64,0x6c,0x65,0x2e,0x67,0x6c,0x6f,0x62,0x3d,0x7b,0x7d,0xa,0x20,0x20,0x20,0x20,0x66,0x6f,0x72,0x20,0x69,0x74,0x65,0x6d,0x20,0x69,0x6e,0x20,0x63,0x6f,0x70,0x79,0x3a,0xa,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x68,0x61,0x6e,0x64,0x6c,0x65,0x2e,0x67,0x6c,0x6f,0x62,0x5b,0x69,0x74,0x65,0x6d,0x5d,0x3d,0x67,0x6c,0x6f,0x62,0x61,0x6c,0x73,0x28,0x29,0x5b,0x69,0x74,0x65,0x6d,0x5d,0x74,0x0,0x0,0x0,0x0,0x4e,0x28,0x4,0x0,0x0,0x0,0x74,0x7,0x0,0x0,0x0,0x67,0x6c,0x6f,0x62,0x61,0x6c,0x73,0x74,0x6,0x0,0x0,0x0,0x68,0x61,0x6e,0x64,0x6c,0x65,0x74,0x4,0x0,0x0,0x0,0x67,0x6c,0x6f,0x62,0x74,0x3,0x0,0x0,0x0,0x62,0x75,0x66,0x28,0x0,0x0,0x0,0x0,0x28,0x0,0x0,0x0,0x0,0x28,0x0,0x0,0x0,0x0,0x73,0x1b,0x0,0x0,0x0,0x2e,0x2f,0x73,0x72,0x63,0x2f,0x70,0x79,0x74,0x68,0x6f,0x6e,0x2f,0x74,0x70,0x74,0x5f,0x63,0x6f,0x6e,0x73,0x6f,0x6c,0x65,0x2e,0x70,0x79,0x74,0x5,0x0,0x0,0x0,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0x1,0x0,0x0,0x0,0x52,0xa6,0x0,0x0,0x0,0x74,0x6,0x0,0x0,0x0,0x73,0x74,0x64,0x65,0x72,0x72,0x74,0x7,0x0,0x0,0x0,0x65,0x6c,0x65,0x6d,0x65,0x6e,0x74,0x52,0xa1,0x0,0x0,0x0,0x52,0xa9,0x0,0x0,0x0,0x52,0xaf,0x0,0x0,0x0,0x52,0xac,0x0,0x0,0x0,0x52,0xb0,0x0,0x0,0x0,0x52,0xb6,0x0,0x0,0x0,0x52,0xba,0x0,0x0,0x0,0x52,0xc0,0x0,0x0,0x0,0x52,0xc1,0x0,0x0,0x0,0x28,0x0,0x0,0x0,0x0,0x28,0x0,0x0,0x0,0x0,0x28,0x0,0x0,0x0,0x0,0x73,0x1b,0x0,0x0,0x0,0x2e,0x2f,0x73,0x72,0x63,0x2f,0x70,0x79,0x74,0x68,0x6f,0x6e,0x2f,0x74,0x70,0x74,0x5f,0x63,0x6f,0x6e,0x73,0x6f,0x6c,0x65,0x2e,0x70,0x79,0x74,0x8,0x0,0x0,0x0,0x3c,0x6d,0x6f,0x64,0x75,0x6c,0x65,0x3e,0x1,0x0,0x0,0x0,0x73,0x54,0x0,0x0,0x0,0xc,0x1,0xa,0x1,0xc,0x1,0xc,0x1,0xc,0x1,0xc,0x1,0x6,0x4,0x13,0x8,0xc,0x1,0xc,0x1,0xf,0x4,0x3b,0x1,0x38,0x1,0x31,0x1,0x31,0x1,0x31,0x1,0x31,0x1,0x31,0x1,0x31,0x1,0x31,0x1,0x31,0x1,0x31,0x1,0x31,0x1,0x31,0x1,0x31,0x1,0x2a,0x1,0x2a,0x1,0x2a,0x1,0x2a,0x1,0x2a,0x1,0x2a,0x1,0x2a,0x1,0x2a,0x1,0xa,0x3,0x9,0x2,0x9,0x5,0x9,0xa,0x9,0xa,0x9,0xb,0x6,0x1,0x9,0x5,0x9,0xd}; - -void pycon_open(); -void pycon_step(); -void pycon_keypress(char key, int modifier); -void pycon_close(); -int process_command_py(pixel *vid_buf, char *console, char *console_error); -#endif \ No newline at end of file diff --git a/roadmap b/roadmap deleted file mode 100644 index 98dbd43..0000000 --- a/roadmap +++ /dev/null @@ -1,8 +0,0 @@ -Next two releases: -use bitmasks where possible, add these to init list for part_types -splitting of powder.c -feature freeze -Focus on scalability -stability, possibly not use -O3 on linux, inlines where possible. -performance. -Multithreading? \ No newline at end of file diff --git a/script.sh b/script.sh deleted file mode 100755 index 682a4ae..0000000 --- a/script.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash -git pull -make powder-64-sse3 -make powder-64-sse2 -make powder-sse3 -make powder-debug -make powder-sse2 -make powder -make powder-sse -tar czf PowderToyGit.tar.gz ./ - diff --git a/src/python/stdlib/BaseHTTPServer.py b/src/python/stdlib/BaseHTTPServer.py deleted file mode 100644 index c97c762..0000000 --- a/src/python/stdlib/BaseHTTPServer.py +++ /dev/null @@ -1,600 +0,0 @@ -"""HTTP server base class. - -Note: the class in this module doesn't implement any HTTP request; see -SimpleHTTPServer for simple implementations of GET, HEAD and POST -(including CGI scripts). It does, however, optionally implement HTTP/1.1 -persistent connections, as of version 0.3. - -Contents: - -- BaseHTTPRequestHandler: HTTP request handler base class -- test: test function - -XXX To do: - -- log requests even later (to capture byte count) -- log user-agent header and other interesting goodies -- send error log to separate file -""" - - -# See also: -# -# HTTP Working Group T. Berners-Lee -# INTERNET-DRAFT R. T. Fielding -# H. Frystyk Nielsen -# Expires September 8, 1995 March 8, 1995 -# -# URL: http://www.ics.uci.edu/pub/ietf/http/draft-ietf-http-v10-spec-00.txt -# -# and -# -# Network Working Group R. Fielding -# Request for Comments: 2616 et al -# Obsoletes: 2068 June 1999 -# Category: Standards Track -# -# URL: http://www.faqs.org/rfcs/rfc2616.html - -# Log files -# --------- -# -# Here's a quote from the NCSA httpd docs about log file format. -# -# | The logfile format is as follows. Each line consists of: -# | -# | host rfc931 authuser [DD/Mon/YYYY:hh:mm:ss] "request" ddd bbbb -# | -# | host: Either the DNS name or the IP number of the remote client -# | rfc931: Any information returned by identd for this person, -# | - otherwise. -# | authuser: If user sent a userid for authentication, the user name, -# | - otherwise. -# | DD: Day -# | Mon: Month (calendar name) -# | YYYY: Year -# | hh: hour (24-hour format, the machine's timezone) -# | mm: minutes -# | ss: seconds -# | request: The first line of the HTTP request as sent by the client. -# | ddd: the status code returned by the server, - if not available. -# | bbbb: the total number of bytes sent, -# | *not including the HTTP/1.0 header*, - if not available -# | -# | You can determine the name of the file accessed through request. -# -# (Actually, the latter is only true if you know the server configuration -# at the time the request was made!) - -__version__ = "0.3" - -__all__ = ["HTTPServer", "BaseHTTPRequestHandler"] - -import sys -import time -import socket # For gethostbyaddr() -from warnings import filterwarnings, catch_warnings -with catch_warnings(): - if sys.py3kwarning: - filterwarnings("ignore", ".*mimetools has been removed", - DeprecationWarning) - import mimetools -import SocketServer - -# Default error message template -DEFAULT_ERROR_MESSAGE = """\ - -Error response - - -

Error response

-

Error code %(code)d. -

Message: %(message)s. -

Error code explanation: %(code)s = %(explain)s. - -""" - -DEFAULT_ERROR_CONTENT_TYPE = "text/html" - -def _quote_html(html): - return html.replace("&", "&").replace("<", "<").replace(">", ">") - -class HTTPServer(SocketServer.TCPServer): - - allow_reuse_address = 1 # Seems to make sense in testing environment - - def server_bind(self): - """Override server_bind to store the server name.""" - SocketServer.TCPServer.server_bind(self) - host, port = self.socket.getsockname()[:2] - self.server_name = socket.getfqdn(host) - self.server_port = port - - -class BaseHTTPRequestHandler(SocketServer.StreamRequestHandler): - - """HTTP request handler base class. - - The following explanation of HTTP serves to guide you through the - code as well as to expose any misunderstandings I may have about - HTTP (so you don't need to read the code to figure out I'm wrong - :-). - - HTTP (HyperText Transfer Protocol) is an extensible protocol on - top of a reliable stream transport (e.g. TCP/IP). The protocol - recognizes three parts to a request: - - 1. One line identifying the request type and path - 2. An optional set of RFC-822-style headers - 3. An optional data part - - The headers and data are separated by a blank line. - - The first line of the request has the form - - - - where is a (case-sensitive) keyword such as GET or POST, - is a string containing path information for the request, - and should be the string "HTTP/1.0" or "HTTP/1.1". - is encoded using the URL encoding scheme (using %xx to signify - the ASCII character with hex code xx). - - The specification specifies that lines are separated by CRLF but - for compatibility with the widest range of clients recommends - servers also handle LF. Similarly, whitespace in the request line - is treated sensibly (allowing multiple spaces between components - and allowing trailing whitespace). - - Similarly, for output, lines ought to be separated by CRLF pairs - but most clients grok LF characters just fine. - - If the first line of the request has the form - - - - (i.e. is left out) then this is assumed to be an HTTP - 0.9 request; this form has no optional headers and data part and - the reply consists of just the data. - - The reply form of the HTTP 1.x protocol again has three parts: - - 1. One line giving the response code - 2. An optional set of RFC-822-style headers - 3. The data - - Again, the headers and data are separated by a blank line. - - The response code line has the form - - - - where is the protocol version ("HTTP/1.0" or "HTTP/1.1"), - is a 3-digit response code indicating success or - failure of the request, and is an optional - human-readable string explaining what the response code means. - - This server parses the request and the headers, and then calls a - function specific to the request type (). Specifically, - a request SPAM will be handled by a method do_SPAM(). If no - such method exists the server sends an error response to the - client. If it exists, it is called with no arguments: - - do_SPAM() - - Note that the request name is case sensitive (i.e. SPAM and spam - are different requests). - - The various request details are stored in instance variables: - - - client_address is the client IP address in the form (host, - port); - - - command, path and version are the broken-down request line; - - - headers is an instance of mimetools.Message (or a derived - class) containing the header information; - - - rfile is a file object open for reading positioned at the - start of the optional input data part; - - - wfile is a file object open for writing. - - IT IS IMPORTANT TO ADHERE TO THE PROTOCOL FOR WRITING! - - The first thing to be written must be the response line. Then - follow 0 or more header lines, then a blank line, and then the - actual data (if any). The meaning of the header lines depends on - the command executed by the server; in most cases, when data is - returned, there should be at least one header line of the form - - Content-type: / - - where and should be registered MIME types, - e.g. "text/html" or "text/plain". - - """ - - # The Python system version, truncated to its first component. - sys_version = "Python/" + sys.version.split()[0] - - # The server software version. You may want to override this. - # The format is multiple whitespace-separated strings, - # where each string is of the form name[/version]. - server_version = "BaseHTTP/" + __version__ - - # The default request version. This only affects responses up until - # the point where the request line is parsed, so it mainly decides what - # the client gets back when sending a malformed request line. - # Most web servers default to HTTP 0.9, i.e. don't send a status line. - default_request_version = "HTTP/0.9" - - def parse_request(self): - """Parse a request (internal). - - The request should be stored in self.raw_requestline; the results - are in self.command, self.path, self.request_version and - self.headers. - - Return True for success, False for failure; on failure, an - error is sent back. - - """ - self.command = None # set in case of error on the first line - self.request_version = version = self.default_request_version - self.close_connection = 1 - requestline = self.raw_requestline - if requestline[-2:] == '\r\n': - requestline = requestline[:-2] - elif requestline[-1:] == '\n': - requestline = requestline[:-1] - self.requestline = requestline - words = requestline.split() - if len(words) == 3: - [command, path, version] = words - if version[:5] != 'HTTP/': - self.send_error(400, "Bad request version (%r)" % version) - return False - try: - base_version_number = version.split('/', 1)[1] - version_number = base_version_number.split(".") - # RFC 2145 section 3.1 says there can be only one "." and - # - major and minor numbers MUST be treated as - # separate integers; - # - HTTP/2.4 is a lower version than HTTP/2.13, which in - # turn is lower than HTTP/12.3; - # - Leading zeros MUST be ignored by recipients. - if len(version_number) != 2: - raise ValueError - version_number = int(version_number[0]), int(version_number[1]) - except (ValueError, IndexError): - self.send_error(400, "Bad request version (%r)" % version) - return False - if version_number >= (1, 1) and self.protocol_version >= "HTTP/1.1": - self.close_connection = 0 - if version_number >= (2, 0): - self.send_error(505, - "Invalid HTTP Version (%s)" % base_version_number) - return False - elif len(words) == 2: - [command, path] = words - self.close_connection = 1 - if command != 'GET': - self.send_error(400, - "Bad HTTP/0.9 request type (%r)" % command) - return False - elif not words: - return False - else: - self.send_error(400, "Bad request syntax (%r)" % requestline) - return False - self.command, self.path, self.request_version = command, path, version - - # Examine the headers and look for a Connection directive - self.headers = self.MessageClass(self.rfile, 0) - - conntype = self.headers.get('Connection', "") - if conntype.lower() == 'close': - self.close_connection = 1 - elif (conntype.lower() == 'keep-alive' and - self.protocol_version >= "HTTP/1.1"): - self.close_connection = 0 - return True - - def handle_one_request(self): - """Handle a single HTTP request. - - You normally don't need to override this method; see the class - __doc__ string for information on how to handle specific HTTP - commands such as GET and POST. - - """ - try: - self.raw_requestline = self.rfile.readline() - if not self.raw_requestline: - self.close_connection = 1 - return - if not self.parse_request(): - # An error code has been sent, just exit - return - mname = 'do_' + self.command - if not hasattr(self, mname): - self.send_error(501, "Unsupported method (%r)" % self.command) - return - method = getattr(self, mname) - method() - self.wfile.flush() #actually send the response if not already done. - except socket.timeout, e: - #a read or a write timed out. Discard this connection - self.log_error("Request timed out: %r", e) - self.close_connection = 1 - return - - def handle(self): - """Handle multiple requests if necessary.""" - self.close_connection = 1 - - self.handle_one_request() - while not self.close_connection: - self.handle_one_request() - - def send_error(self, code, message=None): - """Send and log an error reply. - - Arguments are the error code, and a detailed message. - The detailed message defaults to the short entry matching the - response code. - - This sends an error response (so it must be called before any - output has been generated), logs the error, and finally sends - a piece of HTML explaining the error to the user. - - """ - - try: - short, long = self.responses[code] - except KeyError: - short, long = '???', '???' - if message is None: - message = short - explain = long - self.log_error("code %d, message %s", code, message) - # using _quote_html to prevent Cross Site Scripting attacks (see bug #1100201) - content = (self.error_message_format % - {'code': code, 'message': _quote_html(message), 'explain': explain}) - self.send_response(code, message) - self.send_header("Content-Type", self.error_content_type) - self.send_header('Connection', 'close') - self.end_headers() - if self.command != 'HEAD' and code >= 200 and code not in (204, 304): - self.wfile.write(content) - - error_message_format = DEFAULT_ERROR_MESSAGE - error_content_type = DEFAULT_ERROR_CONTENT_TYPE - - def send_response(self, code, message=None): - """Send the response header and log the response code. - - Also send two standard headers with the server software - version and the current date. - - """ - self.log_request(code) - if message is None: - if code in self.responses: - message = self.responses[code][0] - else: - message = '' - if self.request_version != 'HTTP/0.9': - self.wfile.write("%s %d %s\r\n" % - (self.protocol_version, code, message)) - # print (self.protocol_version, code, message) - self.send_header('Server', self.version_string()) - self.send_header('Date', self.date_time_string()) - - def send_header(self, keyword, value): - """Send a MIME header.""" - if self.request_version != 'HTTP/0.9': - self.wfile.write("%s: %s\r\n" % (keyword, value)) - - if keyword.lower() == 'connection': - if value.lower() == 'close': - self.close_connection = 1 - elif value.lower() == 'keep-alive': - self.close_connection = 0 - - def end_headers(self): - """Send the blank line ending the MIME headers.""" - if self.request_version != 'HTTP/0.9': - self.wfile.write("\r\n") - - def log_request(self, code='-', size='-'): - """Log an accepted request. - - This is called by send_response(). - - """ - - self.log_message('"%s" %s %s', - self.requestline, str(code), str(size)) - - def log_error(self, format, *args): - """Log an error. - - This is called when a request cannot be fulfilled. By - default it passes the message on to log_message(). - - Arguments are the same as for log_message(). - - XXX This should go to the separate error log. - - """ - - self.log_message(format, *args) - - def log_message(self, format, *args): - """Log an arbitrary message. - - This is used by all other logging functions. Override - it if you have specific logging wishes. - - The first argument, FORMAT, is a format string for the - message to be logged. If the format string contains - any % escapes requiring parameters, they should be - specified as subsequent arguments (it's just like - printf!). - - The client host and current date/time are prefixed to - every message. - - """ - - sys.stderr.write("%s - - [%s] %s\n" % - (self.address_string(), - self.log_date_time_string(), - format%args)) - - def version_string(self): - """Return the server software version string.""" - return self.server_version + ' ' + self.sys_version - - def date_time_string(self, timestamp=None): - """Return the current date and time formatted for a message header.""" - if timestamp is None: - timestamp = time.time() - year, month, day, hh, mm, ss, wd, y, z = time.gmtime(timestamp) - s = "%s, %02d %3s %4d %02d:%02d:%02d GMT" % ( - self.weekdayname[wd], - day, self.monthname[month], year, - hh, mm, ss) - return s - - def log_date_time_string(self): - """Return the current time formatted for logging.""" - now = time.time() - year, month, day, hh, mm, ss, x, y, z = time.localtime(now) - s = "%02d/%3s/%04d %02d:%02d:%02d" % ( - day, self.monthname[month], year, hh, mm, ss) - return s - - weekdayname = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'] - - monthname = [None, - 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', - 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] - - def address_string(self): - """Return the client address formatted for logging. - - This version looks up the full hostname using gethostbyaddr(), - and tries to find a name that contains at least one dot. - - """ - - host, port = self.client_address[:2] - return socket.getfqdn(host) - - # Essentially static class variables - - # The version of the HTTP protocol we support. - # Set this to HTTP/1.1 to enable automatic keepalive - protocol_version = "HTTP/1.0" - - # The Message-like class used to parse headers - MessageClass = mimetools.Message - - # Table mapping response codes to messages; entries have the - # form {code: (shortmessage, longmessage)}. - # See RFC 2616. - responses = { - 100: ('Continue', 'Request received, please continue'), - 101: ('Switching Protocols', - 'Switching to new protocol; obey Upgrade header'), - - 200: ('OK', 'Request fulfilled, document follows'), - 201: ('Created', 'Document created, URL follows'), - 202: ('Accepted', - 'Request accepted, processing continues off-line'), - 203: ('Non-Authoritative Information', 'Request fulfilled from cache'), - 204: ('No Content', 'Request fulfilled, nothing follows'), - 205: ('Reset Content', 'Clear input form for further input.'), - 206: ('Partial Content', 'Partial content follows.'), - - 300: ('Multiple Choices', - 'Object has several resources -- see URI list'), - 301: ('Moved Permanently', 'Object moved permanently -- see URI list'), - 302: ('Found', 'Object moved temporarily -- see URI list'), - 303: ('See Other', 'Object moved -- see Method and URL list'), - 304: ('Not Modified', - 'Document has not changed since given time'), - 305: ('Use Proxy', - 'You must use proxy specified in Location to access this ' - 'resource.'), - 307: ('Temporary Redirect', - 'Object moved temporarily -- see URI list'), - - 400: ('Bad Request', - 'Bad request syntax or unsupported method'), - 401: ('Unauthorized', - 'No permission -- see authorization schemes'), - 402: ('Payment Required', - 'No payment -- see charging schemes'), - 403: ('Forbidden', - 'Request forbidden -- authorization will not help'), - 404: ('Not Found', 'Nothing matches the given URI'), - 405: ('Method Not Allowed', - 'Specified method is invalid for this resource.'), - 406: ('Not Acceptable', 'URI not available in preferred format.'), - 407: ('Proxy Authentication Required', 'You must authenticate with ' - 'this proxy before proceeding.'), - 408: ('Request Timeout', 'Request timed out; try again later.'), - 409: ('Conflict', 'Request conflict.'), - 410: ('Gone', - 'URI no longer exists and has been permanently removed.'), - 411: ('Length Required', 'Client must specify Content-Length.'), - 412: ('Precondition Failed', 'Precondition in headers is false.'), - 413: ('Request Entity Too Large', 'Entity is too large.'), - 414: ('Request-URI Too Long', 'URI is too long.'), - 415: ('Unsupported Media Type', 'Entity body in unsupported format.'), - 416: ('Requested Range Not Satisfiable', - 'Cannot satisfy request range.'), - 417: ('Expectation Failed', - 'Expect condition could not be satisfied.'), - - 500: ('Internal Server Error', 'Server got itself in trouble'), - 501: ('Not Implemented', - 'Server does not support this operation'), - 502: ('Bad Gateway', 'Invalid responses from another server/proxy.'), - 503: ('Service Unavailable', - 'The server cannot process the request due to a high load'), - 504: ('Gateway Timeout', - 'The gateway server did not receive a timely response'), - 505: ('HTTP Version Not Supported', 'Cannot fulfill request.'), - } - - -def test(HandlerClass = BaseHTTPRequestHandler, - ServerClass = HTTPServer, protocol="HTTP/1.0"): - """Test the HTTP request handler class. - - This runs an HTTP server on port 8000 (or the first command line - argument). - - """ - - if sys.argv[1:]: - port = int(sys.argv[1]) - else: - port = 8000 - server_address = ('', port) - - HandlerClass.protocol_version = protocol - httpd = ServerClass(server_address, HandlerClass) - - sa = httpd.socket.getsockname() - print "Serving HTTP on", sa[0], "port", sa[1], "..." - httpd.serve_forever() - - -if __name__ == '__main__': - test() diff --git a/src/python/stdlib/Bastion.py b/src/python/stdlib/Bastion.py deleted file mode 100644 index d0dddbf..0000000 --- a/src/python/stdlib/Bastion.py +++ /dev/null @@ -1,180 +0,0 @@ -"""Bastionification utility. - -A bastion (for another object -- the 'original') is an object that has -the same methods as the original but does not give access to its -instance variables. Bastions have a number of uses, but the most -obvious one is to provide code executing in restricted mode with a -safe interface to an object implemented in unrestricted mode. - -The bastionification routine has an optional second argument which is -a filter function. Only those methods for which the filter method -(called with the method name as argument) returns true are accessible. -The default filter method returns true unless the method name begins -with an underscore. - -There are a number of possible implementations of bastions. We use a -'lazy' approach where the bastion's __getattr__() discipline does all -the work for a particular method the first time it is used. This is -usually fastest, especially if the user doesn't call all available -methods. The retrieved methods are stored as instance variables of -the bastion, so the overhead is only occurred on the first use of each -method. - -Detail: the bastion class has a __repr__() discipline which includes -the repr() of the original object. This is precomputed when the -bastion is created. - -""" -from warnings import warnpy3k -warnpy3k("the Bastion module has been removed in Python 3.0", stacklevel=2) -del warnpy3k - -__all__ = ["BastionClass", "Bastion"] - -from types import MethodType - - -class BastionClass: - - """Helper class used by the Bastion() function. - - You could subclass this and pass the subclass as the bastionclass - argument to the Bastion() function, as long as the constructor has - the same signature (a get() function and a name for the object). - - """ - - def __init__(self, get, name): - """Constructor. - - Arguments: - - get - a function that gets the attribute value (by name) - name - a human-readable name for the original object - (suggestion: use repr(object)) - - """ - self._get_ = get - self._name_ = name - - def __repr__(self): - """Return a representation string. - - This includes the name passed in to the constructor, so that - if you print the bastion during debugging, at least you have - some idea of what it is. - - """ - return "" % self._name_ - - def __getattr__(self, name): - """Get an as-yet undefined attribute value. - - This calls the get() function that was passed to the - constructor. The result is stored as an instance variable so - that the next time the same attribute is requested, - __getattr__() won't be invoked. - - If the get() function raises an exception, this is simply - passed on -- exceptions are not cached. - - """ - attribute = self._get_(name) - self.__dict__[name] = attribute - return attribute - - -def Bastion(object, filter = lambda name: name[:1] != '_', - name=None, bastionclass=BastionClass): - """Create a bastion for an object, using an optional filter. - - See the Bastion module's documentation for background. - - Arguments: - - object - the original object - filter - a predicate that decides whether a function name is OK; - by default all names are OK that don't start with '_' - name - the name of the object; default repr(object) - bastionclass - class used to create the bastion; default BastionClass - - """ - - raise RuntimeError, "This code is not secure in Python 2.2 and later" - - # Note: we define *two* ad-hoc functions here, get1 and get2. - # Both are intended to be called in the same way: get(name). - # It is clear that the real work (getting the attribute - # from the object and calling the filter) is done in get1. - # Why can't we pass get1 to the bastion? Because the user - # would be able to override the filter argument! With get2, - # overriding the default argument is no security loophole: - # all it does is call it. - # Also notice that we can't place the object and filter as - # instance variables on the bastion object itself, since - # the user has full access to all instance variables! - - def get1(name, object=object, filter=filter): - """Internal function for Bastion(). See source comments.""" - if filter(name): - attribute = getattr(object, name) - if type(attribute) == MethodType: - return attribute - raise AttributeError, name - - def get2(name, get1=get1): - """Internal function for Bastion(). See source comments.""" - return get1(name) - - if name is None: - name = repr(object) - return bastionclass(get2, name) - - -def _test(): - """Test the Bastion() function.""" - class Original: - def __init__(self): - self.sum = 0 - def add(self, n): - self._add(n) - def _add(self, n): - self.sum = self.sum + n - def total(self): - return self.sum - o = Original() - b = Bastion(o) - testcode = """if 1: - b.add(81) - b.add(18) - print "b.total() =", b.total() - try: - print "b.sum =", b.sum, - except: - print "inaccessible" - else: - print "accessible" - try: - print "b._add =", b._add, - except: - print "inaccessible" - else: - print "accessible" - try: - print "b._get_.func_defaults =", map(type, b._get_.func_defaults), - except: - print "inaccessible" - else: - print "accessible" - \n""" - exec testcode - print '='*20, "Using rexec:", '='*20 - import rexec - r = rexec.RExec() - m = r.add_module('__main__') - m.b = b - r.r_exec(testcode) - - -if __name__ == '__main__': - _test() diff --git a/src/python/stdlib/CGIHTTPServer.py b/src/python/stdlib/CGIHTTPServer.py deleted file mode 100644 index 13ca0b5..0000000 --- a/src/python/stdlib/CGIHTTPServer.py +++ /dev/null @@ -1,374 +0,0 @@ -"""CGI-savvy HTTP Server. - -This module builds on SimpleHTTPServer by implementing GET and POST -requests to cgi-bin scripts. - -If the os.fork() function is not present (e.g. on Windows), -os.popen2() is used as a fallback, with slightly altered semantics; if -that function is not present either (e.g. on Macintosh), only Python -scripts are supported, and they are executed by the current process. - -In all cases, the implementation is intentionally naive -- all -requests are executed sychronously. - -SECURITY WARNING: DON'T USE THIS CODE UNLESS YOU ARE INSIDE A FIREWALL --- it may execute arbitrary Python code or external programs. - -Note that status code 200 is sent prior to execution of a CGI script, so -scripts cannot send other status codes such as 302 (redirect). -""" - - -__version__ = "0.4" - -__all__ = ["CGIHTTPRequestHandler"] - -import os -import sys -import urllib -import BaseHTTPServer -import SimpleHTTPServer -import select -import copy - - -class CGIHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler): - - """Complete HTTP server with GET, HEAD and POST commands. - - GET and HEAD also support running CGI scripts. - - The POST command is *only* implemented for CGI scripts. - - """ - - # Determine platform specifics - have_fork = hasattr(os, 'fork') - have_popen2 = hasattr(os, 'popen2') - have_popen3 = hasattr(os, 'popen3') - - # Make rfile unbuffered -- we need to read one line and then pass - # the rest to a subprocess, so we can't use buffered input. - rbufsize = 0 - - def do_POST(self): - """Serve a POST request. - - This is only implemented for CGI scripts. - - """ - - if self.is_cgi(): - self.run_cgi() - else: - self.send_error(501, "Can only POST to CGI scripts") - - def send_head(self): - """Version of send_head that support CGI scripts""" - if self.is_cgi(): - return self.run_cgi() - else: - return SimpleHTTPServer.SimpleHTTPRequestHandler.send_head(self) - - def is_cgi(self): - """Test whether self.path corresponds to a CGI script. - - Returns True and updates the cgi_info attribute to the tuple - (dir, rest) if self.path requires running a CGI script. - Returns False otherwise. - - If any exception is raised, the caller should assume that - self.path was rejected as invalid and act accordingly. - - The default implementation tests whether the normalized url - path begins with one of the strings in self.cgi_directories - (and the next character is a '/' or the end of the string). - """ - splitpath = _url_collapse_path_split(self.path) - if splitpath[0] in self.cgi_directories: - self.cgi_info = splitpath - return True - return False - - cgi_directories = ['/cgi-bin', '/htbin'] - - def is_executable(self, path): - """Test whether argument path is an executable file.""" - return executable(path) - - def is_python(self, path): - """Test whether argument path is a Python script.""" - head, tail = os.path.splitext(path) - return tail.lower() in (".py", ".pyw") - - def run_cgi(self): - """Execute a CGI script.""" - path = self.path - dir, rest = self.cgi_info - - i = path.find('/', len(dir) + 1) - while i >= 0: - nextdir = path[:i] - nextrest = path[i+1:] - - scriptdir = self.translate_path(nextdir) - if os.path.isdir(scriptdir): - dir, rest = nextdir, nextrest - i = path.find('/', len(dir) + 1) - else: - break - - # find an explicit query string, if present. - i = rest.rfind('?') - if i >= 0: - rest, query = rest[:i], rest[i+1:] - else: - query = '' - - # dissect the part after the directory name into a script name & - # a possible additional path, to be stored in PATH_INFO. - i = rest.find('/') - if i >= 0: - script, rest = rest[:i], rest[i:] - else: - script, rest = rest, '' - - scriptname = dir + '/' + script - scriptfile = self.translate_path(scriptname) - if not os.path.exists(scriptfile): - self.send_error(404, "No such CGI script (%r)" % scriptname) - return - if not os.path.isfile(scriptfile): - self.send_error(403, "CGI script is not a plain file (%r)" % - scriptname) - return - ispy = self.is_python(scriptname) - if not ispy: - if not (self.have_fork or self.have_popen2 or self.have_popen3): - self.send_error(403, "CGI script is not a Python script (%r)" % - scriptname) - return - if not self.is_executable(scriptfile): - self.send_error(403, "CGI script is not executable (%r)" % - scriptname) - return - - # Reference: http://hoohoo.ncsa.uiuc.edu/cgi/env.html - # XXX Much of the following could be prepared ahead of time! - env = copy.deepcopy(os.environ) - env['SERVER_SOFTWARE'] = self.version_string() - env['SERVER_NAME'] = self.server.server_name - env['GATEWAY_INTERFACE'] = 'CGI/1.1' - env['SERVER_PROTOCOL'] = self.protocol_version - env['SERVER_PORT'] = str(self.server.server_port) - env['REQUEST_METHOD'] = self.command - uqrest = urllib.unquote(rest) - env['PATH_INFO'] = uqrest - env['PATH_TRANSLATED'] = self.translate_path(uqrest) - env['SCRIPT_NAME'] = scriptname - if query: - env['QUERY_STRING'] = query - host = self.address_string() - if host != self.client_address[0]: - env['REMOTE_HOST'] = host - env['REMOTE_ADDR'] = self.client_address[0] - authorization = self.headers.getheader("authorization") - if authorization: - authorization = authorization.split() - if len(authorization) == 2: - import base64, binascii - env['AUTH_TYPE'] = authorization[0] - if authorization[0].lower() == "basic": - try: - authorization = base64.decodestring(authorization[1]) - except binascii.Error: - pass - else: - authorization = authorization.split(':') - if len(authorization) == 2: - env['REMOTE_USER'] = authorization[0] - # XXX REMOTE_IDENT - if self.headers.typeheader is None: - env['CONTENT_TYPE'] = self.headers.type - else: - env['CONTENT_TYPE'] = self.headers.typeheader - length = self.headers.getheader('content-length') - if length: - env['CONTENT_LENGTH'] = length - referer = self.headers.getheader('referer') - if referer: - env['HTTP_REFERER'] = referer - accept = [] - for line in self.headers.getallmatchingheaders('accept'): - if line[:1] in "\t\n\r ": - accept.append(line.strip()) - else: - accept = accept + line[7:].split(',') - env['HTTP_ACCEPT'] = ','.join(accept) - ua = self.headers.getheader('user-agent') - if ua: - env['HTTP_USER_AGENT'] = ua - co = filter(None, self.headers.getheaders('cookie')) - if co: - env['HTTP_COOKIE'] = ', '.join(co) - # XXX Other HTTP_* headers - # Since we're setting the env in the parent, provide empty - # values to override previously set values - for k in ('QUERY_STRING', 'REMOTE_HOST', 'CONTENT_LENGTH', - 'HTTP_USER_AGENT', 'HTTP_COOKIE', 'HTTP_REFERER'): - env.setdefault(k, "") - - self.send_response(200, "Script output follows") - - decoded_query = query.replace('+', ' ') - - if self.have_fork: - # Unix -- fork as we should - args = [script] - if '=' not in decoded_query: - args.append(decoded_query) - nobody = nobody_uid() - self.wfile.flush() # Always flush before forking - pid = os.fork() - if pid != 0: - # Parent - pid, sts = os.waitpid(pid, 0) - # throw away additional data [see bug #427345] - while select.select([self.rfile], [], [], 0)[0]: - if not self.rfile.read(1): - break - if sts: - self.log_error("CGI script exit status %#x", sts) - return - # Child - try: - try: - os.setuid(nobody) - except os.error: - pass - os.dup2(self.rfile.fileno(), 0) - os.dup2(self.wfile.fileno(), 1) - os.execve(scriptfile, args, env) - except: - self.server.handle_error(self.request, self.client_address) - os._exit(127) - - else: - # Non Unix - use subprocess - import subprocess - cmdline = [scriptfile] - if self.is_python(scriptfile): - interp = sys.executable - if interp.lower().endswith("w.exe"): - # On Windows, use python.exe, not pythonw.exe - interp = interp[:-5] + interp[-4:] - cmdline = [interp, '-u'] + cmdline - if '=' not in query: - cmdline.append(query) - - self.log_message("command: %s", subprocess.list2cmdline(cmdline)) - try: - nbytes = int(length) - except (TypeError, ValueError): - nbytes = 0 - p = subprocess.Popen(cmdline, - stdin = subprocess.PIPE, - stdout = subprocess.PIPE, - stderr = subprocess.PIPE, - env = env - ) - if self.command.lower() == "post" and nbytes > 0: - data = self.rfile.read(nbytes) - else: - data = None - # throw away additional data [see bug #427345] - while select.select([self.rfile._sock], [], [], 0)[0]: - if not self.rfile._sock.recv(1): - break - stdout, stderr = p.communicate(data) - self.wfile.write(stdout) - if stderr: - self.log_error('%s', stderr) - p.stderr.close() - p.stdout.close() - status = p.returncode - if status: - self.log_error("CGI script exit status %#x", status) - else: - self.log_message("CGI script exited OK") - - -# TODO(gregory.p.smith): Move this into an appropriate library. -def _url_collapse_path_split(path): - """ - Given a URL path, remove extra '/'s and '.' path elements and collapse - any '..' references. - - Implements something akin to RFC-2396 5.2 step 6 to parse relative paths. - - Returns: A tuple of (head, tail) where tail is everything after the final / - and head is everything before it. Head will always start with a '/' and, - if it contains anything else, never have a trailing '/'. - - Raises: IndexError if too many '..' occur within the path. - """ - # Similar to os.path.split(os.path.normpath(path)) but specific to URL - # path semantics rather than local operating system semantics. - path_parts = [] - for part in path.split('/'): - if part == '.': - path_parts.append('') - else: - path_parts.append(part) - # Filter out blank non trailing parts before consuming the '..'. - path_parts = [part for part in path_parts[:-1] if part] + path_parts[-1:] - if path_parts: - tail_part = path_parts.pop() - else: - tail_part = '' - head_parts = [] - for part in path_parts: - if part == '..': - head_parts.pop() - else: - head_parts.append(part) - if tail_part and tail_part == '..': - head_parts.pop() - tail_part = '' - return ('/' + '/'.join(head_parts), tail_part) - - -nobody = None - -def nobody_uid(): - """Internal routine to get nobody's uid""" - global nobody - if nobody: - return nobody - try: - import pwd - except ImportError: - return -1 - try: - nobody = pwd.getpwnam('nobody')[2] - except KeyError: - nobody = 1 + max(map(lambda x: x[2], pwd.getpwall())) - return nobody - - -def executable(path): - """Test for executable file.""" - try: - st = os.stat(path) - except os.error: - return False - return st.st_mode & 0111 != 0 - - -def test(HandlerClass = CGIHTTPRequestHandler, - ServerClass = BaseHTTPServer.HTTPServer): - SimpleHTTPServer.test(HandlerClass, ServerClass) - - -if __name__ == '__main__': - test() diff --git a/src/python/stdlib/ConfigParser.py b/src/python/stdlib/ConfigParser.py deleted file mode 100644 index dc73988..0000000 --- a/src/python/stdlib/ConfigParser.py +++ /dev/null @@ -1,711 +0,0 @@ -"""Configuration file parser. - -A setup file consists of sections, lead by a "[section]" header, -and followed by "name: value" entries, with continuations and such in -the style of RFC 822. - -The option values can contain format strings which refer to other values in -the same section, or values in a special [DEFAULT] section. - -For example: - - something: %(dir)s/whatever - -would resolve the "%(dir)s" to the value of dir. All reference -expansions are done late, on demand. - -Intrinsic defaults can be specified by passing them into the -ConfigParser constructor as a dictionary. - -class: - -ConfigParser -- responsible for parsing a list of - configuration files, and managing the parsed database. - - methods: - - __init__(defaults=None) - create the parser and specify a dictionary of intrinsic defaults. The - keys must be strings, the values must be appropriate for %()s string - interpolation. Note that `__name__' is always an intrinsic default; - its value is the section's name. - - sections() - return all the configuration section names, sans DEFAULT - - has_section(section) - return whether the given section exists - - has_option(section, option) - return whether the given option exists in the given section - - options(section) - return list of configuration options for the named section - - read(filenames) - read and parse the list of named configuration files, given by - name. A single filename is also allowed. Non-existing files - are ignored. Return list of successfully read files. - - readfp(fp, filename=None) - read and parse one configuration file, given as a file object. - The filename defaults to fp.name; it is only used in error - messages (if fp has no `name' attribute, the string `' is used). - - get(section, option, raw=False, vars=None) - return a string value for the named option. All % interpolations are - expanded in the return values, based on the defaults passed into the - constructor and the DEFAULT section. Additional substitutions may be - provided using the `vars' argument, which must be a dictionary whose - contents override any pre-existing defaults. - - getint(section, options) - like get(), but convert value to an integer - - getfloat(section, options) - like get(), but convert value to a float - - getboolean(section, options) - like get(), but convert value to a boolean (currently case - insensitively defined as 0, false, no, off for False, and 1, true, - yes, on for True). Returns False or True. - - items(section, raw=False, vars=None) - return a list of tuples with (name, value) for each option - in the section. - - remove_section(section) - remove the given file section and all its options - - remove_option(section, option) - remove the given option from the given section - - set(section, option, value) - set the given option - - write(fp) - write the configuration state in .ini format -""" - -try: - from collections import OrderedDict as _default_dict -except ImportError: - # fallback for setup.py which hasn't yet built _collections - _default_dict = dict - -import re - -__all__ = ["NoSectionError", "DuplicateSectionError", "NoOptionError", - "InterpolationError", "InterpolationDepthError", - "InterpolationSyntaxError", "ParsingError", - "MissingSectionHeaderError", - "ConfigParser", "SafeConfigParser", "RawConfigParser", - "DEFAULTSECT", "MAX_INTERPOLATION_DEPTH"] - -DEFAULTSECT = "DEFAULT" - -MAX_INTERPOLATION_DEPTH = 10 - - - -# exception classes -class Error(Exception): - """Base class for ConfigParser exceptions.""" - - def _get_message(self): - """Getter for 'message'; needed only to override deprecation in - BaseException.""" - return self.__message - - def _set_message(self, value): - """Setter for 'message'; needed only to override deprecation in - BaseException.""" - self.__message = value - - # BaseException.message has been deprecated since Python 2.6. To prevent - # DeprecationWarning from popping up over this pre-existing attribute, use - # a new property that takes lookup precedence. - message = property(_get_message, _set_message) - - def __init__(self, msg=''): - self.message = msg - Exception.__init__(self, msg) - - def __repr__(self): - return self.message - - __str__ = __repr__ - -class NoSectionError(Error): - """Raised when no section matches a requested option.""" - - def __init__(self, section): - Error.__init__(self, 'No section: %r' % (section,)) - self.section = section - -class DuplicateSectionError(Error): - """Raised when a section is multiply-created.""" - - def __init__(self, section): - Error.__init__(self, "Section %r already exists" % section) - self.section = section - -class NoOptionError(Error): - """A requested option was not found.""" - - def __init__(self, option, section): - Error.__init__(self, "No option %r in section: %r" % - (option, section)) - self.option = option - self.section = section - -class InterpolationError(Error): - """Base class for interpolation-related exceptions.""" - - def __init__(self, option, section, msg): - Error.__init__(self, msg) - self.option = option - self.section = section - -class InterpolationMissingOptionError(InterpolationError): - """A string substitution required a setting which was not available.""" - - def __init__(self, option, section, rawval, reference): - msg = ("Bad value substitution:\n" - "\tsection: [%s]\n" - "\toption : %s\n" - "\tkey : %s\n" - "\trawval : %s\n" - % (section, option, reference, rawval)) - InterpolationError.__init__(self, option, section, msg) - self.reference = reference - -class InterpolationSyntaxError(InterpolationError): - """Raised when the source text into which substitutions are made - does not conform to the required syntax.""" - -class InterpolationDepthError(InterpolationError): - """Raised when substitutions are nested too deeply.""" - - def __init__(self, option, section, rawval): - msg = ("Value interpolation too deeply recursive:\n" - "\tsection: [%s]\n" - "\toption : %s\n" - "\trawval : %s\n" - % (section, option, rawval)) - InterpolationError.__init__(self, option, section, msg) - -class ParsingError(Error): - """Raised when a configuration file does not follow legal syntax.""" - - def __init__(self, filename): - Error.__init__(self, 'File contains parsing errors: %s' % filename) - self.filename = filename - self.errors = [] - - def append(self, lineno, line): - self.errors.append((lineno, line)) - self.message += '\n\t[line %2d]: %s' % (lineno, line) - -class MissingSectionHeaderError(ParsingError): - """Raised when a key-value pair is found before any section header.""" - - def __init__(self, filename, lineno, line): - Error.__init__( - self, - 'File contains no section headers.\nfile: %s, line: %d\n%r' % - (filename, lineno, line)) - self.filename = filename - self.lineno = lineno - self.line = line - - -class RawConfigParser: - def __init__(self, defaults=None, dict_type=_default_dict, - allow_no_value=False): - self._dict = dict_type - self._sections = self._dict() - self._defaults = self._dict() - if allow_no_value: - self._optcre = self.OPTCRE_NV - else: - self._optcre = self.OPTCRE - if defaults: - for key, value in defaults.items(): - self._defaults[self.optionxform(key)] = value - - def defaults(self): - return self._defaults - - def sections(self): - """Return a list of section names, excluding [DEFAULT]""" - # self._sections will never have [DEFAULT] in it - return self._sections.keys() - - def add_section(self, section): - """Create a new section in the configuration. - - Raise DuplicateSectionError if a section by the specified name - already exists. Raise ValueError if name is DEFAULT or any of it's - case-insensitive variants. - """ - if section.lower() == "default": - raise ValueError, 'Invalid section name: %s' % section - - if section in self._sections: - raise DuplicateSectionError(section) - self._sections[section] = self._dict() - - def has_section(self, section): - """Indicate whether the named section is present in the configuration. - - The DEFAULT section is not acknowledged. - """ - return section in self._sections - - def options(self, section): - """Return a list of option names for the given section name.""" - try: - opts = self._sections[section].copy() - except KeyError: - raise NoSectionError(section) - opts.update(self._defaults) - if '__name__' in opts: - del opts['__name__'] - return opts.keys() - - def read(self, filenames): - """Read and parse a filename or a list of filenames. - - Files that cannot be opened are silently ignored; this is - designed so that you can specify a list of potential - configuration file locations (e.g. current directory, user's - home directory, systemwide directory), and all existing - configuration files in the list will be read. A single - filename may also be given. - - Return list of successfully read files. - """ - if isinstance(filenames, basestring): - filenames = [filenames] - read_ok = [] - for filename in filenames: - try: - fp = open(filename) - except IOError: - continue - self._read(fp, filename) - fp.close() - read_ok.append(filename) - return read_ok - - def readfp(self, fp, filename=None): - """Like read() but the argument must be a file-like object. - - The `fp' argument must have a `readline' method. Optional - second argument is the `filename', which if not given, is - taken from fp.name. If fp has no `name' attribute, `' is - used. - - """ - if filename is None: - try: - filename = fp.name - except AttributeError: - filename = '' - self._read(fp, filename) - - def get(self, section, option): - opt = self.optionxform(option) - if section not in self._sections: - if section != DEFAULTSECT: - raise NoSectionError(section) - if opt in self._defaults: - return self._defaults[opt] - else: - raise NoOptionError(option, section) - elif opt in self._sections[section]: - return self._sections[section][opt] - elif opt in self._defaults: - return self._defaults[opt] - else: - raise NoOptionError(option, section) - - def items(self, section): - try: - d2 = self._sections[section] - except KeyError: - if section != DEFAULTSECT: - raise NoSectionError(section) - d2 = self._dict() - d = self._defaults.copy() - d.update(d2) - if "__name__" in d: - del d["__name__"] - return d.items() - - def _get(self, section, conv, option): - return conv(self.get(section, option)) - - def getint(self, section, option): - return self._get(section, int, option) - - def getfloat(self, section, option): - return self._get(section, float, option) - - _boolean_states = {'1': True, 'yes': True, 'true': True, 'on': True, - '0': False, 'no': False, 'false': False, 'off': False} - - def getboolean(self, section, option): - v = self.get(section, option) - if v.lower() not in self._boolean_states: - raise ValueError, 'Not a boolean: %s' % v - return self._boolean_states[v.lower()] - - def optionxform(self, optionstr): - return optionstr.lower() - - def has_option(self, section, option): - """Check for the existence of a given option in a given section.""" - if not section or section == DEFAULTSECT: - option = self.optionxform(option) - return option in self._defaults - elif section not in self._sections: - return False - else: - option = self.optionxform(option) - return (option in self._sections[section] - or option in self._defaults) - - def set(self, section, option, value=None): - """Set an option.""" - if not section or section == DEFAULTSECT: - sectdict = self._defaults - else: - try: - sectdict = self._sections[section] - except KeyError: - raise NoSectionError(section) - sectdict[self.optionxform(option)] = value - - def write(self, fp): - """Write an .ini-format representation of the configuration state.""" - if self._defaults: - fp.write("[%s]\n" % DEFAULTSECT) - for (key, value) in self._defaults.items(): - fp.write("%s = %s\n" % (key, str(value).replace('\n', '\n\t'))) - fp.write("\n") - for section in self._sections: - fp.write("[%s]\n" % section) - for (key, value) in self._sections[section].items(): - if key == "__name__": - continue - if (value is not None) or (self._optcre == self.OPTCRE): - key = " = ".join((key, str(value).replace('\n', '\n\t'))) - fp.write("%s\n" % (key)) - fp.write("\n") - - def remove_option(self, section, option): - """Remove an option.""" - if not section or section == DEFAULTSECT: - sectdict = self._defaults - else: - try: - sectdict = self._sections[section] - except KeyError: - raise NoSectionError(section) - option = self.optionxform(option) - existed = option in sectdict - if existed: - del sectdict[option] - return existed - - def remove_section(self, section): - """Remove a file section.""" - existed = section in self._sections - if existed: - del self._sections[section] - return existed - - # - # Regular expressions for parsing section headers and options. - # - SECTCRE = re.compile( - r'\[' # [ - r'(?P

[^]]+)' # very permissive! - r'\]' # ] - ) - OPTCRE = re.compile( - r'(?P