rem
stringlengths
0
322k
add
stringlengths
0
2.05M
context
stringlengths
8
228k
'link' : (('href', ''),),
'link' : (('href', 'normal'),),
def has_key(self, key): if key in self or key.lower() in self: return True return False
self.check_add_link('normal', newhref)
self.check_add_link('webpage', newhref)
def handle_anchor_links(self, link): """ Handle links of the form html#..."""
typ = d['rel']
foundtyp = d['rel'].lower() if foundtyp in self.handled_rel_types: typ = foundtyp
def unknown_starttag(self, tag, attrs): """ This method gives you the tag in the html page along with its attributes as a list of tuples """
'applet' : (('codebase', 'appletcodebase'), ('code', 'javaapplet'))
'applet' : (('codebase', 'appletcodebase'), ('code', 'javaapplet')), 'area' : (('href', 'normal'),)
def has_key(self, key): if key in self or key.lower() in self: return True return False
p.feed(open('module-sgmllib.html').read()) pass
urls = ['http://www.fed-parl.be/'] for url in urls: if os.system('wget %s -O index.html' % url ) == 0: p.feed(open('index.html').read()) print p.links pass
def get_base_url(self): return self.base
print 'Not duplicate link->',url_obj.get_full_url()
debug('Not duplicate link->',url_obj.get_full_url())
def crawl_url(self): """ Crawl a web page, recursively downloading its links """
if GetObject('datamanager').check_duplicate_download(url_obj): return False
def set_url_object(self, obj):
mgr = GetObject('datamanager')
mgr = GetObject('datamanager') ruleschecker = GetObject('ruleschecker') if mgr.check_duplicate_download(self._urlobject): debug('Detected duplicate URL in process_url... %s' % self._url) return -1
def process_url(self): """ This function downloads the data for a url and writes its files. It also posts the data for web pages to a data queue """
data = mgr.download_url(self._urlobject)
data = mgr.download_url(self, self._urlobject)
def process_url(self): """ This function downloads the data for a url and writes its files. It also posts the data for web pages to a data queue """
if robots: firstval=self.__compare_by_ip(domain1, domain2) if firstval: return firstval else: return self.__compare_by_name(domain1, domain2) else: firstval=self.__compare_by_name(domain1, domain2) if firstval: return firstval else: return self.__compare_by_ip(domain1, domain2)
return self.__compare_by_name(domain1, domain2)
def __compare_domains(self, domain1, domain2, robots=False): """ Compare two domains (servers) first by ip and then by name and return True if both point to the same server, return False otherwise. """
if directory.find(bdir) == 0:
if directory and bdir and directory.find(bdir) == 0:
def is_under_starting_directory(self, urlObj): """ Check whether the url in the url object belongs to the same directory as the starting url for the project """
print 'Same server ', urlObj.domain, baseUrlObj.domain
def __is_external_link(self, urlObj): """ Check if the url is an external link relative to starting url, using the download rules set by the user """
print 'Different server ', urlObj.domain, baseUrlObj.domain
def __is_external_link(self, urlObj): """ Check if the url is an external link relative to starting url, using the download rules set by the user """
import md5
def is_url_cache_uptodate(self, url, filename, contentlen, urldata): """ Check with project cache and find out if the content needs update """
cachekey[intern('checksum')] = bin_crypt(digest1) cachekey[intern('location')] = filename cachekey[intern('content-length')] = contentlen cachekey[intern('updated')] = True if self._cfg.datacache: cachekey['data'] = urldata self._projectcache[intern(url)] = cachekey
self.update_cache_for_url(url, filename, contentlen, urldata, digest1)
def is_url_cache_uptodate(self, url, filename, contentlen, urldata): """ Check with project cache and find out if the content needs update """
cachekey[intern('location')] = filename cachekey[intern('last-modified')] = lmt cachekey[intern('updated')] = True if self._cfg.datacache: cachekey['data'] = urldata self._projectcache[intern(url)] = cachekey
self.update_cache_for_url2(url, filename, lmt, urldata)
def is_url_uptodate(self, url, filename, lmt, urldata): """ New function to check whether the url cache is out of date by comparing last modified time """
self.download_url( urlobj )
t = tg.currentThread() self.download_url(t, urlobj )
def post_download_setup(self): """ Actions to perform after project is complete """
def download_url(self, urlobj):
def download_url(self, caller, urlobj):
def download_url(self, urlobj):
if self._urlThreadPool:
if not urlobj.is_webpage() and self._urlThreadPool: debug('Checking duplicates for url...',urlobj.get_full_url(),urlobj.get_type())
def check_duplicate_download(self, urlobj): """ Check if this is a duplicate download """
return self.is_file_downloaded(urlobj.get_full_filename())
ret = self.is_file_downloaded(urlobj.get_full_filename()) if ret:return ret else: ret = self.check_duplicates(urlobj.get_full_url()) if ret: debug("Fetchers in charge of url",urlobj.get_full_url(),"...") return ret
def check_duplicate_download(self, urlobj): """ Check if this is a duplicate download """
if original_op.from_==self.id:
if original_op.from_==me.id:
def event(self, me, original_op, op): obj = me.map.update(op[0], op.getSeconds()) if original_op.from_==self.id: self.add_thing(obj) if obj.type[0]==self.player: return Operation("talk", Entity(say=self.message))
m.make('fire',type='fire',xyz=(0.7,0.7,0),parent=cfire.id)
m.make('fire',type='fire',xyz=(0,0,0),parent=cfire.id)
#def dontrunme():
m.make('sign_market_w',type='sign_market_w',xyz=(-2,-28,village_height))
cfire=m.make('campfire',type='campfire',xyz=(35,54,village_height)) m.make('fire',type='fire',xyz=(0.7,0.7,0),parent=cfire.id) cfire=m.make('campfire',type='campfire',xyz=(42,51,village_height)) m.make('fire',type='fire',xyz=(0.7,0.7,0),parent=cfire.id) cfire=m.make('campfire',type='campfire',xyz=(43,39,village_heigh...
def default(mapeditor):
m.make('oak',type='oak',xyz=(-10,-87,village_height))
m.make('oak',type='oak',xyz=(-6,-77,village_height))
def default(mapeditor):
m.make('oak',type='oak',xyz=(-41,-98,village_height)) m.make('oak',type='oak',xyz=(-97,-80,village_height))
m.make('oak',type='oak',xyz=(-35,-73,village_height)) m.make('oak',type='oak',xyz=(-83,-66,village_height))
def default(mapeditor):
m.make('oak',type='oak',xyz=(-87,25,village_height))
m.make('oak',type='oak',xyz=(-75,31,village_height))
def default(mapeditor):
m.make('bstall',type='bstall',xyz=(-35,-5,village_height))
m.make('bstall',type='bstall',xyz=(-41,-5,village_height))
def default(mapeditor):
for i in range(-5, 6): for j in range(-5, 6): if i==5 or j==5:
for i in range(-6, 7): for j in range(-6, 7): if i>=5 or j>=5:
def default(mapeditor):
elif i==-5 or j == -5:
elif i<=-5 or j <= -5:
def default(mapeditor):
points['%ix%i'%(i,j)] = [i, j, uniform(-2, 5)]
points['%ix%i'%(i,j)] = [i, j, uniform(-5, 5)]
def default(mapeditor):
m.make('boundary',type='boundary',xyz=(-257,-257,settlement_height),bbox=[2,514,256]) m.make('boundary',type='boundary',xyz=(-257,-257,settlement_height),bbox=[514,2,256]) m.make('boundary',type='boundary',xyz=(-257, 256,settlement_height),bbox=[514,2,256]) m.make('boundary',type='boundary',xyz=( 256,-257,settlement_he...
m.make('boundary',type='boundary',xyz=(-321,-321,-20),bbox=[2,642,300],mode="fixed") m.make('boundary',type='boundary',xyz=(-321,-321,-20),bbox=[642,2,300],mode="fixed") m.make('boundary',type='boundary',xyz=(-321, 320,-20),bbox=[642,2,300],mode="fixed") m.make('boundary',type='boundary',xyz=( 320,-321,-20),bbox=[2,642...
def default(mapeditor):
for i in range(-5, 6): for j in range(-5, 6): if i==5 or j==5:
for i in range(-6, 7): for j in range(-6, 7): if i>=5 or j>=5:
def modify_terrain(mapeditor):
elif i==-5 or j == -5:
elif i<=-5 or j <= -5:
def modify_terrain(mapeditor):
points['%ix%i'%(i,j)] = [i, j, uniform(-2, 5)]
points['%ix%i'%(i,j)] = [i, j, uniform(-5, 5)]
def modify_terrain(mapeditor):
cleaver=m.make('cleaver',desc='cleaver for cutting meat',place='market', xyz=(-34,-8,village_height),status=1.0)
cleaver=m.make('cleaver',type='cleaver',desc='cleaver for cutting meat', place='market',xyz=(-34,-8,village_height),status=1.0)
def default(mapeditor):
sty=m.make('sty',type='sty',xyz=pig_sty_xyz,status=1.0,bbox=[5,5,3])
sty=m.make('sty',type='sty',xyz=pig_sty_xyz,status=1.0,bbox=[5,5,3],area={'points' : [ [0,0], [0,5], [5,5], [5,0] ], 'layer' : 5})
#def dontrunme():
set_kw(self,kw,"alcahol",0)
set_kw(self,kw,"alcohol",0)
def __init__(self, cppthing, **kw): self.base_init(cppthing, kw) set_kw(self,kw,"alcahol",0) set_kw(self,kw,"mass",0.2)
nour=Entity(to_.id,mass=self.mass,alcahol=self.alcahol)
nour=Entity(to_.id,mass=self.mass,alcohol=self.alcohol)
def eat_operation(self, op): ent=Entity(self.id,status=-1) res = Operation("set",ent,to=self) to_ = op.from_ nour=Entity(to_.id,mass=self.mass,alcahol=self.alcahol) res = res + Operation("nourish",nour,to=to_) return res
print "New cleaver"
def __init__(self, cppthing, **kw): self.base_init(cppthing, kw) set_kw(self,kw,"mass",1.5) print "New cleaver"
directions = [[0,1,0],[1,0,0],[0,-1,0],[-1,0,0], [0.7,0.7,0],[0.7,-0.7,0],[-0.7,-0.7,0],[-0.7,0.7,0]]
directions=[Quaternion(Vector3D([1,0,0]),Vector3D([0,1,0])).as_list(), Quaternion(Vector3D([1,0,0]),Vector3D([1,0,0])).as_list(), Quaternion(Vector3D([1,0,0]),Vector3D([0,-1,0])).as_list(), Quaternion(Vector3D([1,0,0]),Vector3D([-1,0,0])).as_list(), Quaternion(Vector3D([1,0,0]),Vector3D([0.7,0.7,0])).as_list(), Quatern...
def default(mapeditor):
age=probability.fertility_age,face=directions[randint(0,7)])
age=probability.fertility_age,orientation=directions[randint(0,7)])
def default(mapeditor):
xyz=pig_stall_xyz,age=probability.fertility_age,sex='male',face=[-1,0,0])
xyz=pig_stall_xyz,age=probability.fertility_age,sex='male',orientation=Quaternion(Vector3D([1,0,0]),Vector3D([-1,0,0])).as_list())
def default(mapeditor):
xyz=(-28,2,village_height),age=probability.fertility_age,sex='male',face=[0,-1,0])
xyz=(-28,2,village_height),age=probability.fertility_age,sex='male',orientation=Quaternion(Vector3D([1,0,0]),Vector3D([0,-1,0])).as_list())
def default(mapeditor):
piglets.append(m.make('pig',type='pig',xyz=(uniform(0,4),uniform(0,4),village_height),parent=sty.id,face=directions[randint(0,7)]))
piglets.append(m.make('pig',type='pig',xyz=(uniform(0,4),uniform(0,4),village_height),parent=sty.id,orientation=directions[randint(0,7)]))
def default(mapeditor):
warrior=m.make('Tom Harrowe', type='guard',xyz=(uniform(-1,14),uniform(-18,-27),village_height),sex='male',face=directions[randint(0,7)])
warrior=m.make('Tom Harrowe', type='guard',xyz=(uniform(-1,14),uniform(-18,-27),village_height),sex='male',orientation=directions[randint(0,7)])
def default(mapeditor):
warrior=m.make('Mae Dollor', type='guard',xyz=(uniform(-1,14),uniform(-18,-27),village_height),sex='female',face=directions[randint(0,7)])
warrior=m.make('Mae Dollor', type='guard',xyz=(uniform(-1,14),uniform(-18,-27),village_height),sex='female',orientation=directions[randint(0,7)])
def default(mapeditor):
warrior=m.make('Covan Dubneal',type='guard',xyz=(uniform(-1,14),uniform(-18,-27),village_height),sex='male',face=directions[randint(0,7)])
warrior=m.make('Covan Dubneal',type='guard',xyz=(uniform(-1,14),uniform(-18,-27),village_height),sex='male',orientation=directions[randint(0,7)])
def default(mapeditor):
warrior=m.make('Roal Guddon', type='guard',xyz=(uniform(-1,14),uniform(-18,-27),village_height),sex='male',face=directions[randint(0,7)])
warrior=m.make('Roal Guddon', type='guard',xyz=(uniform(-1,14),uniform(-18,-27),village_height),sex='male',orientation=directions[randint(0,7)])
def default(mapeditor):
warrior=m.make('Vonaa Barile',type='archer',xyz=(uniform(-1,14),uniform(-18,-27),village_height),sex='female',face=directions[randint(0,7)])
warrior=m.make('Vonaa Barile',type='archer',xyz=(uniform(-1,14),uniform(-18,-27),village_height),sex='female',orientation=directions[randint(0,7)])
def default(mapeditor):
warrior=m.make('Lile Birloc', type='archer',xyz=(-2,-2,village_height),sex='female',face=directions[randint(0,7)])
warrior=m.make('Lile Birloc', type='archer',xyz=(-2,-2,village_height),sex='female',orientation=directions[randint(0,7)])
def default(mapeditor):
item = items[randint(0,6)]
item = items[randint(0,5)]
def create_skeletonpart(self, op): retops = Message() newloc=self.location.copy() newloc.velocity=Vector3D(0,0,0) items = ['skull', 'ribcage', 'arm', 'pelvis', 'thigh', 'shin'] item = items[randint(0,6)] newloc.coordinates = newloc.coordinates + Vector3D(uniform(-1,1), uniform(-1,1), uniform(-1,1)) retops = retops + Op...
print "Making house"
def setup_operation(self, op): print "Making house" ret = Message() # West wall with door
loc = Location(self, Vector3D(0,0,-1))
loc = Location(self, Point3D(0,0,-1))
def setup_operation(self, op): print "Making house" ret = Message() # West wall with door
loc = Location(self, Vector3D(0,4,-1))
loc = Location(self, Point3D(0,4,-1))
def setup_operation(self, op): print "Making house" ret = Message() # West wall with door
loc = Location(self, Vector3D(0,5.9,-1))
loc = Location(self, Point3D(0,5.9,-1))
def setup_operation(self, op): print "Making house" ret = Message() # West wall with door
loc = Location(self, Vector3D(8.9,0,-1))
loc = Location(self, Point3D(8.9,0,-1))
def setup_operation(self, op): print "Making house" ret = Message() # West wall with door
self.progress = current_status
self.progress = 1 - current_status
def tick_operation(self, op): """ Op handler for regular tick op """ print "Logging.tick" res=Message()
m.make('boundary',type='boundary',xyz=(-201,-201,settlement_height),bbox=[2,404,50]) m.make('boundary',type='boundary',xyz=(-201,-201,settlement_height),bbox=[404,2,50]) m.make('boundary',type='boundary',xyz=(-201, 200,settlement_height),bbox=[404,2,50]) m.make('boundary',type='boundary',xyz=( 200,-201,settlement_heigh...
m.make('boundary',type='boundary',xyz=(-257,-257,settlement_height),bbox=[2,514,256]) m.make('boundary',type='boundary',xyz=(-257,-257,settlement_height),bbox=[514,2,256]) m.make('boundary',type='boundary',xyz=(-257, 256,settlement_height),bbox=[514,2,256]) m.make('boundary',type='boundary',xyz=( 256,-257,settlement_he...
def default(mapeditor):
m.make('jetty',type='thing',xyz=(-22,-48,0),bbox=[-5, -5, -2, 5, 5, 2]) m.make('boat',type='boat',xyz=(-22,-56,0),bbox=[-5, -2, -1, 5, 2, 1]) def dontrunme():
m.make('jetty',type='jetty',xyz=(-22,-48,0)) m.make('boat',type='boat',xyz=(-22,-56,0),mode="floating")
def default(mapeditor):
hall=m.make('hall',type='hall',xyz=hall_xyz)
def dontrunme():
cfire=m.make('campfire',type='campfire',xyz=(6,6,settlement_height), parent=hall.id) m.make('fire',type='fire',xyz=(0.7,0.7,0),parent=cfire.id)
def dontrunme():
obj=me.find_thing(self.tool)[0] if me.things.has_key(self.what)==0: return
if not hasattr(self,'wield') or not self.wield: tool=me.find_thing(self.tool)[0] self.wield=True return Operation("wield", Entity(tool.id)
def do(self,me): if me.things.has_key(self.tool)==0: return obj=me.find_thing(self.tool)[0] if me.things.has_key(self.what)==0: return what=me.find_thing(self.what)[0] return Operation("cut",Entity(obj.id),Entity(what.id),to=obj)
return Operation("cut",Entity(obj.id),Entity(what.id),to=obj)
return Operation("use",Entity(what.id))
def do(self,me): if me.things.has_key(self.tool)==0: return obj=me.find_thing(self.tool)[0] if me.things.has_key(self.what)==0: return what=me.find_thing(self.what)[0] return Operation("cut",Entity(obj.id),Entity(what.id),to=obj)
print "script init"
def __init__(self, entity): rules.Statistics.__init__(self, entity) print "script init"
chickens.append(d)
fish.append(d)
def default(mapeditor):
m.make('boundary',type='boundary',xyz=(-201,-201,village_height),bbox=[2,404,50]) m.make('boundary',type='boundary',xyz=(-201,-201,village_height),bbox=[404,2,50]) m.make('boundary',type='boundary',xyz=(-201, 200,village_height),bbox=[304,2,50]) m.make('boundary',type='boundary',xyz=( 200,-201,village_height),bbox=[2,2...
m.make('boundary',type='boundary',xyz=(-201,-201,settlement_height),bbox=[2,404,50]) m.make('boundary',type='boundary',xyz=(-201,-201,settlement_height),bbox=[404,2,50]) m.make('boundary',type='boundary',xyz=(-201, 200,settlement_height),bbox=[304,2,50]) m.make('boundary',type='boundary',xyz=( 200,-201,settlement_heigh...
def default(mapeditor):
cfire=m.make('campfire',type='campfire',xyz=(6,6,village_height),
cfire=m.make('campfire',type='campfire',xyz=(6,6,settlement_height),
def default(mapeditor):
cfire=m.make('campfire',type='campfire',xyz=(3,9,village_height))
cfire=m.make('campfire',type='campfire',xyz=(3,9,settlement_height))
def default(mapeditor):
cfire=m.make('campfire',type='campfire',xyz=(11,1,village_height))
cfire=m.make('campfire',type='campfire',xyz=(11,1,settlement_height))
def default(mapeditor):
m.make('lumber',type='lumber',xyz=(uniform(-200,0),uniform(-200,0),village_height))
m.make('lumber',type='lumber',xyz=(uniform(-200,0),uniform(-200,0),settlement_height))
def default(mapeditor):
m.make('skull', type='skull', xyz=(xpos+uniform(-2,2),ypos+uniform(-2,2),village_height)) m.make('pelvis', type='pelvis', xyz=(xpos+uniform(-2,2),ypos+uniform(-2,2),village_height)) m.make('arm', type='arm', xyz=(xpos+uniform(-2,2),ypos+uniform(-2,2),village_height)) m.make('thigh', type='thigh', xyz=(xpos+uniform(-2,2...
m.make('skull', type='skull', xyz=(xpos+uniform(-2,2),ypos+uniform(-2,2),settlement_height)) m.make('pelvis', type='pelvis', xyz=(xpos+uniform(-2,2),ypos+uniform(-2,2),settlement_height)) m.make('arm', type='arm', xyz=(xpos+uniform(-2,2),ypos+uniform(-2,2),settlement_height)) m.make('thigh', type='thigh', xyz=(xpos+uni...
def default(mapeditor):
lych=m.make('lych', type='lych', xyz=(-21, -89, village_height))
lych=m.make('lych', type='lych', xyz=(-21, -89, settlement_height))
def default(mapeditor):
piglet = m.make('pig', type='pig', xyz=(-3,-1,village_height))
piglet = m.make('pig', type='pig', xyz=(-3,-1,settlement_height))
def default(mapeditor):
wolf = m.make('wolf', type='wolf', xyz=(90,-90,village_height))
wolf = m.make('wolf', type='wolf', xyz=(90,-90,settlement_height))
def default(mapeditor):
crab = m.make('crab', type='crab', xyz=(-90,90,village_height))
crab = m.make('crab', type='crab', xyz=(-90,90,settlement_height))
def default(mapeditor):
skeleton = m.make('skeleton', type='skeleton', xyz=(-38,-25,village_height))
skeleton = m.make('skeleton', type='skeleton', xyz=(-38,-25,settlement_height))
def default(mapeditor):
home1_xyz=(90,-90,village_height)
directions = [[0,1,0],[1,0,0],[0,-1,0],[-1,0,0], [0.7,0.7,0],[0.7,-0.7,0],[-0.7,-0.7,0],[-0.7,0.7,0]] home1_xyz=(90,-90,settlement_height)
def default(mapeditor):
place='market', xyz=(-41,-5,village_height))
place='market', xyz=(-41,-5,settlement_height))
def default(mapeditor):
home2_xyz=(80,80,village_height)
home2_xyz=(80,80,settlement_height)
def default(mapeditor):
xyz=pig_stall_xyz,age=probability.fertility_age,
xyz=pig_sty_xyz,age=probability.fertility_age,
def default(mapeditor):
xyz=(-28,2,village_height),age=probability.fertility_age,sex='male',orientation=Quaternion(Vector3D([1,0,0]),Vector3D([0,-1,0])).as_list())
xyz=(-28,2,settlement_height),age=probability.fertility_age,sex='male',orientation=Quaternion(Vector3D([1,0,0]),Vector3D([0,-1,0])).as_list())
def default(mapeditor):
m.price(merchant,mprices) m.price(merchant2,m2prices)
m.price(merchants,mprices)
def default(mapeditor):
piglets.append(m.make('pig',type='pig',xyz=(uniform(0,4),uniform(0,4),village_height),parent=sty.id,orientation=directions[randint(0,7)]))
piglets.append(m.make('pig',type='pig',xyz=(uniform(0,4),uniform(0,4),settlement_height),parent=sty.id,orientation=directions[randint(0,7)]))
def default(mapeditor):
warrior=m.make('Tom Harrowe', type='guard',xyz=(uniform(-1,14),uniform(-18,-27),village_height),sex='male',orientation=directions[randint(0,7)]) sword=m.make('sword',type='sword',xyz=(0,0,0), parent=warrior.id) m.own(warrior,sword) warriors.append(warrior) warrior=m.make('Mae Dollor', type='guard',xyz=(uniform(-1,14),...
warrior=m.make('Tom Harrowe', type='guard',xyz=(uniform(-1,14),uniform(-18,-27),settlement_height),sex='male',orientation=directions[randint(0,7)]) sword=m.make('sword',type='sword',xyz=(0,0,0), parent=warrior.id) m.own(warrior,sword) warriors.append(warrior) warrior=m.make('Mae Dollor', type='guard',xyz=(uniform(-1,1...
def default(mapeditor):
warrior=m.make('Vonaa Barile',type='archer',xyz=(uniform(-1,14),uniform(-18,-27),village_height),sex='female',orientation=directions[randint(0,7)])
warrior=m.make('Vonaa Barile',type='archer',xyz=(uniform(-1,14),uniform(-18,-27),settlement_height),sex='female',orientation=directions[randint(0,7)])
def default(mapeditor):
warrior=m.make('Lile Birloc', type='archer',xyz=(-2,-2,village_height),sex='female',orientation=directions[randint(0,7)])
warrior=m.make('Lile Birloc', type='archer',xyz=(-2,-2,settlement_height),sex='female',orientation=directions[randint(0,7)])
def default(mapeditor):
m.make('deer',type='deer',xyz=(2,2,village_height))
m.make('deer',type='deer',xyz=(2,2,settlement_height))
def default(mapeditor):
def dont_run_me(foo): m.make('birch_summer_1_us',type='birch_summer_1_us',desc='a dumb birch_summer_1_us object', xyz=(-72,85,village_height)) m.make('birch_summer_1_us',type='birch_summer_1_us',desc='a dumb birch_summer_1_us object', xyz=(-72,81,village_height)) m.make('poplar_summer_1_us',type='poplar_summer_1_us'...
def default(mapeditor):
trader_list = ['seller', 'maid_brown', 'maid_blond', 'maid_red']
directions = [[0,1,0],[1,0,0],[0,-1,0],[-1,0,0], [0.7,0.7,0],[0.7,-0.7,0],[-0.7,-0.7,0],[-0.7,0.7,0]] trader_list = ['merchant', 'maid_brown', 'maid_blond', 'maid_red']
def default(mapeditor):
xyz=butcher_stall_xyz,age=probability.fertility_age) m.learn(trader,(il.market,"run_shop(stall,'open','dawn')")) m.learn(trader,(il.market,"run_shop(stall,'closed','evening')"))
xyz=(uniform(-36,-56),uniform(-7,-17),village_height), age=probability.fertility_age,face=directions[randint(0,7)]) m.learn(trader,(il.market,"run_shop('"+stall+"','open','dawn')")) m.learn(trader,(il.market,"run_shop('"+stall+"','closed','evening')"))
def default(mapeditor):
piglets.append(m.make('pig',type='pig',xyz=(uniform(0,4),uniform(0,4),village_height),parent=sty.id))
piglets.append(m.make('pig',type='pig',xyz=(uniform(0,4),uniform(0,4),village_height),parent=sty.id,face=directions[randint(0,7)]))
def default(mapeditor):
warrior=m.make('Tom Harrowe', type='guard',xyz=(uniform(-1,14),uniform(-18,-27),village_height),sex='male',face=[0.7,-0.7,0])
warrior=m.make('Tom Harrowe', type='guard',xyz=(uniform(-1,14),uniform(-18,-27),village_height),sex='male',face=directions[randint(0,7)])
def default(mapeditor):
warrior=m.make('Mae Dollor', type='guard',xyz=(uniform(-1,14),uniform(-18,-27),village_height),sex='female',face=[-0.7,1,0])
warrior=m.make('Mae Dollor', type='guard',xyz=(uniform(-1,14),uniform(-18,-27),village_height),sex='female',face=directions[randint(0,7)])
def default(mapeditor):
warrior=m.make('Covan Dubneal',type='guard',xyz=(uniform(-1,14),uniform(-18,-27),village_height),sex='male',face=[-0.7,-0.7,0])
warrior=m.make('Covan Dubneal',type='guard',xyz=(uniform(-1,14),uniform(-18,-27),village_height),sex='male',face=directions[randint(0,7)])
def default(mapeditor):
warrior=m.make('Roal Guddon', type='guard',xyz=(uniform(-1,14),uniform(-18,-27),village_height),sex='male',face=[1,-0.7,0])
warrior=m.make('Roal Guddon', type='guard',xyz=(uniform(-1,14),uniform(-18,-27),village_height),sex='male',face=directions[randint(0,7)])
def default(mapeditor):
warrior=m.make('Vonaa Barile',type='archer',xyz=(uniform(-1,14),uniform(-18,-27),village_height),sex='female',face=[-1,0,0])
warrior=m.make('Vonaa Barile',type='archer',xyz=(uniform(-1,14),uniform(-18,-27),village_height),sex='female',face=directions[randint(0,7)])
def default(mapeditor):
warrior=m.make('Lile Birloc', type='archer',xyz=(-2,-2,village_height),sex='female',face=[0,1,0])
warrior=m.make('Lile Birloc', type='archer',xyz=(-2,-2,village_height),sex='female',face=directions[randint(0,7)])
def default(mapeditor):
m.learn(squirrel,squirrel_knowledge)
m.learn(squirrel,sknowledge)
#def dontrunme():
m.learn(marshall,(il.help,"add_help(['On behalf of the Duke I would like to welcome you to moraf.','If you are new here I suggest talking to the pig seller.','He will tell you what you can do to help out.','If you have decide you would like to settle here I can assign you some land'],['but you will need to show that yo...
m.learn(marshall,(il.help,"add_help(['On behalf of the Duke I would like to welcome you to moraf.','If you are new here I suggest talking to the pig seller.','He will tell you what you can do to help out.','If you have decide you would like to settle here I can assign you some land','but you will need to show that you ...
#def dontrunme():
print "__getattr__",name return getattr(self.cppthing, name)
value = getattr(self.cppthing, name) print "__getattr__",name,value return value
def __getattr__(self, name): print "__getattr__",name return getattr(self.cppthing, name)