本文整理汇总了Python中page.Page.save方法的典型用法代码示例。如果您正苦于以下问题:Python Page.save方法的具体用法?Python Page.save怎么用?Python Page.save使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类page.Page
的用法示例。
在下文中一共展示了Page.save方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: admin_ajax
# 需要导入模块: from page import Page [as 别名]
# 或者: from page.Page import save [as 别名]
def admin_ajax(action):
name = request.forms.name
try:
Validator.check_name(name)
p = Page(name)
if action == 'save':
p.content = request.forms.content
p.save()
elif action == 'publish':
p.publish()
elif action == 'remove':
delall = bool(request.forms.delall)
p.remove(delall)
else:
raise PageError('No such action')
except PageError, e:
return {'status': 'fail', 'data': str(e)}
示例2: Page
# 需要导入模块: from page import Page [as 别名]
# 或者: from page.Page import save [as 别名]
#!/usr/bin/python
import sys
import os
from page import Page
SHOW_STEPS = True # change this to false if you just want to see the final output for each page.
SAVE_OUTPUT = False
inputFolder = os.path.join('../images')
outputFolder = os.path.join('../output')
for filename in os.listdir(inputFolder)[:]:
#for filename in ['page332.jpg', 'page335.jpg']:
inputPath = os.path.join(inputFolder, filename)
outputPath = os.path.join(outputFolder, filename)
page = Page(inputPath, SHOW_STEPS)
if SAVE_OUTPUT:
page.save(outputPath) # save a copy of what is displayed. Used for getting images for the paper.
page.show((800, 800))