def get(self): page = Page() seal = Pagophilus() seal.name = 'Harp Seal' fox = Vulpes() fox.name = 'Arctic Fox' ferret = Mustela() ferret.name = 'Arctic Ermine' wolf = Canis() wolf.name = 'Arctic Wolf' bunny = Lepus() bunny.name = 'Arctic Hare' animals = [seal,fox,ferret,wolf,bunny] self.response.write(page.head()) if self.request.GET: a = int(self.request.GET['animal']) self.response.write(page.tmp(animals[a])) self.response.write(page.form()) self.response.write(page.foot())
def get(self): #----- pull the page class html from the html.py page = Page() #----- head of the html -----# self.response.write(page.head()) #----- Asia -----# asia = Region() asia.name = 'Asia' asia.population = 4298723288 asia.area = 31915446 #----- Africa -----# africa = Region() africa.name = 'Africa' africa.population = 1110635062 africa.area = 30955880 #----- Europe -----# europe = Region() europe.name = 'Europe' europe.population = 742452170 europe.area = 23048931 #----- Latin America -----# latinAmerica = Region() latinAmerica.name = 'Latin America and Caribbean' latinAmerica.population = 616644503 latinAmerica.area = 20546598 #----- North America -----# northAmerica = Region() northAmerica.name = 'Northern America' northAmerica.population = 355360791 northAmerica.area = 21775893 #----- Everything Else XD -----# oceania = Region() oceania.name = 'Oceania' oceania.population = 38303620 oceania.area = 8563295 #----- All Together Now! -----# world = Region() world.name = 'Earth' world.population = 7162119434 world.area = 136806988 #----- Hold all of the region objects -----# areas = [world,asia,africa,europe,latinAmerica,northAmerica,oceania] #----- If something is clicked then display what was clicked #----- Using the number attached to each button it will call #----- The correct item from the array if self.request.GET: button = int(self.request.GET['button']) self.response.write(self.html(areas[button])) #----- HTML BUTTONS -----# self.response.write(page.form()) #----- HTML Closer -----# self.response.write(page.foot())