[Zope] [ANN] zshell: The Zope Shell

Jerome Alet alet@unice.fr
Thu, 3 May 2001 14:42:11 +0200 (MET DST)


On Thu, 3 May 2001, Jason Cunliffe wrote:

> > I'm pleased to announce you the Zope Shell version 0.001.
> 
> That is beautiful!!

Thanks a lot !

I've desesperatly searched for something like that on zope.org this
morning but without luck, so I've written my own :-)

I was surprised to not find anything similar.
 
> Using 'ls' in Zope makes one thing about what it is in new ways.. its an
> interesting paradigm mapping.  It would be nice to show depth and complexity
> via 'ls'
> 
> Similar to ls -la etc..

it was just a first shot. expect it to be more complex/powerful soon.

> Piping would be cool..

YES it would !

> 'grep' would be lovely too

yes but without re it will be either difficult or not powerful.
I suppose I'll recode all in a Python Zope product, which wouls solve the
problem.

> Now playing with your new shell really makes me wonder serisouly about Zope
> interpreter. One can use python to but not at the same time as Zope is
> running. So I gguess the reick woudl be to harness the two ideas. Youtrs is
> cool becuae the semantic is well understood [up to a point] In zope it takes
> a long time to gather a familiar consistent vocabulary, and it still lacks
> the concise simplicity of shellscripts.
> 
> I wonder if there if there's some meaningful way to integrate your 'jaxml'
> code into all this. So that one can create xml on the fly inside of the
> environemnt it is describing. I have played with jaml a little as a means to
> create Zopescripts and then tested with various XML parsing tools in Zope.

Not done that yet, but was thinking to do something like an
AutoXMLDocument with jaxml (http://cortex.unice.fr/~jerome/jaxml/), a
document which creates its own tags on demand. 

> It is very boring to click on all those 'OK' buttons and watch the HTML

YES it is, that's why I've made the previous feature request yesterday,
and coded ZopeShell today.

> screen keep redrawing. Sitting with potential clients for Zopesites really
> brings this home, I notice that what one really wants to do is take a few
> lines of compact code and immediately generate the named folders with simple
> properties, and dummy dethods/documents etc. Saves lots of Time add and very
> useful templating and Zope design asset.

I think we need some basic zshell commands:

the five following commands already work:

	ls	to list objects
	cp	to copy objects
	mv	to move objects (which should work to rename things too
                                 but doesn't yet)
	rm	to delete objects
	cd	(should a cd to a non ObjectManager object be allowed ?
		probably yes if we want to use grep on its contents ;-) 

it would be very nice to have:

	grep	to search in objects contents

	cut	(not the Unix cut command, think about cut&paste)
	copy
	paste

	id	(return the id of the current object)
	title	(return the title of the current object)
	prop 	return some or all properties for the current object 
		(id and title are just shortcuts)

	chmod   to change permissions
	takeown	to take ownership, since changing it is impossible AFAIK

	view	to view the object
	edit	to edit it
	tab	to access a specific tab for the object
		(view and edit are just shortcuts) 	

	find	to search for objects

Some things to also have:

	piping
	wildcards
	the use of '.' or preferably '->' (no confusion with some ids)
		to access objects' attributes e.g.: 
			grep foo *->someproperty
		would search for string 'foo' in all objects's property
		named someproperty.

And somewhere in the future: if and for !!!

Any comments or more commands needed ? Feel free to send them.

I'm curently reorganising zshell's source, expect something more complete
soon.

bye, and thanks for the feedback.

Jerome Alet