用于zope应用程序管理的错误实用程序

zamplugin.control的Python项目详细描述


这个包为zam(zope 3)提供了不同的服务器控制视图 应用程序管理)。

CHANGES

0.6.1 (2011-02-04)

  • app.zcml 当 使用此插件。

0.6.0 (2011-02-03)

  • 更新了测试设置、测试和演示应用程序以使用ztk 1.0运行,因此 要求zam.api>;=0.7。
  • 取决于zope.applicationcontrol,而不是 zope.app.applicationcontrol

0.5.0 (2008-04-14)

  • 初次发布。

README

此包提供服务器控件管理。皮肤被用作 测试的基本皮肤。

首次以管理员身份登录:

>>> from zope.testbrowser.testing import Browser
>>> mgr = Browser()
>>> mgr.addHeader('Authorization', 'Basic mgr:mgrpw')

检查是否可以在不安装插件的情况下访问管理命名空间:

>>> rootURL = 'http://localhost/++skin++ZAM'
>>> mgr.open(rootURL + '/++etc++ApplicationController')
Traceback (most recent call last):
HTTPError: HTTP Error 404: Not Found

如您所见,没有真正可用的页面,只有 显示以下消息的外观配置:

>>> 'The page you are trying to access is not available' in mgr.contents
True

转到站点根目录下的插件页:

>>> mgr.open(rootURL + '/plugins.html')
>>> mgr.url
'http://localhost/++skin++ZAM/plugins.html'

并安装内容插件:

>>> mgr.getControl(name='zamplugin.control.buttons.install').click()
>>> print mgr.contents
<!DOCTYPE ...
...
<div id="content">
      <form action="./plugins.html" method="post" enctype="multipart/form-data" class="plugin-form">
  <h1>ZAM Plugin Management</h1>
  <fieldset id="pluginManagement">
    <strong class="installedPlugin">Server control plugin</strong>
    <div class="description">ZAM Control plugin.</div>
...

现在您可以看到站点根目录下有管理命名空间:

>>> mgr.open(rootURL + '/++etc++ApplicationController')
>>> print mgr.contents
<!DOCTYPE ...
 ...
 <div id="content">
   <div class="row">
     <div class="label">Uptime</div>
     ...
   </div>
   <div class="row">
     <div class="label">System platform</div>
     ...
   </div>
   <div class="row">
     <div class="label">Zope version</div>
     ...
   </div>
   <div class="row">
     <div class="label">Python version</div>
     ...
   </div>
   <div class="row">
     <div class="label">Command line</div>
     ...
   <div class="row">
     <div class="label">Preferred encoding</div>
     ...
   </div>
   <div class="row">
     <div class="label">FileSystem encoding</div>
     ...
   </div>
   <div class="row">
     <div class="label">Process id</div>
     ...
   </div>
   <div class="row">
     <div class="label">Developer mode</div>
     <div class="field">On</div>
   </div>
   <div class="row">
     <div class="label">Python path</div>
     ...
     </div>
   </div>
    </div>
  </div>
</div>
</body>
</html>

zodb控件页允许您打包数据库并显示当前 数据库大小:

>>> mgr.open(rootURL + '/++etc++ApplicationController/ZODBControl.html')
>>> print mgr.contents
<!DOCTYPE ...
...
<div>
  <form action="http://localhost/++skin++ZAM/++etc++ApplicationController/ZODBControl.html"
        method="post">
  <div class="row">
    <table border="1">
        <tr>
          <th>Pack</th>
          <th>Utility Name</th>
          <th>Database Name</th>
          <th>Size</th>
        </tr>
        <tr>
          <td>
            <input type="checkbox" name="dbs:list"
                   value="unnamed" />
          </td>
          <td>
            unnamed
          </td>
          <td>
            Demo storage 'unnamed'
          </td>
          <td>
            2 KB
          </td>
        </tr>
    </table>
    <div class="row">
      <span class="label">Keep up to</span>
      <span class="field">
        <input type="text" size="4" name="days" value="0" />
        days
      </span>
      <div class="controls">
        <input type="submit" name="PACK" value="Pack" />
      </div>
    </div>
  </div>
  </form>
</div>
...

“生成”页显示挂起的生成,并已列出 已处理的生成步骤:

>>> mgr.open(rootURL + '/++etc++ApplicationController/generations.html')
>>> print mgr.contents
<!DOCTYPE ...
...
<div id="content">
  <span>Database generations</span>
<form action="http://localhost/++skin++ZAM/++etc++ApplicationController/generations.html">
<table border="1">
<tr>
    <th>Application</th>
    <th>Minimum Generation</th>
    <th>Maximum Generation</th>
    <th>Current Database Generation</th>
    <th>Evolve?</th>
</tr>
<tr>
    <td>
      <a href="generationDetails.html?id=zope.app">zope.app</a>
    </td>
    <td>1</td>
    <td>5</td>
    <td>5</td>
    <td>
       <span>No, up to date</span>
    </td>
</tr>
</table>
</form>
...

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
spring JSTL:绝对uri:http://java.sun.com/jsp/jstl/core无法在两个站点中解析。xml或与此应用程序一起部署的jar文件   java在Junit测试中找不到失败的符号   java为什么在没有同步块的情况下调用wait()、notify()或notifyAll()不是编译器错误?   使用onDraw()绘制多个位图的java Android在曲面视图上放大缩小画布   在java中比较args值和字符串   java更改文件中的特定字节   java TransformerFactory破坏<html>标记中的<input>和<br>标记   azure appinsights java自定义指标不起作用   Java泛型在实现接口的类上指定上界,接口本身指定上界   java AS400 prog和动态类路径   java应用程序截图时收到空消息   java无法从片段中获取上下文   找不到java配置单元UDF类   linux是一个提供java的接口。lang.NoClassDefFoundError   java如何使用面向对象建模创建此数据库