plone的html和javascript进度条
collective.progressbar的Python项目详细描述
集合.progressbar
这个产品为plone提供了一个基本的html和javascript进度条 对于长时间运行的服务器端进程(如导入或 出口。
要使用它,您只需触发两个事件。第一件事 初始化进度条视图:
from collective.progressbar.events import InitialiseProgressBar from collective.progressbar.events import ProgressBar title = 'Importing file' bar = ProgressBar(self.context, self.request, title) notify(InitialiseProgressBar(bar))
上面的progressbar类可以接受可选的视图参数 希望自定义进一步呈现进度条的视图。你 只需在自定义视图中包含progressbar宏。
要更新进度,您只需启动相应的事件:
from collective.progressbar.events import UpdateProgressEvent from collective.progressbar.events import ProgressState for index in range(101): progress = ProgressState(self.request, index) notify(UpdateProgressEvent(progress))
要查看进度条的工作方式,请安装包并浏览到 演示视图例如:http://localhost:8080/plone/@@collective.progressbar-demo
更改日志
0.5-2009-09-18
- 初始版本