本文整理匯總了Python中pages.Page.update方法的典型用法代碼示例。如果您正苦於以下問題:Python Page.update方法的具體用法?Python Page.update怎麽用?Python Page.update使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類pages.Page
的用法示例。
在下文中一共展示了Page.update方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: get
# 需要導入模塊: from pages import Page [as 別名]
# 或者: from pages.Page import update [as 別名]
def get(self):
p = Page()
p.title = "My Page"
p.css = "/css/style.css"
p.body = "Changer"
p.update()
self.response.write(p.whole_page)
示例2: get
# 需要導入模塊: from pages import Page [as 別名]
# 或者: from pages.Page import update [as 別名]
def get(self):
p = Page()
p.title = "My page!" #Setter was created so we could change
p.css = "css/style.css"
p.body = "Miss Piggy likes Kermit de Frog!"
p.update()
self.response.write(p.whole_page)
示例3: get
# 需要導入模塊: from pages import Page [as 別名]
# 或者: from pages.Page import update [as 別名]
def get(self):
p = Page()
p.title = 'My Page!'
p.css = 'css/main.css'
p.body = "Miss Piggy is aweful!"
p.update()
self.response.write(p.whole_page)
示例4: get
# 需要導入模塊: from pages import Page [as 別名]
# 或者: from pages.Page import update [as 別名]
def get(self):
#self.response.write('Hello world!')
p = Page()
p.title = "My Page"
p.css = "css/style.css"
p.body = "This is Stacy's Python Example"
#self.response.write(p.print_out())
p.update()
self.response.write(p.whole_page)
示例5: get
# 需要導入模塊: from pages import Page [as 別名]
# 或者: from pages.Page import update [as 別名]
def get(self):
# Establishes variables to allow interaction with designated class.
a1 = Snake()
a2 = Bird()
a3 = Person()
# Stores all animals defined in object
self.animals = [a1, a2, a3]
# Defines p as referring to Page class
p = Page()
# Runs the update command on page to concatinate the first pages info
p.update()
# Listens for an occurance of animal in the browsers request. Essentially listening for a button click
if "animal" in self.request.GET:
# Sets current animals value based on which request was made
p.current_animal = self.animals[int(self.request.GET["animal"])]
# Changes the Title of the page to match the selected animal
p.title = self.animals[int(self.request.GET["animal"])].name
# plays the sound specific for that animal
p.loud_noises = self.animals[int(self.request.GET["animal"])].sound
# Writes contents of whole page to the browser. The update function assembles this
self.response.write(p.whole_page)
else:
self.response.write(p.whole_page)
示例6: get
# 需要導入模塊: from pages import Page [as 別名]
# 或者: from pages.Page import update [as 別名]
def get(self):
h = hello()
p = Page()
p.title = "My New Page"
p.css = "css/styles.css"
p.update() #referencing my update class from pages
h.update_this()
# I will create an application that calculates the remaining storage for different users
#now I will hard code the values for each data object
m = Storage()
m.pictures = 5
m.videos = 10
m.documents = 1
m.music = 3
m.apps = 4
#write the values to the page
if self.request.GET:
total = self.request.GET['totalStorage']
self.response.write(h.user_page_update + "Total storage used is " + total + " GB <br/> There is " + str(m.final_storage) + " GB of storage remaining")
else:
self.response.write(p.user_page) #writing the user_page which has has all the html for my application
#now I am going create the remaining users
#now I will hard code the values for each data object
t = Storage()
t.pictures = 10
t.videos = 10
t.documents = 1
t.music = 20
t.apps = 7
#write the values to the page
# self.response.write(" <br/> Todd has " + str(t.final_storage) + " GB of storage remaining") #writing the user_page which has has all the html for my application
#now I will hard code the values for each data object
n = Storage()
n.pictures = 1
n.videos = 4
n.documents = 1
n.music = 9
n.apps = 7
#write the values to the page
# self.response.write(" <br/> Nancy has " + str(n.final_storage) + " GB of storage remaining") #writing the user_page which has has all the html for my application
#now I will hard code the values for each data object
h = Storage()
h.pictures = 18
h.videos = 10
h.documents = 1
h.music = 6
h.apps = 7
#write the values to the page
# self.response.write(" <br/> Henry has " + str(h.final_storage) + " GB of storage remaining") #writing the user_page which has has all the html for my application
#now I will hard code the values for each data object
j = Storage()
j.pictures = 6
j.videos = 4
j.documents = 1
j.music = 7
j.apps = 2
示例7: get
# 需要導入模塊: from pages import Page [as 別名]
# 或者: from pages.Page import update [as 別名]
def get(self):
p = Page()
p.title = "my page"
p.body = "Miss piggy likes Kermit the Frog"
p.update()
self.response.write(p.whole_page)