[Zope] [ANN] zshell: The Zope Shell
Jerome Alet
alet@unice.fr
Thu, 3 May 2001 12:05:44 +0200 (MET DST)
This message is in MIME format. The first part should be readable text,
while the remaining parts are likely unreadable without MIME-aware tools.
Send mail to mime@docserver.cac.washington.edu for more info.
--889292347-2026565306-988884344=:31564
Content-Type: TEXT/PLAIN; charset=US-ASCII
Hi there,
I'm pleased to announce you the Zope Shell version 0.001.
The Zope shell is a GPLed Python Script which makes some of the most
commonly used unix shell commands available from within Zope, to manage
the ZODB contents. You'll find this 155 lines script attached to this
message.
As for the 0.001 version which is attached to this message, the following
commands are recognized: cd, cp, mv, rm, ls
there are some restrictions however, and it doesn't seem to work with
absolute paths, read the source for details and the future commands.
zshell accepts an unlimited number of commands to launch in a single Zope
transaction, so feel free to combine these five commands to do some very
complicated stuff. Despite its current limitations it works fine here on
Zope 2.3.2+Hotfix0501.
Please feel free to send me any comment about this software.
Such similar functionnality included in Zope's core would make me VERY
happy.
hoping this helps.
Jerome Alet - alet@unice.fr
--889292347-2026565306-988884344=:31564
Content-Type: TEXT/PLAIN; charset=US-ASCII; name="zshell.py"
Content-Transfer-Encoding: BASE64
Content-ID: <Pine.LNX.3.96.1010503120543.31564B@cortex.unice.fr>
Content-Description:
IyMgU2NyaXB0IChQeXRob24pICJ6c2hlbGwiDQojI2JpbmQgY29udGFpbmVy
PWNvbnRhaW5lcg0KIyNiaW5kIGNvbnRleHQ9Y29udGV4dA0KIyNiaW5kIG5h
bWVzcGFjZT0NCiMjYmluZCBzY3JpcHQ9c2NyaXB0DQojI2JpbmQgc3VicGF0
aD10cmF2ZXJzZV9zdWJwYXRoDQojI3BhcmFtZXRlcnM9DQojI3RpdGxlPVRo
ZSBab3BlIFNoZWxsDQojIw0KIyB6c2hlbGwgLSAoYykgMjAwMSBKZXJvbWUg
QWxldA0KIw0KIyBZb3UncmUgd2VsY29tZSB0byByZWRpc3RyaWJ1dGUgdGhp
cyBzb2Z0d2FyZSB1bmRlciB0aGUNCiMgdGVybXM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