本文整理汇总了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)