本文整理汇总了Python中page.Page.title方法的典型用法代码示例。如果您正苦于以下问题:Python Page.title方法的具体用法?Python Page.title怎么用?Python Page.title使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类page.Page
的用法示例。
在下文中一共展示了Page.title方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: from page import Page [as 别名]
# 或者: from page.Page import title [as 别名]
def main():
first = Page(1)
first.title = "The first Page"
first.add_content("Welcome to the first page. Here is a bunch of content")
print first.get_page_number()
print first.get_content()
SomeClassName.my_static_function("Test")
示例2: Login
# 需要导入模块: from page import Page [as 别名]
# 或者: from page.Page import title [as 别名]
def Login(params=None, title=None):
"""
Renders the login page.
There is no separate login for the application, this is passed to
the database!
"""
p = Page()
p.content('<!DOCTYPE html>')
with p.html():
with p.head():
with p.title():
p.content('pgui - Login')
with p.link({'href': 'static/lib/bootstrap/bootstrap-3.3.4-dist/css/bootstrap.css', 'rel': 'stylesheet'}): pass
with p.link({'href': 'static/login.css', 'rel': 'stylesheet'}): pass
with p.body():
with p.div({'class': 'container'}):
with p.form({'method': 'POST', 'class': 'login'}):
with p.h2({'class': 'login-header'}):
p.content('Connect to a postgres database server')
with p.label({'for': 'name', 'class': 'sr-only'}):
p.content('User name')
with p.input({'type': 'input', 'id': 'name', 'name': 'name', 'class': 'form-control', 'placeholder': 'User name'}): pass
with p.label({'for': 'password', 'class': 'sr-only'}):
p.content('Password')
with p.input({'type': 'password', 'id': 'password', 'name': 'password', 'class': 'form-control', 'placeholder': 'Password'}): pass
with p.label({'for': 'host', 'class': 'sr-only'}):
p.control('Host')
with p.input({'type': 'input', 'id': 'host', 'name': 'host', 'class': 'form-control', 'value': 'localhost'}): pass
with p.label({'for': 'port', 'class': 'sr-only'}):
p.content('Port')
with p.input({'type': 'input', 'id': 'port', 'name': 'port', 'class': 'form-control', 'value': '5432'}): pass
with p.button({'class': 'btn btn-lg btn-success btn-block', 'type': 'submit'}, args=['autofocus']):
p.content('Connect')
with p.div({'class': 'login'}):
if 'err' in params and params['err']:
for err in params['err']:
with p.code():
p.content(err)
return p
示例3: Header
# 需要导入模块: from page import Page [as 别名]
# 或者: from page.Page import title [as 别名]
def Header(params=None, title=None, css=None, js=None):
p = Page()
p.content('<!DOCTYPE html>')
with p.html(close=False):
with p.head():
with p.title():
p.content('pgui - %s/%s' % (cu.database, title))
with p.meta({'charset': 'utf-8'}): pass
with p.script({'src': 'static/lib/jquery/jquery-2.1.3.js'}): pass
with p.script({'src': 'static/pgui.js'}): pass
with p.link({'href': 'static/pgui.css', 'rel': 'stylesheet'}): pass
with p.link({'href': 'static/lib/bootstrap/bootstrap-3.3.4-dist/css/bootstrap.css', 'rel': 'stylesheet'}): pass
with p.link({'href': 'static/lib/codemirror/codemirror-5.1/lib/codemirror.css', 'rel': 'stylesheet'}): pass
with p.link({'href': 'static/lib/codemirror/codemirror-5.1/theme/neo.css', 'rel': 'stylesheet'}): pass
with p.link({'href': 'static/lib/codemirror/codemirror-5.1/addon/hint/show-hint.css', 'rel': 'stylesheet'}): pass
if css:
for c in css:
with p.link({'href': c, 'rel': 'stylesheet'}): pass
with p.script({'src': 'static/lib/bootstrap/bootstrap-3.3.4-dist/js/bootstrap.js'}): pass
with p.script({'src': 'static/lib/codemirror/codemirror-5.1/lib/codemirror.js'}): pass
with p.script({'src': 'static/lib/codemirror/codemirror-5.1/keymap/emacs.js'}): pass
with p.script({'src': 'static/lib/codemirror/codemirror-5.1/keymap/vim.js'}): pass
with p.script({'src': 'static/lib/codemirror/codemirror-5.1/keymap/sublime.js'}): pass
with p.script({'src': 'static/lib/codemirror/codemirror-5.1/mode/sql/sql.js'}): pass
with p.script({'src': 'static/lib/codemirror/codemirror-5.1/addon/hint/show-hint.js'}): pass
if js:
for j in js:
with p.script({'src': j}): pass
with p.body(close=False):
config = 'PGUI.user = "%s"; PGUI.db = "%s"; PGUI.host = "%s";' % (cu.name, cu.database, cu.host)
with p.script():
p.content(config)
return p
示例4: Page
# 需要导入模块: from page import Page [as 别名]
# 或者: from page.Page import title [as 别名]
import os
from page import Page
from colours import colour_print
from printer import instance as printer
page_number = os.path.splitext(os.path.basename(__file__))[0]
sub_page = Page(page_number)
sub_page.title = "Page Not Found"
sub_page.in_index=False
sub_page.content = colour_print(printer.text_to_ascii("404", padding={"left": 30}))
sub_page.content += "\n\n"
sub_page.content += colour_print(printer.text_to_ascii("Page Not Found", padding={"left": 2}))
示例5: BusPage
# 需要导入模块: from page import Page [as 别名]
# 或者: from page.Page import title [as 别名]
self.content = content
pages=[]
bus01 = BusPage("801","57596","Gower Street / UCH","N")
bus02 = BusPage("802","50975","Euston Square Station","P")
bus03 = BusPage("803","51664","Euston Station","H")
bus04 = BusPage("804","75100","Euston Station","AZ")
bus05 = BusPage("805","73933","Euston Station","C")
bus06 = BusPage("806","53602","Euston Bus Station","AP")
bus07 = BusPage("807","56230",Foreground.GREEN+"Euston Station"+Foreground.DEFAULT,"D")
bus08 = BusPage("808","47118","Euston Bus Station","G")
bus09 = BusPage("809","58234","Euston Station","E")
bus10 = BusPage("810","51581","Upper Woburn Place / Euston Road","L")
bus11 = BusPage("811","72926","Upper Woburn Place","M")
bus12 = BusPage("812","72238","Jubilee Road","PD")
bus13 = BusPage("813","58812","Jubilee Road","J")
bus14 = BusPage("814","55027","Wembley Park Station","O")
bus15 = BusPage("815","59287",Foreground.GREEN+"Euston Square Station"+Foreground.DEFAULT,"Q")
tv_page = Page("800")
tv_page.content = colour_print(printer.text_to_ascii("Buses Index"))+"\n"
tv_page.title = "Buses Index"
i=0
for page in pages:
tv_page.content+=tv_page.colours.Foreground.RED+page[0]+tv_page.colours.Foreground.DEFAULT+" "+page[1]
if i==1:
tv_page.content += "\n"
else:
tv_page.content += " "*(38-len(page[0]+page[1]))
i = 1-i
示例6: Page
# 需要导入模块: from page import Page [as 别名]
# 或者: from page.Page import title [as 别名]
import os
from page import Page
from colours import colour_print
from printer import instance as printer
page_number = os.path.splitext(os.path.basename(__file__))[0]
sub_page = Page(page_number)
sub_page.title = "I'm a Teapot"
sub_page.in_index=False
sub_page.content = colour_print(printer.text_to_ascii("418", padding={"left": 30}))
sub_page.content += "\n\n"
sub_page.content = """
,o.
c.o8o
([email protected])
/). [email protected]
[email protected]@8. [email protected]@o.. ,.oooo.
`@88`. ,[email protected]@88C'cc:cc`[email protected] ,ooc***"'.:*Oo.
`OCCo8 .OCc**@@[email protected]@[email protected]@[email protected]@**'oCOOoo::.....oo:.o.
8Cooc8 .oocococccc**[email protected]@8**[email protected]@[email protected]@@@8c:o
8c:c:8. .'cocc:c:c:::::c:c:ccocooCoCCOCOO8O888o88' 8*cc8
`8:.:[email protected]@[email protected]:c:::::::c:[email protected]@@8 8o o8
8.. [email protected]@c:c::.:.....:.::c:[email protected]@. ,C:.C;
`8.:[email protected]@cc::.:.. . ..:.::[email protected]@@8 ;C:.o;
*[email protected]::.:.. ..:.::[email protected]@@ ,8C:o8'
`*@[email protected]@[email protected]'occ::.:.. . ..:.::[email protected]@@@*8OC8C'
`88;cocc:c::.:.....:.::c:[email protected]@@[email protected]'
8oooocccc:c:::::::c:[email protected]@@@@[email protected]'
`Coococc:c:c:::::c:c:[email protected]@@[email protected]'
`[email protected]@@@*'
'[email protected]@8
示例7: Page
# 需要导入模块: from page import Page [as 别名]
# 或者: from page.Page import title [as 别名]
import os
from page import Page
from colours import colour_print
from printer import instance as printer
page_number = os.path.splitext(os.path.basename(__file__))[0]
sub_page = Page(page_number)
sub_page.title = "Resource Limit"
sub_page.in_index=False
sub_page.content = colour_print(printer.text_to_ascii("508", padding={"left": 30}))
sub_page.content += "\n\n"
sub_page.content += colour_print(printer.text_to_ascii("Resource Limit Is Reached"))
示例8: Page
# 需要导入模块: from page import Page [as 别名]
# 或者: from page.Page import title [as 别名]
import os
from page import Page
from random import choice
import colours
from colours import colour_print
from printer import instance as printer
page_number = os.path.splitext(os.path.basename(__file__))[0]
sub_page = Page(page_number)
sub_page.title = "Annawards"
sub_page.index_num = "456-457"
content = colour_print(
printer.text_to_ascii("Annawards", padding={"left": 6}))
awards = [
["Boo Cow Annawards",{"Pietro Servini":1,"Stephen Muirhead":1,"Belgin Seymenoglu":2}],
# Tea Wrecks was formerly known as Tea Breaker
["Tea Wrecks Annawards",{"Anna Lambert":1,"Rafael Prieto Curiel":1,"Belgin Seymenoglu":1}],
["Towel Flood Annawards",{"Jigsaw":1,"Belgin Seymenoglu":2}],
["Worst Sorting Hat",{"Anna Lambert":20}],
["Boo Key",{"Anna Lambert":1,"Sam Brown":1,"Rafael Prieto Curiel":1,"Mart Wright":1}],
["Stolen Pen",{"Anna Lambert":1}]
]
pages = ["457","457","458","458","458","458"]
content += "\nWho has the most Annawards?\n\n"
for i,award in enumerate(awards):
content += "\n"+sub_page.colours.Foreground.GREEN+award[0]+sub_page.colours.Foreground.DEFAULT+" (see page "+pages[i]+")\n"
max_ = 0
max_p = None
示例9: colour_me
# 需要导入模块: from page import Page [as 别名]
# 或者: from page.Page import title [as 别名]
import os
import screen
from page import Page
from random import choice
def colour_me(text):
output = ""
for i in text:
output += choice(test_page.colours.Foreground.non_boring) + i
output += test_page.colours.Foreground.DEFAULT
return output
page_number = os.path.splitext(os.path.basename(__file__))[0]
test_page = Page(page_number)
test_page.title = "Test Page"
test_page.is_enabled = False
test_page.content = ""
test_page.content += "\n" + colour_me("TEST PAGE") + "\n"
# 000000011111111112222222222333333333344444444445555555555666666666677777777778
# 345678901234567890123456789012345678901234567890123456789012345678901234567890
#" DEFAULT BLACK RED GREEN YELLOW BLUE MAGENTA CYAN WHITE"
#"BOLD "
#"FAINT "
#"STANDOUT "
#"BLINK "
#"UNDERLINE "
#"STRIKE "
test_page.content += "\n" + colour_me("FOREGROUNDS & STYLES") + "\n"
示例10: Page
# 需要导入模块: from page import Page [as 别名]
# 或者: from page.Page import title [as 别名]
import os
from page import Page
import colours
from printer import instance as printer
r1 = Page("581")
r1.title = "Bad Tempered Cake"
r1.in_index = False
r1.content = (colours.colour_print(
printer.text_to_ascii("bad tempered cake"),
colours.Background.RED,
colours.Foreground.BLUE) +
"""
1/2 lb Rich tea and/or digestive biscuits
4 oz Margarine
1 dsp Sugar
3 dsp Cocoa
3 dsp Drinking chocolate
1 1/2 tbsp Golden syrup
2 oz Sultanas
2 bars Milk chocolate
1. Break the biscuits.
2. Melt the margarine, sugar, cocoa, drinking chocolate and syrup over a medium
heat.
3. Mix with biscuits and sultanas and press down in baking tray.
4. Cover with melted milk chocolate.
5. Leave in the fridge to set""")
r2 = Page("582")
r2.title = "Huda Friendship Cake"
示例11: TrainPage
# 需要导入模块: from page import Page [as 别名]
# 或者: from page.Page import title [as 别名]
train16 = TrainPage("866","Ffairfach","FFA")
train17 = TrainPage("867","London Victoria","VIC")
train18 = TrainPage("868","London Waterloo","WAT")
train19 = TrainPage("869","London Waterloo East","WAE")
train20 = TrainPage("870","Banbury","BAN")
train21 = TrainPage("871","Reading","RDG")
train22 = TrainPage("872","Oxford","OXF")
train23 = TrainPage("873","Stratford-upon-Avon","SAV")
train24 = TrainPage("874","B'ham New Street","BHM")
train25 = TrainPage("875","B'ham Moor Street","BMO")
train26 = TrainPage("876","B'ham Snow Hill","BSW")
train27 = TrainPage("877","Wembley Stadium","WCX")
train28 = TrainPage("878","Kilmarnock","KMK")
train29 = TrainPage("879","Moreton-in-Marsh","MIM")
train30 = TrainPage("880","Ealing Broadway","EAL")
train31 = TrainPage("881","Farringdon","ZFD")
train32 = TrainPage("882","East Croydon","ECR")
train32 = TrainPage("883","St Pancras to East Croydon","STP",to=["Three Bridges","Brighton"])
tv_page = Page("850")
tv_page.content = colour_print(printer.text_to_ascii("Trains Index"))+"\n"
tv_page.title = "Trains Index"
i=0
for page in pages:
tv_page.content+=tv_page.colours.Foreground.RED+page[0]+tv_page.colours.Foreground.DEFAULT+" "+page[1]
if i==1:
tv_page.content += "\n"
else:
tv_page.content += " "*(38-len(page[0]+page[1]))
i = 1-i
示例12: Page
# 需要导入模块: from page import Page [as 别名]
# 或者: from page.Page import title [as 别名]
import os
from page import Page
from colours import colour_print
from printer import instance as printer
page_number = os.path.splitext(os.path.basename(__file__))[0]
sub_page = Page(page_number)
sub_page.title = "Subtitles"
sub_page.content = colour_print(
printer.text_to_ascii("subtitles", padding={"left": 6}))
示例13: Page
# 需要导入模块: from page import Page [as 别名]
# 或者: from page.Page import title [as 别名]
import os
from os.path import join,expanduser
from page import Page
from printer import instance as printer
page_number = os.path.splitext(os.path.basename(__file__))[0]
p_page = Page(page_number)
p_page.title = "House Points"
p_page.index_num = "402-403"
content = p_page.colours.colour_print(printer.text_to_ascii("house points"))
content += "\n\n"
R = p_page.colours.Foreground.RED
G = p_page.colours.Foreground.GREEN
D = p_page.colours.Foreground.DEFAULT
content += G+"Year " + " Gryffindor Slytherin Hufflepuff" + " Ravenclaw Durmstrang Squib Peeves"+D+"\n"
content += G+"2015a"+D+" 692 535 "+R+"1155"+D+" 702 440 513 0\n"
content += G+"2015b"+D+" 3382 408 "+R+"4614"+D+" 3591 606 2174 38\n"
p_page.content = content