当前位置: 首页>>代码示例>>Python>>正文


Python Resources.get_about方法代码示例

本文整理汇总了Python中resources.Resources.get_about方法的典型用法代码示例。如果您正苦于以下问题:Python Resources.get_about方法的具体用法?Python Resources.get_about怎么用?Python Resources.get_about使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在resources.Resources的用法示例。


在下文中一共展示了Resources.get_about方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: Resources

# 需要导入模块: from resources import Resources [as 别名]
# 或者: from resources.Resources import get_about [as 别名]
from resources import Resources
import io
from flask import render_template
from flask import Flask

resources = Resources()
resources.init()
app = Flask(__name__)
with app.app_context():
    with io.open('index.html', 'w') as output:
        output.write(render_template("archives.html", posts=resources.posts(), title="archives"))

    with io.open('archives.html', 'w') as output:
        output.write(render_template("archives.html", posts=resources.posts(), title="archives"))

    with io.open('about.html', 'w') as output:
    	post = resources.get_about()
        output.write(render_template("post.html", post=post, title="about"))

    with io.open('notes.html', 'w') as output:
        post = resources.get_note()
        output.write(render_template("post.html", post=post, title="notes"))

    with io.open('categories.html', 'w') as output:
        output.write(render_template("categories.html", categories=resources.categories(), title="categories"))

    for post in resources.posts():
        with io.open('archives/' + post.link, 'w') as output:
            output.write(render_template("post.html", post=post, title=post.title))
开发者ID:luoluo,项目名称:luoluo.github.com,代码行数:31,代码来源:static_main.py


注:本文中的resources.Resources.get_about方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。