From fb86c0f6ca252413f0480ea2dc28edfaba2f3053 Mon Sep 17 00:00:00 2001 From: helmutm Date: Wed, 22 Feb 2006 16:49:37 +0000 Subject: [PATCH] minor improvements: make transaction module available, + help git-svn-id: svn://svn.cy55.de/Zope3/src/cybertools/trunk@1095 fd906abe-77d9-0310-91a1-e0d9ade77398 --- twisted/manhole.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/twisted/manhole.py b/twisted/manhole.py index 0f7b62d..9ce5d92 100644 --- a/twisted/manhole.py +++ b/twisted/manhole.py @@ -33,6 +33,7 @@ try: from zope.app.component.hooks import setSite from zope.app.security.principalregistry import principalRegistry from zope.app import zapi + import transaction hasZope = True except: hasZope = False @@ -70,23 +71,27 @@ class ZopeManagerChecker(object): def printTime(): print 'twisted.manhole running:', time.strftime('%H:%M:%S') - reactor.callLater(60, printTime) + reactor.callLater(600, printTime) class Help(object): def __repr__(self): info = """ - Use dir() to see what variables and functions are available. + Use `dir()` to see what variables and functions are available. """ zopeInfo = """ - You may use x = zapi.traverse(root, 'path/to/object') to get an + You may use `x = zapi.traverse(root, 'path/to/object')` to get an object in your folder hierarchy. Then you may call any method or access any attribute of this object. In order to get access to local utilities and adapters you may - issue a setSite(root). Don't forget to call setSite() before + issue a `setSite(root)`. Don't forget to call `setSite()` before finishing your session in order to reset this setting. + + If you change an object stored in the ZODB you should issue a + `transaction.commit()` to make your changes permanent or a + `transaction.abort()` to undo them. """ return info + (hasZope and zopeInfo or '') @@ -108,7 +113,7 @@ def startup(event=None, port=5001): d.update(locals()) namespace = {} for key in ('__builtins__', 'connection', 'event', 'setSite', 'hasZope', - 'zapi', 'root', '__doc__', 'help'): + 'zapi', 'transaction', 'root', '__doc__', 'help'): if key in d: namespace[key] = d[key] # TODO: get admin password from somewhere else or use a real checker.