Example #1
0
 def planet_show(self, id):
     id = str(id)
     if len(id) != 6:
         return "Invalid ID"
     c.planet = meta.Session.query(Planet).filter_by(galaxy = int(id[0]), system = int(id[1:4]), orbit = int(id[4:6])).first()
     if c.planet == None:
         return "Planet either does not exist or has not been scanned yet"
     else:
         return render('/planet_show.mako')
Example #2
0
 def espionage_show(self, id):
     c.e_report = meta.Session.query(Espionage).filter_by(id=int(id)).first()
     
     amount = c.e_report.resources[0].amount + c.e_report.resources[1].amount + c.e_report.resources[2].amount
     samount = ""
     for l in range(len(str(amount))):
         if l % 3 == 0 and l != 0:
             samount = "," + samount
         
         samount = str(amount)[len(str(amount)) - l - 1] + samount
     c.samount = samount
     return render('/espionage_show.mako')
Example #3
0
 def index(self):
     '''mako method'''
     request.cookies['authkit']
     c.e_reports = meta.Session.query(Espionage).order_by("id DESC").all()
     return render('/index.mako')
Example #4
0
 def auth_change_display(self):
     '''mako method'''
     return render("/auth_change_display.mako")
Example #5
0
 def player_show(self, id):
     c.player = meta.Session.query(Player).filter_by(id=id).first()
     return render('/player_show.mako')