本文整理汇总了Python中lxml.html.builder.E.p方法的典型用法代码示例。如果您正苦于以下问题:Python E.p方法的具体用法?Python E.p怎么用?Python E.p使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类lxml.html.builder.E
的用法示例。
在下文中一共展示了E.p方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: build_title_content
# 需要导入模块: from lxml.html.builder import E [as 别名]
# 或者: from lxml.html.builder.E import p [as 别名]
def build_title_content(self):
self.elements.content.extend([
E.p('''Wuff Signal allows you to share messages without revealing
the contents of your message. It lossily scrambles your message
and shows them as points on the page. These points are called
Signals.
'''),
E.p('You can view a ', E.a('complete list of recent Signals',
href=self.handler.reverse_url('textshow.recent')), '.'),
])
self.add_footer()
示例2: index
# 需要导入模块: from lxml.html.builder import E [as 别名]
# 或者: from lxml.html.builder.E import p [as 别名]
def index(self):
return E.div(
E.p(E.a("Cards", href="/get_all_card")),
E.p(E.a("Sip Buddies", href="/get_all_sip_buddy")),
E.p(E.a("Extensions", href="/get_all_extension")),
)
示例3: main
# 需要导入模块: from lxml.html.builder import E [as 别名]
# 或者: from lxml.html.builder.E import p [as 别名]
def main():
# TODO: combine command-line and option file.
# TODO: option to generate a default configuration file
parser = argparse.ArgumentParser() # TODO: doc
parser.add_argument("-s", "--standalone", action="store_true") # TODO: doc
args = parser.parse_args()
standalone = args.standalone
conf = json.load((DATA / "artdoc.js").open())
if Path("artdoc.js").exists():
user_conf = json.load(Path("artdoc.js").open())
conf.update(user_conf)
info("Document:")
doc_patterns = conf["doc"]
if isinstance(doc_patterns, basestring):
doc_patterns = [doc_patterns]
docs = []
for pattern in doc_patterns:
matches = list(WORKDIR.glob(pattern))
#subinfo("matching {!r}:".format(pattern))
for match in matches:
subinfo(str(match))
docs.extend(matches)
if not docs:
sys.exit("error: no document found")
# info("HTML template:")
# template_file = HTML / "index.html"
# subinfo(str(template_file))
# template = template_file.open().read().encode("utf-8")
info("Bibliography:")
bib_patterns = conf["bib"]
if isinstance(bib_patterns, basestring):
bib_patterns = [bib_patterns]
bibs = []
for pattern in bib_patterns:
matches = list(WORKDIR.glob(pattern))
#subinfo("matching {!r}:".format(pattern))
for match in matches:
subinfo(str(match))
bibs.extend(matches)
if not bibs:
print()
info("JS:")
cmd = coffee["-c", str(JS / "main.coffee")]
subinfo(cmd)
cmd()
info("CSS:")
cmd = stylus[str(CSS / "style.styl")]
subinfo(str(cmd))
cmd()
# TODO: copy only what is required.
shutil.copytree(str(DATA), str(ARTDOC))
for doc in docs:
pass
info("PANDOC: generate JSON file")
args = ["-t", "json", "--smart"]
for bib in bibs:
args.extend(["--bibliography", str(bib)])
args.append(str(doc))
cmd = pandoc[args]
subinfo(cmd, "> json")
json_str = cmd()
info("Convert raw TeX to raw HTML")
cmd = local[str(BIN / "rawHTML.hs")]
subinfo(cmd, "< json > json")
json_str = (cmd << json_str)()
# info("Flag/Box Proofs")
# cmd = local[str(BIN / "proof.hs")]
# subinfo(cmd, "< json > json")
# try:
# json_str = (cmd << json_str)()
# except Exception as error:
# print(repr(error))
# info("Wrap Section-Like Sequence of Blocks")
# cmd = local[str(BIN / "div.hs")]
# subinfo(cmd, "< json > json")
# try:
# json_str = (cmd << json_str)()
# except Exception as error:
# print(repr(error))
info("Wrap Section-Like Sequence of Blocks")
cmd = local[str(BIN / "section.hs")]
subinfo(cmd, "< json > json")
try:
json_str = (cmd << json_str)()
except Exception as error:
print(repr(error))
#.........这里部分代码省略.........