rem
stringlengths
1
322k
add
stringlengths
0
2.05M
context
stringlengths
4
228k
meta
stringlengths
156
215
def GetCargo(self,i): print "GetCargo" return Cargo()
def GetCargo(self,i): print "GetCargo" return Cargo()
04770d080dcbaf2f25f8a37ca2fa40c41b242413 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/04770d080dcbaf2f25f8a37ca2fa40c41b242413/VS.py
return 0;
return 0
def getSignificantDistance(a=None,b=None,c=None,d=None,e=None,f=None,g=None,h=None,i=None,j=None): print "getSignificantDistance" return 0;
04770d080dcbaf2f25f8a37ca2fa40c41b242413 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/04770d080dcbaf2f25f8a37ca2fa40c41b242413/VS.py
return -1;
return -1 def hasCargo(a=None,b=None,c=None,d=None,e=None,f=None,g=None,h=None,i=None,j=None): print "hasCargo" return 0 def GetCargo(a=None,b=None,c=None,d=None,e=None,f=None,g=None,h=None,i=None,j=None): print "GetCargo" return Cargo("","",1,1,1,1)
def isPlayerStarship(a=None,b=None,c=None,d=None,e=None,f=None,g=None,h=None,i=None,j=None): print "isPlayerStarship" return -1;
04770d080dcbaf2f25f8a37ca2fa40c41b242413 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/04770d080dcbaf2f25f8a37ca2fa40c41b242413/VS.py
Director.pushSaveSting(plr, "mission_names", name)
Director.pushSaveString(plr, "mission_names", name)
def writemissionname(name,path): if len(path)<=1: name+=" - In System" Director.pushSaveSting(plr, "mission_names", name)
8796967c2148278d17a07bc38fa32aa9f2a9de2d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/8796967c2148278d17a07bc38fa32aa9f2a9de2d/dynamic_mission.py
Director.pushSaveSting(plr, "mission_descriptions", name)
Director.pushSaveString(plr, "mission_descriptions", name)
def writedescription(name): Director.pushSaveSting(plr, "mission_descriptions", name)
8796967c2148278d17a07bc38fa32aa9f2a9de2d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/8796967c2148278d17a07bc38fa32aa9f2a9de2d/dynamic_mission.py
Director.pushSaveSting(plr, "mission_scripts", name)
Director.pushSaveString(plr, "mission_scripts", name)
def writemissionsavegame (name): Director.pushSaveSting(plr, "mission_scripts", name)
8796967c2148278d17a07bc38fa32aa9f2a9de2d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/8796967c2148278d17a07bc38fa32aa9f2a9de2d/dynamic_mission.py
fac=faction_ships.intToFaction(fac) enemies = list(faction_ships.enemies[fac])
facnum=faction_ships.factionToInt(fac) enemies = list(faction_ships.enemies[facnum])
def contractMissionsFor(fac,minsysaway,maxsysaway): fac=faction_ships.intToFaction(fac) enemies = list(faction_ships.enemies[fac]) script='' cursystem = VS.getSystemFile() thisfaction = VS.GetGalaxyFaction (cursystem) preferredfaction=None if (VS.GetRelation (fac,thisfaction)>0): preferredfaction=thisfaction#try to sta...
8796967c2148278d17a07bc38fa32aa9f2a9de2d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/8796967c2148278d17a07bc38fa32aa9f2a9de2d/dynamic_mission.py
l = dynamic_battle.persystemattacklist
l = dynamic_battle.persystemattacklist[j]
def contractMissionsFor(fac,minsysaway,maxsysaway): fac=faction_ships.intToFaction(fac) enemies = list(faction_ships.enemies[fac]) script='' cursystem = VS.getSystemFile() thisfaction = VS.GetGalaxyFaction (cursystem) preferredfaction=None if (VS.GetRelation (fac,thisfaction)>0): preferredfaction=thisfaction#try to sta...
8796967c2148278d17a07bc38fa32aa9f2a9de2d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/8796967c2148278d17a07bc38fa32aa9f2a9de2d/dynamic_mission.py
if (VS.GetRelation(fac,l[1][1])>0): generateDefendMission(j,l[1][0],l[1][1],l[0][0],l[0][1])
if (VS.GetRelation(fac,k[1][1])>0): generateDefendMission(j,k[1][0],k[1][1],k[0][0],k[0][1])
def contractMissionsFor(fac,minsysaway,maxsysaway): fac=faction_ships.intToFaction(fac) enemies = list(faction_ships.enemies[fac]) script='' cursystem = VS.getSystemFile() thisfaction = VS.GetGalaxyFaction (cursystem) preferredfaction=None if (VS.GetRelation (fac,thisfaction)>0): preferredfaction=thisfaction#try to sta...
8796967c2148278d17a07bc38fa32aa9f2a9de2d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/8796967c2148278d17a07bc38fa32aa9f2a9de2d/dynamic_mission.py
generatePatrolMission(maxsysaway, minsysaway,vsrandom.randrange(4,10))
generatePatrolMission(j,vsrandom.randrange(4,10))
def contractMissionsFor(fac,minsysaway,maxsysaway): fac=faction_ships.intToFaction(fac) enemies = list(faction_ships.enemies[fac]) script='' cursystem = VS.getSystemFile() thisfaction = VS.GetGalaxyFaction (cursystem) preferredfaction=None if (VS.GetRelation (fac,thisfaction)>0): preferredfaction=thisfaction#try to sta...
8796967c2148278d17a07bc38fa32aa9f2a9de2d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/8796967c2148278d17a07bc38fa32aa9f2a9de2d/dynamic_mission.py
generateCargoMission(path,true)
generateCargoMission(j,'',basefac)
def contractMissionsFor(fac,minsysaway,maxsysaway): fac=faction_ships.intToFaction(fac) enemies = list(faction_ships.enemies[fac]) script='' cursystem = VS.getSystemFile() thisfaction = VS.GetGalaxyFaction (cursystem) preferredfaction=None if (VS.GetRelation (fac,thisfaction)>0): preferredfaction=thisfaction#try to sta...
8796967c2148278d17a07bc38fa32aa9f2a9de2d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/8796967c2148278d17a07bc38fa32aa9f2a9de2d/dynamic_mission.py
generateCargoMission(path,false)
generateCargoMission(j,'Contraband',basefac)
def contractMissionsFor(fac,minsysaway,maxsysaway): fac=faction_ships.intToFaction(fac) enemies = list(faction_ships.enemies[fac]) script='' cursystem = VS.getSystemFile() thisfaction = VS.GetGalaxyFaction (cursystem) preferredfaction=None if (VS.GetRelation (fac,thisfaction)>0): preferredfaction=thisfaction#try to sta...
8796967c2148278d17a07bc38fa32aa9f2a9de2d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/8796967c2148278d17a07bc38fa32aa9f2a9de2d/dynamic_mission.py
generatePatrolMission(path,1) def CreateMissions(minsys=1,maxsys=4):
generatePatrolMission(j,1) def CreateMissions(minsys=0,maxsys=4):
def contractMissionsFor(fac,minsysaway,maxsysaway): fac=faction_ships.intToFaction(fac) enemies = list(faction_ships.enemies[fac]) script='' cursystem = VS.getSystemFile() thisfaction = VS.GetGalaxyFaction (cursystem) preferredfaction=None if (VS.GetRelation (fac,thisfaction)>0): preferredfaction=thisfaction#try to sta...
8796967c2148278d17a07bc38fa32aa9f2a9de2d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/8796967c2148278d17a07bc38fa32aa9f2a9de2d/dynamic_mission.py
def LookForTrouble(faction,sys): fg = FGsInSystem(faction,sys) for i in faction_ships.enemies[faction_ships.factionToInt(faction)]: efg = AllFGsInSystem(i,sys) if (len(efg)): if vsrandom.randrange(0,3)==0: initiateAttack(fg,faction,efg,i)
def BattlesInSystem(): if sys in persystemattacklist: return persystemattacklist[sys] #return {} #used to be a hash table return []
6b53e02d45f5dcdb419ec5a736aa108b3a115f54 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/6b53e02d45f5dcdb419ec5a736aa108b3a115f54/dynamic_battle.py
,"dockedat" : getDockFaction(system)
def makeDynamicNews (type_event,stage_event,aggressor,defender,success ,scale_event,system,keyword):
5ff1aa41f77bfec6038df8a00568aa95dab717ce /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/5ff1aa41f77bfec6038df8a00568aa95dab717ce/dynamic_news.py
return formatNewsItem (getNewsItem(getDockFaction(),type_event,stage_event,getSuccessStr(success) ,getPOV(getDockFaction(),defender,aggressor,getSuccessStr(success))
return formatNewsItem (getNewsItem(getDockFaction(system),type_event,stage_event,getSuccessStr(success) ,getPOV(getDockFaction(system),defender,aggressor,getSuccessStr(success))
def makeDynamicNews (type_event,stage_event,aggressor,defender,success ,scale_event,system,keyword):
5ff1aa41f77bfec6038df8a00568aa95dab717ce /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/5ff1aa41f77bfec6038df8a00568aa95dab717ce/dynamic_news.py
return 0.15
return 0.25
def povCutOff():
5ff1aa41f77bfec6038df8a00568aa95dab717ce /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/5ff1aa41f77bfec6038df8a00568aa95dab717ce/dynamic_news.py
def getDockFaction():
def getDockFaction(system):
def getDockFaction():
5ff1aa41f77bfec6038df8a00568aa95dab717ce /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/5ff1aa41f77bfec6038df8a00568aa95dab717ce/dynamic_news.py
global allUsefullVariables return VS.GetGalaxyFaction(allUsefullVariables["system"]) else:
print "Returning the systems faction" return VS.GetGalaxyFaction(system) else: print "Returning" + un.getFactionName() + "as units faction"
def getDockFaction():
5ff1aa41f77bfec6038df8a00568aa95dab717ce /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/5ff1aa41f77bfec6038df8a00568aa95dab717ce/dynamic_news.py
VS.IOmessage (0,"defend",self.mplay,"Greetings, %s. You must patrol a system for us :" % name)
VS.IOmessage (0,"patrol",self.mplay,"Greetings, %s. You must patrol a system for us :" % name)
def __init__ (self,numsystemsaway, num_significants_to_patrol, distance_from_base, creds, jumps=(), donevar=''): Director.Mission.__init__(self) self.donevar=donevar self.jnum=0 self.cred=creds
ed65c7564ad141d0dceb521c8d22e84901b0dbda /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/ed65c7564ad141d0dceb521c8d22e84901b0dbda/patrol.py
distInOneSec = Dot (parent.GetVelocity(),posdiff) if (distInOneSec>un.getDistance(parent)): print "%s too close to %s\n" % (parent.getName(),un.getName())
distInOneSec = Dot (Sub(parent.GetVelocity(),un.GetVelocity()),posdiff) if (distInOneSec>un.getDistance(parent) and Dot (posdiff,un.GetOrientation()[2])>0): print "%s too close to %s \n" % (parent.getName(),un.getName()) print distInOneSec print un.getDistance (parent)
def Execute(self): VS.PythonAI.Execute(self)
c206fa5dd85bd5834280b98b3a4795121edd8017 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/c206fa5dd85bd5834280b98b3a4795121edd8017/traffic.py
station_pos=station_unit.getPosition()
station_pos=station_unit.Position()
def launch_around_station(station_name,fgname,faction,type,ai,nr_ships,nr_waves,logo=''): station_unit=unit.getUnitByFgID(station_name) if(station_unit.isNull()): sys.stderr.write("launch.py:launch_around_station did not find unit %s\n" % (station_name)) return VS.Unit() station_pos=station_unit.getPosition() rsize=sta...
1fc5c5bd1cbfec786cf3585a8f6cb9579788cb37 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/1fc5c5bd1cbfec786cf3585a8f6cb9579788cb37/launch.py
myvec=my_unit.Position()
myvec=my_unit.LocalPosition()
def launch_wave_around_unit (fgname, faction, type, ai, nr_ships, minradius, maxradius, my_unit,logo=''): myvec = (0,0,0) if (my_unit.isNull()): un=launch_wave_around_area (fgname,faction,type,ai,nr_ships,minradius,maxradius,myvec,logo) return un myvec=my_unit.Position() print myvec rsiz=my_unit.rSize() un=launch_wave_...
1fc5c5bd1cbfec786cf3585a8f6cb9579788cb37 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/1fc5c5bd1cbfec786cf3585a8f6cb9579788cb37/launch.py
if (not self.un):
dead=not self.un if (not dead): dead = self.un.GetHull()<=0 if (dead):
def Check(self): import fg_util if (not self.un): if (VS.systemInMemory (self.starsystem)): fg_util.RemoveShipFromFG(self.fgname,self.faction,self.type) else: fg_util.LandShip(self.fgname,self.faction,self.type) return 0 else: sys=self.un.getUnitSystemFile() if (len(sys)): self.starsystem=sys return 1
bbf72dfd60afa4149a6b6ab9a6dd431590706214 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/bbf72dfd60afa4149a6b6ab9a6dd431590706214/dynamic_universe.py
if (self.you):
if (not self.you.isNull()):
def __init__ (self,factionname, numsystemsaway, cargoquantity, missiondifficulty, creds, launchoncapship, time_to_complete, category): Director.Mission.__init__(self); self.you=VS.Unit() self.base=VS.Unit() self.arrived=0 self.mplay="all"
e43bc7b4090a4ef2b019522e6ba0cf27c14d32b5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/e43bc7b4090a4ef2b019522e6ba0cf27c14d32b5/cargo_mission.py
AI.PythonAI.Execute(self);
def Execute(self):
74909da2e54c4b0b5a4c441af9df4f4205c23662 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/74909da2e54c4b0b5a4c441af9df4f4205c23662/printhello.py
hi1.IncRef()
def Execute(self):
74909da2e54c4b0b5a4c441af9df4f4205c23662 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/74909da2e54c4b0b5a4c441af9df4f4205c23662/printhello.py
un.SetFgDirective ('b')
un.setFgDirective ('b')
def StopTargettingEachOther (fgname,faction,enfgname,enfaction): i=VS.getUnitList() un=i.current() while (un): if ((un.getFactionName()==enfaction and un.getFlightgroupName()==enfgname) or (un.getFactionName()==faction and un.getFlightgroupName()==fgname)): un.SetFgDirective ('b') #check to see that its' in this flight...
80ad7e964fd997cf3aa9a88ae2c7d70b3ea63743 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/80ad7e964fd997cf3aa9a88ae2c7d70b3ea63743/dynamic_battle.py
self.lasttime=0.0
self.lasttime=-1000
def __init__(self): print "init1INITNITNITNTINTINTINTINTITNINTINTINTINTINT\nININTINTINTITNITNITNTINTINTINTINTITNITNITNITNITNITNITNITNITNIT" VS.SetDifficulty(.9) Director.Mission.__init__(self) self.lasttime=0.0 self.waittime=10.0 print "init"
51d0cc42b3afc8db952b1e989680bf85a0ddb40a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/51d0cc42b3afc8db952b1e989680bf85a0ddb40a/total_war.py
print "init"
def __init__(self): print "init1INITNITNITNTINTINTINTINTITNINTINTINTINTINT\nININTINTINTITNITNITNTINTINTINTINTITNITNITNITNITNITNITNITNITNIT" VS.SetDifficulty(.9) Director.Mission.__init__(self) self.lasttime=0.0 self.waittime=10.0 print "init"
51d0cc42b3afc8db952b1e989680bf85a0ddb40a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/51d0cc42b3afc8db952b1e989680bf85a0ddb40a/total_war.py
print "testing"
def launch_new_wave(self): print "testing" side = vsrandom.randrange(0,2) faction="confed" ai = vsrandom.randrange(0,2) if (ai==0): ai = "printhello.py" else: ai = "default" if (side==0): faction=faction_ships.get_enemy_of("confed") else: faction=faction_ships.get_friend_of("confed") launched = launch.launch_wave_aroun...
51d0cc42b3afc8db952b1e989680bf85a0ddb40a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/51d0cc42b3afc8db952b1e989680bf85a0ddb40a/total_war.py
launched = launch.launch_wave_around_unit ("Shadow",faction,faction_ships.getRandomFighter(faction),ai,vsrandom.randrange(1,10),2000.0,4000.0,VS.getPlayer(),'')
launched = launch.launch_wave_around_unit ("Shadow",faction,faction_ships.getRandomFighter(faction),ai,vsrandom.randrange(1,10),100.0,2000.0,VS.getPlayer(),'') if (vsrandom.randrange(0,10)==0): launch.launch_wave_around_unit ("ShadowCap",faction,faction_ships.getRandomCapitol(faction),ai,1,2000.0,4000.0,VS.getPlayer(),...
def launch_new_wave(self): print "testing" side = vsrandom.randrange(0,2) faction="confed" ai = vsrandom.randrange(0,2) if (ai==0): ai = "printhello.py" else: ai = "default" if (side==0): faction=faction_ships.get_enemy_of("confed") else: faction=faction_ships.get_friend_of("confed") launched = launch.launch_wave_aroun...
51d0cc42b3afc8db952b1e989680bf85a0ddb40a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/51d0cc42b3afc8db952b1e989680bf85a0ddb40a/total_war.py
print "ex"
def Execute (self): print "ex" time = VS.GetGameTime() if (time-self.lasttime>self.waittime): self.launch_new_wave() self.waittime=vsrandom.randrange(10.0,30.0) self.lasttime=time
51d0cc42b3afc8db952b1e989680bf85a0ddb40a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/51d0cc42b3afc8db952b1e989680bf85a0ddb40a/total_war.py
def drawobjs(self,room,x,y,wid,hei): Base.Texture(room,self.name,self.image,x+(wid/2),y+(hei/2)) Base.Python(room,self.name,x,y,wid,hei,self.text,self.choices,True)
4ac7a17d8268cd346bebf2029ebd9fdd1b581174 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/4ac7a17d8268cd346bebf2029ebd9fdd1b581174/fixers.py
Fixer ("rowenna","Speak with Rowenna",[("decided_iso_evil",0)],"bases/fixers/iso.spr","bases/fixers/iso.py"),
Fixer ("rowenna","Speak with Rowenna",[("decided_iso_evil",0),("iso_mission2",0)],"bases/fixers/iso.spr","bases/fixers/iso.py"),
def drawobjs(self,room,x,y,wid,hei): Base.Texture(room,self.name,self.image,x+(wid/2),y+(hei/2)) Base.Python(room,self.name,x,y,wid,hei,self.text,self.choices,True)
4ac7a17d8268cd346bebf2029ebd9fdd1b581174 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/4ac7a17d8268cd346bebf2029ebd9fdd1b581174/fixers.py
addstr += '\nAlso-- we have information that the target may be informed about your attack and may be ready to run. Be quick!'
addstr += '
def generateBountyMission (path,fg,fac): typ = fg_util.RandomShipIn(fg,fac) cap = faction_ships.isCapital(typ) diff=vsrandom.randrange(0,6) runaway=(vsrandom.random()>=.75) creds=1000+2000*runaway+500*diff+syscreds*len(path) if (cap): creds*=40 finalprice=creds+syscreds*len(path) addstr="" isFixer=vsrandom.random()<fix...
38b2511c7025f669531f70ca48dbc750bd14f5f9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/38b2511c7025f669531f70ca48dbc750bd14f5f9/dynamic_mission.py
Fixer ("rowenna","Speak with Rowenna",[("decided_iso_evil",0),("iso_mission2",-1)],"bases/fixers/iso.spr","bases/fixers/iso.py"), Fixer ("cloaked_man","Speak with hooded figure",[("decided_iso_good",0)],"bases/fixers/cloak.spr","bases/fixers/iso_antagonist.py")
Fixer ("rowenna","Speak with Rowenna",[("decided_iso_evil",0),("iso_mission2",-1)],"bases/fixers/iso.spr","bases/fixers/iso.py")
def drawobjs(self,room,x,y,wid,hei): Base.Texture(room,self.name,self.image,x+(wid/2),y+(hei/2)) Base.Python(room,self.name,x,y,wid,hei,self.text,self.choices,True)
30bf72afc0bd7682bb6f3c70185c44d179aeddbe /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/30bf72afc0bd7682bb6f3c70185c44d179aeddbe/fixers.py
Fixer ("rowenna","Speak with Rowenna",[("decided_iso_evil",0),("iso_mission3",0),("iso_mission2",-1)],"bases/fixers/iso.spr","bases/fixers/iso.py")
Fixer ("rowenna","Speak with Rowenna",[("decided_iso_evil",0),("iso_mission3",0),("iso_mission2",-1)],"bases/fixers/iso.spr","bases/fixers/iso.py"), Fixer ("cloaked_man","Speak with hooded figure",[("decided_iso_good",0),("iso_evil2",1)],"bases/fixers/cloak.spr","bases/fixers/iso_antagonist.py")
def drawobjs(self,room,x,y,wid,hei): Base.Texture(room,self.name,self.image,x+(wid/2),y+(hei/2)) Base.Python(room,self.name,x,y,wid,hei,self.text,self.choices,True)
30bf72afc0bd7682bb6f3c70185c44d179aeddbe /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/30bf72afc0bd7682bb6f3c70185c44d179aeddbe/fixers.py
def __init__ (self,price,factionname,numships):
def __init__ (self,price,factionname,numships,difficulty):
def __init__ (self,price,factionname,numships): Director.Mission.__init__(self) self.price=price self.faction=factionname self.you = VS.getPlayer() self.numships=numships self.adjsys=go_somewhere_significant (self.you,0,5000,0) self.wingship = faction_ships.getRandomFighter(factionname) nam = "[%s]" % self.wingship sel...
d36c672cf3cf35b84436e75033f9a270e75a4fb2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/d36c672cf3cf35b84436e75033f9a270e75a4fb2/wingman.py
lead.SetTarget(self.you) VS.IOmessage (0,"game","all","[%s] You don't have the agreed money... prepare to DIE")
if (self.diff>0): lead.SetTarget(self.you) VS.IOmessage (0,"game","all","[%s] You don't have the agreed money... prepare to DIE!"%lead.getName()) else: VS.IOmessage (0,"game","all","[%s] You don't have the money. A fool like you won't last long!"%lead.getName())
def GenerateWingmen(self): if (self.you): if (self.you.getCredits()>=self.price): self.you.addCredits(-self.price) lead=launch.launch_wave_around_unit(self.you.getFlightgroupName(), self.you.getFactionName(), self.wingship, "default", self.numships, 500, 1000, self.you) VS.IOmessage (0,"wingman","all","[%s] I am at you...
d36c672cf3cf35b84436e75033f9a270e75a4fb2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/d36c672cf3cf35b84436e75033f9a270e75a4fb2/wingman.py
,"middle" :{"success": {"good" : [(0.3,"all","Blockade in VAR_system_system System:\\VAR_aggressor_posessive media reports that the blockade which began recently in the VAR_system_system system is still continuing. According to <VAR_aggressor_posessive>'s reporters, their military has sustained only modest losses, whi...
,"middle" :{"success": {"good" : [(0.3,"all","Blockade in VAR_system_system System:\\VAR_aggressor_possessive media reports that the blockade which began recently in the VAR_system_system system is still continuing. According to <VAR_aggressor_possessive>'s reporters, their military has sustained only modest losses, w...
def allNews():
368af9f6002de57f183d90ff01f20502911d99a9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/368af9f6002de57f183d90ff01f20502911d99a9/dynamic_news_content.py
,"loss" : {"good" : [(0.3,"all","VAR_system_system Assult Crushed!\\The first assaults of the VAR_aggressor_posessive attackers on the blockade which began recently in the VAR_system_system system have been successfully stopped. Waves of <VAR_aggressor_posessive>'s fighters have been destroyed and their burning wrec...
,"loss" : {"good" : [(0.3,"all","VAR_system_system Assult Crushed!\\The first assaults of the VAR_aggressor_possessive attackers on the blockade which began recently in the VAR_system_system system have been successfully stopped. Waves of <VAR_aggressor_possessive>'s fighters have been destroyed and their burning wr...
def allNews():
368af9f6002de57f183d90ff01f20502911d99a9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/368af9f6002de57f183d90ff01f20502911d99a9/dynamic_news_content.py
if (not un):
import fg_util if (not self.un):
def Check(self): if (not un): if (VS.systemInMemory (self.starsystem)): RemoveShipFromFG(self.fgname,self.faction,self.type) else: LandShip(self.fgname,self.faction,self.type) return 0 else: sys=un.getUnitSystemFile() if (len(sys)): self.starsystem=sys return 1
2b8ac2768617ec950a19775c247773019610a3c4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/2b8ac2768617ec950a19775c247773019610a3c4/dynamic_universe.py
RemoveShipFromFG(self.fgname,self.faction,self.type)
fg_util.RemoveShipFromFG(self.fgname,self.faction,self.type)
def Check(self): if (not un): if (VS.systemInMemory (self.starsystem)): RemoveShipFromFG(self.fgname,self.faction,self.type) else: LandShip(self.fgname,self.faction,self.type) return 0 else: sys=un.getUnitSystemFile() if (len(sys)): self.starsystem=sys return 1
2b8ac2768617ec950a19775c247773019610a3c4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/2b8ac2768617ec950a19775c247773019610a3c4/dynamic_universe.py
LandShip(self.fgname,self.faction,self.type)
fg_util.LandShip(self.fgname,self.faction,self.type)
def Check(self): if (not un): if (VS.systemInMemory (self.starsystem)): RemoveShipFromFG(self.fgname,self.faction,self.type) else: LandShip(self.fgname,self.faction,self.type) return 0 else: sys=un.getUnitSystemFile() if (len(sys)): self.starsystem=sys return 1
2b8ac2768617ec950a19775c247773019610a3c4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/2b8ac2768617ec950a19775c247773019610a3c4/dynamic_universe.py
sys=un.getUnitSystemFile()
sys=self.un.getUnitSystemFile()
def Check(self): if (not un): if (VS.systemInMemory (self.starsystem)): RemoveShipFromFG(self.fgname,self.faction,self.type) else: LandShip(self.fgname,self.faction,self.type) return 0 else: sys=un.getUnitSystemFile() if (len(sys)): self.starsystem=sys return 1
2b8ac2768617ec950a19775c247773019610a3c4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/2b8ac2768617ec950a19775c247773019610a3c4/dynamic_universe.py
rc=referenceCount_get(roid, 0)
rc=referenceCount_get(roid, 0) - 1
def _takeOutGarbage(self, oid): # take out the garbage. referenceCount=self._referenceCount referenceCount_get=referenceCount.get
41391ce38632d9ac606ad9ba8c9f192ca4caa8a6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9663/41391ce38632d9ac606ad9ba8c9f192ca4caa8a6/TemporaryStorage.py
referenceCount[roid] = rc - 1
referenceCount[roid] = rc
def _takeOutGarbage(self, oid): # take out the garbage. referenceCount=self._referenceCount referenceCount_get=referenceCount.get
41391ce38632d9ac606ad9ba8c9f192ca4caa8a6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9663/41391ce38632d9ac606ad9ba8c9f192ca4caa8a6/TemporaryStorage.py
s=self._index[oid] p=self._opickle[oid] return p, s finally: self._lock_release() def loadEx(self, oid, version): p, s = self.load(oid, version) return p, s, s
try: s=self._index[oid] p=self._opickle[oid] return p, s except KeyError: if oid in self._recently_gc_oids: raise POSException.ConflictError(oid=oid) else: raise finally: self._lock_release()
def load(self, oid, version): self._lock_acquire() try: s=self._index[oid] p=self._opickle[oid] return p, s # pickle, serial finally: self._lock_release()
33ced447062612703186f787c8e834a28792b067 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9663/33ced447062612703186f787c8e834a28792b067/TemporaryStorage.py
rdata = self.tryToResolveConflict(oid, oserial, serial, data) if rdata is None: raise POSException.ConflictError( oid=oid, serials=(oserial, serial), data=data) else: data = rdata
data=self.tryToResolveConflict(oid, oserial, serial, data) if not data: raise POSException.ConflictError(oid=oid, serials=(oserial, serial))
def store(self, oid, serial, data, version, transaction): if transaction is not self._transaction: raise POSException.StorageTransactionError(self, transaction) if version: # we allow a version to be in use although we don't # support versions in the storage. LOG('TemporaryStorage', BLATHER, ('versions in use with Temp...
33ced447062612703186f787c8e834a28792b067 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9663/33ced447062612703186f787c8e834a28792b067/TemporaryStorage.py
newserial=self._tid
newserial=self._serial
def store(self, oid, serial, data, version, transaction): if transaction is not self._transaction: raise POSException.StorageTransactionError(self, transaction) if version: # we allow a version to be in use although we don't # support versions in the storage. LOG('TemporaryStorage', BLATHER, ('versions in use with Temp...
33ced447062612703186f787c8e834a28792b067 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9663/33ced447062612703186f787c8e834a28792b067/TemporaryStorage.py
serial=self._tid
serial=self._serial
def _finish(self, tid, u, d, e): zeros={} referenceCount=self._referenceCount referenceCount_get=referenceCount.get oreferences=self._oreferences serial=self._tid index=self._index opickle=self._opickle
33ced447062612703186f787c8e834a28792b067 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9663/33ced447062612703186f787c8e834a28792b067/TemporaryStorage.py
class DownloadInfoFrame(wxFrame):
class DownloadInfoFrame:
def __init__(self, errormsg): wxPyEvent.__init__(self) self.SetEventType(wxEVT_ERROR_STATUS) self.errormsg = errormsg
430aa782d5a96eea7ba9a579f334d6b2c77bbde2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4538/430aa782d5a96eea7ba9a579f334d6b2c77bbde2/btdownloadgui.py
wxFrame.__init__(self, None, -1, 'BitTorrent download', size = wxSize(550, 260))
frame = wxFrame(None, -1, 'BitTorrent download', size = wxSize(550, 300)) self.frame = frame
def __init__(self, flag): wxFrame.__init__(self, None, -1, 'BitTorrent download', size = wxSize(550, 260)) self.flag = flag self.fin = false self.shown = false self.drawGUI()
430aa782d5a96eea7ba9a579f334d6b2c77bbde2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4538/430aa782d5a96eea7ba9a579f334d6b2c77bbde2/btdownloadgui.py
self.drawGUI() EVT_CLOSE(self, self.done) EVT_BUTTON(self, self.cancelButton.GetId(), self.done) EVT_CHOOSE_FILE(self, self.onChooseFile) EVT_UPDATE_STATUS(self, self.onUpdateStatus) EVT_FINISH_STATUS(self, self.onFinishEvent) EVT_FAIL_STATUS(self, self.onFailEvent) EVT_ERROR_STATUS(self, self.onErrorEvent) def drawG...
panel = wxPanel(frame, -1) colSizer = wxFlexGridSizer(cols = 1, vgap = 7) colSizer.Add(wxStaticText(panel, -1, 'Saving:'), 0, wxEXPAND)
def __init__(self, flag): wxFrame.__init__(self, None, -1, 'BitTorrent download', size = wxSize(550, 260)) self.flag = flag self.fin = false self.shown = false self.drawGUI()
430aa782d5a96eea7ba9a579f334d6b2c77bbde2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4538/430aa782d5a96eea7ba9a579f334d6b2c77bbde2/btdownloadgui.py
colSizer.Add(self.fileNameText, 0, wxEXPAND, 4) self.gauge = wxGauge(panel, -1, range = 1000) self.gauge.SetBezelFace(5) self.gauge.SetShadowWidth(5) colSizer.Add(self.gauge, 0, wxEXPAND, 7)
colSizer.Add(self.fileNameText, 0, wxEXPAND) self.gauge = wxGauge(panel, -1, range = 1000, style = wxGA_SMOOTH) colSizer.Add(self.gauge, 0, wxEXPAND)
def drawGUI(self): panel = wxPanel(self, -1) colSizer = wxBoxSizer(wxVERTICAL)
430aa782d5a96eea7ba9a579f334d6b2c77bbde2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4538/430aa782d5a96eea7ba9a579f334d6b2c77bbde2/btdownloadgui.py
colSizer.Add(gridSizer, 0, wxEXPAND, 7)
colSizer.Add(gridSizer, 0, wxEXPAND) colSizer.Add(1, 1, 1, wxEXPAND)
def drawGUI(self): panel = wxPanel(self, -1) colSizer = wxBoxSizer(wxVERTICAL)
430aa782d5a96eea7ba9a579f334d6b2c77bbde2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4538/430aa782d5a96eea7ba9a579f334d6b2c77bbde2/btdownloadgui.py
colSizer.Add(self.cancelButton, 0, wxALIGN_RIGHT, 5) colSizer.Add(wxStaticText(panel, -1, ''), 1, wxEXPAND)
colSizer.Add(self.cancelButton, 0, wxALIGN_CENTER) colSizer.AddGrowableCol(0) colSizer.AddGrowableRow(4)
def drawGUI(self): panel = wxPanel(self, -1) colSizer = wxBoxSizer(wxVERTICAL)
430aa782d5a96eea7ba9a579f334d6b2c77bbde2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4538/430aa782d5a96eea7ba9a579f334d6b2c77bbde2/btdownloadgui.py
border.Add(colSizer, 1, wxALL, 25)
border.Add(colSizer, 1, wxEXPAND | wxALL, 25)
def drawGUI(self): panel = wxPanel(self, -1) colSizer = wxBoxSizer(wxVERTICAL)
430aa782d5a96eea7ba9a579f334d6b2c77bbde2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4538/430aa782d5a96eea7ba9a579f334d6b2c77bbde2/btdownloadgui.py
wxPostEvent(self, UpdateStatusEvent(fractionDone, timeEst, downRate, upRate, activity))
wxPostEvent(self.frame, UpdateStatusEvent(fractionDone, timeEst, downRate, upRate, activity))
def updateStatus(self, fractionDone = None, timeEst = None, downRate = None, upRate = None, activity=None): if self.flag.isSet(): return wxPostEvent(self, UpdateStatusEvent(fractionDone, timeEst, downRate, upRate, activity))
430aa782d5a96eea7ba9a579f334d6b2c77bbde2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4538/430aa782d5a96eea7ba9a579f334d6b2c77bbde2/btdownloadgui.py
wxPostEvent(self, FinishEvent())
wxPostEvent(self.frame, FinishEvent())
def finished(self): if self.flag.isSet(): return self.fin = true wxPostEvent(self, FinishEvent())
430aa782d5a96eea7ba9a579f334d6b2c77bbde2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4538/430aa782d5a96eea7ba9a579f334d6b2c77bbde2/btdownloadgui.py
wxPostEvent(self, FailEvent())
wxPostEvent(self.frame, FailEvent())
def failed(self): if self.flag.isSet(): return self.fin = true wxPostEvent(self, FailEvent())
430aa782d5a96eea7ba9a579f334d6b2c77bbde2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4538/430aa782d5a96eea7ba9a579f334d6b2c77bbde2/btdownloadgui.py
wxPostEvent(self, ErrorEvent(errormsg))
wxPostEvent(self.frame, ErrorEvent(errormsg))
def error(self, errormsg): if self.flag.isSet(): return wxPostEvent(self, ErrorEvent(errormsg))
430aa782d5a96eea7ba9a579f334d6b2c77bbde2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4538/430aa782d5a96eea7ba9a579f334d6b2c77bbde2/btdownloadgui.py
self.Show(true) dlg = wxMessageDialog(self, message = event.errormsg,
self.frame.Show(true) dlg = wxMessageDialog(self.frame, message = event.errormsg,
def onErrorEvent(self, event): if self.flag.isSet(): return if not self.shown: self.Show(true) dlg = wxMessageDialog(self, message = event.errormsg, caption = 'Download Error', style = wxOK | wxICON_ERROR) dlg.Fit() dlg.Center() dlg.Show(true)
430aa782d5a96eea7ba9a579f334d6b2c77bbde2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4538/430aa782d5a96eea7ba9a579f334d6b2c77bbde2/btdownloadgui.py
wxPostEvent(self, ChooseFileEvent(default, bucket, f, size, dir))
wxPostEvent(self.frame, ChooseFileEvent(default, bucket, f, size, dir))
def chooseFile(self, default, size, saveas, dir): if self.flag.isSet(): return '' f = Event() bucket = [None] wxPostEvent(self, ChooseFileEvent(default, bucket, f, size, dir)) f.wait() return bucket[0]
430aa782d5a96eea7ba9a579f334d6b2c77bbde2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4538/430aa782d5a96eea7ba9a579f334d6b2c77bbde2/btdownloadgui.py
dl = wxDirDialog(self, 'Choose a directory to save to, pick a partial download to resume', join(getcwd(), event.default))
dl = wxDirDialog(self.frame, 'Choose a directory to save to, pick a partial download to resume', join(getcwd(), event.default), style = wxDD_DEFAULT_STYLE | wxDD_NEW_DIR_BUTTON)
def onChooseFile(self, event): if self.flag.isSet(): return if event.dir: dl = wxDirDialog(self, 'Choose a directory to save to, pick a partial download to resume', join(getcwd(), event.default)) else: dl = wxFileDialog(self, 'Choose file to save as, pick a partial download to resume', '', event.default, '*.*', wxSAVE)...
430aa782d5a96eea7ba9a579f334d6b2c77bbde2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4538/430aa782d5a96eea7ba9a579f334d6b2c77bbde2/btdownloadgui.py
dl = wxFileDialog(self, 'Choose file to save as, pick a partial download to resume', '', event.default, '*.*', wxSAVE)
dl = wxFileDialog(self.frame, 'Choose file to save as, pick a partial download to resume', '', event.default, '*.*', wxSAVE)
def onChooseFile(self, event): if self.flag.isSet(): return if event.dir: dl = wxDirDialog(self, 'Choose a directory to save to, pick a partial download to resume', join(getcwd(), event.default)) else: dl = wxFileDialog(self, 'Choose file to save as, pick a partial download to resume', '', event.default, '*.*', wxSAVE)...
430aa782d5a96eea7ba9a579f334d6b2c77bbde2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4538/430aa782d5a96eea7ba9a579f334d6b2c77bbde2/btdownloadgui.py
self.Show(true)
self.frame.Show(true)
def onChooseFile(self, event): if self.flag.isSet(): return if event.dir: dl = wxDirDialog(self, 'Choose a directory to save to, pick a partial download to resume', join(getcwd(), event.default)) else: dl = wxFileDialog(self, 'Choose file to save as, pick a partial download to resume', '', event.default, '*.*', wxSAVE)...
430aa782d5a96eea7ba9a579f334d6b2c77bbde2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4538/430aa782d5a96eea7ba9a579f334d6b2c77bbde2/btdownloadgui.py
self.Destroy()
self.frame.Destroy()
def done(self, event): self.flag.set() self.Destroy()
430aa782d5a96eea7ba9a579f334d6b2c77bbde2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4538/430aa782d5a96eea7ba9a579f334d6b2c77bbde2/btdownloadgui.py
def __init__(self, x, d): self.d = d
def __init__(self, x, params): self.params = params
def __init__(self, x, d): self.d = d wxApp.__init__(self, x)
430aa782d5a96eea7ba9a579f334d6b2c77bbde2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4538/430aa782d5a96eea7ba9a579f334d6b2c77bbde2/btdownloadgui.py
self.SetTopWindow(self.d)
doneflag = Event() d = DownloadInfoFrame(doneflag) self.SetTopWindow(d.frame) thread = Thread(target = next, args = [self.params, d, doneflag]) thread.setDaemon(false) thread.start()
def OnInit(self): self.SetTopWindow(self.d) return 1
430aa782d5a96eea7ba9a579f334d6b2c77bbde2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4538/430aa782d5a96eea7ba9a579f334d6b2c77bbde2/btdownloadgui.py
doneflag = Event() d = DownloadInfoFrame(doneflag) app = btWxApp(0, d) thread = Thread(target = next, args = [params, d, doneflag]) thread.setDaemon(false) thread.start()
app = btWxApp(0, params)
def run(params): doneflag = Event() d = DownloadInfoFrame(doneflag) app = btWxApp(0, d) thread = Thread(target = next, args = [params, d, doneflag]) thread.setDaemon(false) thread.start() app.MainLoop()
430aa782d5a96eea7ba9a579f334d6b2c77bbde2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4538/430aa782d5a96eea7ba9a579f334d6b2c77bbde2/btdownloadgui.py
print formatDefinitions(configDefinitions, 80)
print formatDefinitions(defaults, 80)
def store_downloads(s = s, d = d): while true: sleep(600) try: s.lock.acquire() h = open(d, 'wb') h.write(bencode(s.downloads)) h.flush() h.close() finally: s.lock.release()
b8bd5cc534f0965636a3115473478fe6c59f5771 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4538/b8bd5cc534f0965636a3115473478fe6c59f5771/bttrack.py
myid = myid + ('-' * (8 - len(myid))) + b2a_hex(sha(repr(time()) + ' ' + str(getpid())).digest()[-8:])
myid = myid + ('-' * (8 - len(myid))) + b2a_hex(sha(repr(time()) + ' ' + str(getpid())).digest()[-6:])
def make(f, forcedir = False): if not forcedir: f = path.split(f)[0] if f != '' and not path.exists(f): makedirs(f)
3a0590afd0503e1081c1c91213c3fb8b523b607d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4538/3a0590afd0503e1081c1c91213c3fb8b523b607d/download.py
t = split(i)[-1] if t not in ignore and t[0] != '.': make_meta_file(i, url, flag = flag, progress = callback, progress_percent=0, piece_len_exp = piece_len_pow2)
make_meta_file(i, url, flag = flag, progress = callback, progress_percent=0, piece_len_exp = piece_len_pow2)
def callback(x, subtotal = subtotal, total = total, vc = vc): subtotal[0] += x vc(float(subtotal[0]) / total)
bc6c0cab9c2f391426ef670b58e685cdb08931cd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4538/bc6c0cab9c2f391426ef670b58e685cdb08931cd/btcompletedir.py
b = becache2
b = self.becache2
def get(self, connection, path, headers): try: (scheme, netloc, path, pars, query, fragment) = urlparse(path) if self.uq_broken == 1: path = path.replace('+',' ') query = query.replace('+',' ') path = unquote(path)[1:] params = {} for s in query.split('&'): if s != '': i = s.index('=') params[unquote(s[:i])] = unquote(...
0073ddb35d8b9664a91e5163916ce0e57ddc1e04 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4538/0073ddb35d8b9664a91e5163916ce0e57ddc1e04/track.py
b = becache1
b = self.becache1
def get(self, connection, path, headers): try: (scheme, netloc, path, pars, query, fragment) = urlparse(path) if self.uq_broken == 1: path = path.replace('+',' ') query = query.replace('+',' ') path = unquote(path)[1:] params = {} for s in query.split('&'): if s != '': i = s.index('=') params[unquote(s[:i])] = unquote(...
0073ddb35d8b9664a91e5163916ce0e57ddc1e04 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4538/0073ddb35d8b9664a91e5163916ce0e57ddc1e04/track.py
def dummy(*stuff, **dictstuff):
def dummy(*args, **kwargs):
def dummy(*stuff, **dictstuff): pass
7c7d44a659b61460d474ab1b03c687fcc2af14dd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4538/7c7d44a659b61460d474ab1b03c687fcc2af14dd/btlaunchmany.py
if file[-len(ext):] == ext and exists(file[:-len(ext)]): Thread(target = runsingle, params = [join(d, file[:-len(ext)])]).start()
if file[-len(ext):] == ext and file[:-len(ext)] in files: Thread(target = runsingle, args = [join(d, file), params]).start()
def runmany(d, params): files = listdir(d) for file in files: if file[-len(ext):] == ext and exists(file[:-len(ext)]): Thread(target = runsingle, params = [join(d, file[:-len(ext)])]).start()
7c7d44a659b61460d474ab1b03c687fcc2af14dd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4538/7c7d44a659b61460d474ab1b03c687fcc2af14dd/btlaunchmany.py
def choose(self, default, size, saveas, dir, file = file): return file
def choose(default, size, saveas, dir, file = file): return file[:-len(ext)]
def choose(self, default, size, saveas, dir, file = file): return file
7c7d44a659b61460d474ab1b03c687fcc2af14dd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4538/7c7d44a659b61460d474ab1b03c687fcc2af14dd/btlaunchmany.py
def choose(self, default, size, saveas, dir, file = file): return file
7c7d44a659b61460d474ab1b03c687fcc2af14dd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4538/7c7d44a659b61460d474ab1b03c687fcc2af14dd/btlaunchmany.py
if self.allowed != None: s.write('<table summary="files">\n' \
if self.allowed != None and self.show_names: s.write('<table summary="files" border=1>\n' \
def get(self, connection, path, headers): try: (scheme, netloc, path, pars, query, fragment) = urlparse(path) path = unquote(path)[1:] params = {} for s in query.split('&'): if s != '': i = s.index('=') params[unquote(s[:i])] = unquote(s[i+1:]) except ValueError, e: return (400, 'Bad Request', {'Content-Type': 'text/pl...
dfdc76b107ec3a651b41d500aa24cc4458d46733 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4538/dfdc76b107ec3a651b41d500aa24cc4458d46733/track.py
if self.allowed != None and self.show_names and self.allowed.has_key(name): s.write('<tr><td><code>%s</code></td><td><code>%s</code></td><td align="right"><code>%i</code></td><td align="right"><code>%i</code></td></tr>\n' \ % (b2a_hex(name), self.allowed[name], c, d)) elif self.allowed == None:
if self.allowed != None and self.show_names: if self.allowed.has_key(name): s.write('<tr><td><code>%s</code></td><td><code>%s</code></td><td align="right"><code>%i</code></td><td align="right"><code>%i</code></td></tr>\n' \ % (b2a_hex(name), self.allowed[name], c, d)) else:
def get(self, connection, path, headers): try: (scheme, netloc, path, pars, query, fragment) = urlparse(path) path = unquote(path)[1:] params = {} for s in query.split('&'): if s != '': i = s.index('=') params[unquote(s[:i])] = unquote(s[i+1:]) except ValueError, e: return (400, 'Bad Request', {'Content-Type': 'text/pl...
dfdc76b107ec3a651b41d500aa24cc4458d46733 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4538/dfdc76b107ec3a651b41d500aa24cc4458d46733/track.py
self.downTotalText.SetLabel('%.1f MiB/s' % (downTotal))
self.downTotalText.SetLabel('%.1f M' % (downTotal))
def onUpdateStatus(self, dict): if self.last_update_time + 0.01 > time() and dict.get('fractionDone') not in [0.0, 1.0] and dict.get('activity') is None: return activity = dict.get('activity') fractionDone = dict.get('fractionDone') timeEst = dict.get('timeEst') downRate = dict.get('downRate') upRate = dict.get('upRate...
692901ab1449d16b1876684b7f2fbc1b2316cb5c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4538/692901ab1449d16b1876684b7f2fbc1b2316cb5c/btdownloadgui.py
self.upTotalText.SetLabel('%.1f MiB/s' % (upTotal))
self.upTotalText.SetLabel('%.1f M' % (upTotal))
def onUpdateStatus(self, dict): if self.last_update_time + 0.01 > time() and dict.get('fractionDone') not in [0.0, 1.0] and dict.get('activity') is None: return activity = dict.get('activity') fractionDone = dict.get('fractionDone') timeEst = dict.get('timeEst') downRate = dict.get('downRate') upRate = dict.get('upRate...
692901ab1449d16b1876684b7f2fbc1b2316cb5c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4538/692901ab1449d16b1876684b7f2fbc1b2316cb5c/btdownloadgui.py
def failed(self)
def failed(self):
def failed(self) self.fin = true wxPostEvent(self, FailEvent())
4ccb79338a8056e9f8e34dd0257e08b024fa7e29 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4538/4ccb79338a8056e9f8e34dd0257e08b024fa7e29/btdownloadgui.py
def __init__(self, doneflag, timeout_check_interval, timeout, noisy = true, errorfunc None):
def __init__(self, doneflag, timeout_check_interval, timeout, noisy = true, errorfunc = None):
def __init__(self, doneflag, timeout_check_interval, timeout, noisy = true, errorfunc None): self.timeout_check_interval = timeout_check_interval self.timeout = timeout self.poll = poll() # {socket: SingleSocket} self.single_sockets = {} self.dead_from_write = [] self.doneflag = doneflag self.noisy = noisy self.errorfu...
420e3f02828d580adcd3ff8597067b8fc910bfc3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4538/420e3f02828d580adcd3ff8597067b8fc910bfc3/RawServer.py
if self.last_update_time + 0.1 < time() or d.get('fractionDone') in [0.0, 1.0] or d.has_key('activity'):
if (self.last_update_time + 0.1 < time() and not self.showing_error) or d.get('fractionDone') in (0.0, 1.0) or d.has_key('activity'):
def updateStatus(self, d): if self.last_update_time + 0.1 < time() or d.get('fractionDone') in [0.0, 1.0] or d.has_key('activity'): self.invokeLater(self.onUpdateStatus, [d])
7b3662193f9b8e83349e5bd872c36aaacd50e3b1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4538/7b3662193f9b8e83349e5bd872c36aaacd50e3b1/btdownloadgui.py
return str(long((n / (2 ** 10)) * 10) / 10.0)
return str(long((float(n) / (2 ** 10)) * 10) / 10.0)
def kify(n): return str(long((n / (2 ** 10)) * 10) / 10.0)
7c010455af08d67a6fff4d351a543a7db6d0bc58 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4538/7c010455af08d67a6fff4d351a543a7db6d0bc58/DownloaderFeedback.py
return str(long((n / (2 ** 20)) * 10) / 10.0)
return str(long((float(n) / (2 ** 20)) * 10) / 10.0)
def mbfy(n): return str(long((n / (2 ** 20)) * 10) / 10.0)
7c010455af08d67a6fff4d351a543a7db6d0bc58 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4538/7c010455af08d67a6fff4d351a543a7db6d0bc58/DownloaderFeedback.py
try: if d is not self: d.active_requests.remove((index, begin, len(piece)))
if d is not self and d.interested: if d.choked: d.fix_download_endgame() else: try: d.active_requests.remove((index, begin, len(piece))) except ValueError: continue
def got_piece(self, index, begin, piece): try: self.active_requests.remove((index, begin, len(piece))) except ValueError: return False if self.downloader.storage.is_endgame(): self.downloader.all_requests.remove((index, begin, len(piece))) self.last = time() self.measure.update_rate(len(piece)) self.downloader.measuref...
0b8804862b91fb1c582c917aaa62f5b52adf6791 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4538/0b8804862b91fb1c582c917aaa62f5b52adf6791/Downloader.py
except ValueError: pass
def got_piece(self, index, begin, piece): try: self.active_requests.remove((index, begin, len(piece))) except ValueError: return False if self.downloader.storage.is_endgame(): self.downloader.all_requests.remove((index, begin, len(piece))) self.last = time() self.measure.update_rate(len(piece)) self.downloader.measuref...
0b8804862b91fb1c582c917aaa62f5b52adf6791 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4538/0b8804862b91fb1c582c917aaa62f5b52adf6791/Downloader.py
self.resultfunc(false)
self.resultfunc(false, self.downloadid, self.peerid, self.ip, self.port)
def connection_lost(self, connection): if not self.closed: self.closed = true self.resultfunc(false)
f2fb172a3587103c2404c9a8ba239e901f71890c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4538/f2fb172a3587103c2404c9a8ba239e901f71890c/NatCheck.py
for i in [len(hashes) - 1] + range(len(hashes) - 1):
for i in xrange(len(hashes) - 1, -1, -1):
def markgot(piece, pos, self = self, check_hashes = check_hashes): self.places[piece] = pos self.have[piece] = true self.amount_left -= self._piecelen(piece) self.waschecked[piece] = check_hashes
2dea870d240617feda91557374f87b20484bd43d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4538/2dea870d240617feda91557374f87b20484bd43d/StorageWrapper.py
markgot(targets[sh].pop(), i)
markgot(targets[s].pop(), i)
def markgot(piece, pos, self = self, check_hashes = check_hashes): self.places[piece] = pos self.have[piece] = true self.amount_left -= self._piecelen(piece) self.waschecked[piece] = check_hashes
2dea870d240617feda91557374f87b20484bd43d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4538/2dea870d240617feda91557374f87b20484bd43d/StorageWrapper.py
self.holes.sort()
def markgot(piece, pos, self = self, check_hashes = check_hashes): self.places[piece] = pos self.have[piece] = true self.amount_left -= self._piecelen(piece) self.waschecked[piece] = check_hashes
2dea870d240617feda91557374f87b20484bd43d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4538/2dea870d240617feda91557374f87b20484bd43d/StorageWrapper.py
n = self.holes.pop(0)
n = self.holes.pop()
def _piece_came_in(self, index, begin, piece): if not self.places.has_key(index): n = self.holes.pop(0) if self.places.has_key(n): oldpos = self.places[n] old = self.storage.read(self.piece_size * oldpos, self._piecelen(n)) self.storage.write(self.piece_size * n, old) self.places[n] = n if index == oldpos or index in s...
2dea870d240617feda91557374f87b20484bd43d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4538/2dea870d240617feda91557374f87b20484bd43d/StorageWrapper.py
encode_func[type(Bencached)] = encode_bencached
encode_func[type(Bencached(0))] = encode_bencached
def encode_dict(x,r): r.append('d') ilist = x.items() ilist.sort() for k, v in ilist: r.extend((str(len(k)), ':', k)) encode_func[type(v)](v, r) r.append('e')
fdb7044b5c06850671fe99238bac7ebd5bae6360 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4538/fdb7044b5c06850671fe99238bac7ebd5bae6360/bencode.py
s = RawServer(5, f, 100)
s = RawServer(.5, f, 100)
def test_normal(): l = [] f = Event() s = RawServer(5, f, 100) s.start_listening(DummyHandler(), 5007) s.add_task(lambda l = l: l.append('b'), 2) s.add_task(lambda l = l: l.append('a'), 1) s.add_task(lambda l = l: l.append('d'), 4) sleep(1.5) s.add_task(lambda l = l: l.append('c'), 1.5) sleep(3) assert l == ['a', 'b', ...
c6383d4aabd753043238e65bf706f4f6dc575993 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4538/c6383d4aabd753043238e65bf706f4f6dc575993/RawServer.py
s = RawServer(5, f, 100, false)
s = RawServer(.5, f, 100, false)
def test_catch_exception(): l = [] f = Event() s = RawServer(5, f, 100, false) s.start_listening(DummyHandler(), 5009) s.add_task(lambda l = l: l.append('b'), 2) s.add_task(lambda: 4/0, 1) sleep(3) assert l == ['b'] f.set()
c6383d4aabd753043238e65bf706f4f6dc575993 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4538/c6383d4aabd753043238e65bf706f4f6dc575993/RawServer.py