Re: [Zope] [ANN] ZShell 0.2
Jerome Alet" <alet@unice.fr> wrote:
If you're interested I've put a 0.3 online at:
This gets better all the time :-) I have learned so much already, just looking through your source. It makes a great Zope tutorial in unexpected ways. Thanks.
new commands: mkver, enter, leave, save, discard (versions) and the powerful but not used at its full power until variables are checked in: the "call" command !
there are also many bug fixes and the possibility to call the method with a zshellscript argument containing the list of commands to execute.
Can you give an example to do this please. .................................... More wishlist suggestions for Zshell. <note> I aplologize only a little for this experiment in blatant featuritis. In many cases this is not rocketscience, but a apprades to be a matter of writing smart user-friendly wrappers around known zope tricks. The shell paradigm is very good and does nto really interfere with the nature of zope. Perhaps those with deeoper zen than me will see the catch. I beleive many of the practical workflow headaches of using Zope among different people[skills], can be solved by growing the Zope shell. It separates function from syntax in a very simple way. Logic is another question... If nothing else, I suspect zopeshell is more concise, and readable to more people out of the box. Also very extendable. A fascinating and useful experiment imho. </note> --------------------------- 1. MORE SHELL-LIKE BEHAVIOR I keep hitting return and expecting my code to happen. It's not just laziness. The RUN button breaks the familiar shell command line paradigm. I realise it is nice to have multiple lines, but I find it faster to type and keep typing, than have to jump back and forth to the mouse. One solution: SHIFT + ENTER => multiline entry ENTER => execute ----------------------------- 2. ZSHELL DTML UI SUGGESTIONS At the top of the page include all the wget commands as hyperlinks links. Clicking on a command displays the docstring for the command above/below the text area and also enters the comand and dummy argument string directly into the Zshell shell where one may edit. A checkbox option next to the textarea toggles the 'auto_insert' feature 'on' or 'off'. 'Off' displays just the docstring for the clicked command above the text area This kind of behavior and its display should be defined in any .zrc file and should be able to be invoked in the zshell. Thus display_commands # show hyperlinked zshell commands above text area auto_insert_off # jsut the man docstring auto_insert_on # insert commands and dummy args save_zrc [name] # save the present zshell dtml UI into .zrc file # [zodb/tinytable/properties?] load_zrc [name] # load a .zrc conifiguration DTML + ZSHELL Add a new tag so that Zshell commands can be run from DTML A trivial example might go like this: <dtml-zshell> mkdir ../artists/$newartist cd ../artists/$newartist adduser $newartist/QWERTY mkdir newprojects/outline wget http://www.newsartists_website.org/work/outline pwd ls </dtml-zshell> This would create a new folder for the value of $newartist, a [yet to implemented] zopeshell variable, which can also passed in by a form or some DTML Then add a newuser, and then upload load some HTML+graphics they already have prepared online somewhere else. ------------- 3. RESULTS Normal shell would return the results in the shell itself. I can see why in Zope this may not be often such a good idea. For example, making ls return a hypelinked table as you do is terrific idea. But I found that I quickly needcd to jump back and forth between repeat commadnds when usign zshell. What I was missing was being able to scroll up and down a familair shell windows, browse and cut''n'paste. A possible solution: Allow one to concatentate results to allow a single long scrolling one. This could be a callable 'zhell_session_RESULTS' DTMLmethod. I think this would allow one to be even more prodcutive in using Zshell to explore and manage a Zopesite. Presumably RESULTS connected to the machanism for history you are working on... As above, one shouldbe able to configure this from the shell and/or .zrc: RESULTS_join RESULTS_single RESULTS_off RESULTS_save [name] RESULTS_load [name] I suppose addressable RESULTS are instrinsic to any piping mechanism... and thus wildcards, 'ls', 'cp' etc.. ------------------ 4. cd Seems a little inconsistent at the moment partly becuase it does not resolve "/" I have a zshell in zope root "/" cd . Results: cd: New folder is / cd /images Results: cd: Incorrect path /images WARNING: Errors were encountered but cd images Results: cd: New folder is /images Both of the above should be valid. Perhaps you disagree.. Also for any CD command which is not valid, I suggest including a 'pwd' by default in the first line of the Results error message: <zshell> cd happy </zshell> Results: cd: Incorrect path happy WARNING: Errors were encountered --------------------- 5. mkdir improvements mkdir to handle a path option to complement cd from above mkdir needs option flags to match the manual setting in ZMI of the 2 checkboxes for Create public interface Create user folder mkdir newfolder -(p)ublic -(u)ser Not sure what syntax would be best for doing this when creating a nested mkdir: mkdir a/b/c/d -(p)ublic -(u)ser possibly: :set public+user attributes for all new folders :set public+user attributes for just the last folder Perhaps control it using a simple binary flag style. For example: mkdir a/b/c/d -p0110 -u1110 Set 'public' b and c only Add 'user' folders in a,b,c only -------------------- 6. cp Of course 'cp' should work across folders and also be able to paste in one line. Perhaps a lot of work. I don't know. And I hope zope acquisition logic does not mangle this. Needs to include wildcards of course cp ../../images/earthrise.jpg ../graphics/earthrise.jpg -------------------- 9. wildcards Obviously full Shell-type regular expressions, though desirable, might be a big deal. Some useful, obvious ones for ZopeShell wishlist whcih might be much easier I can think of: * *meta *date *date_since *date_before *size_under *size_over *owner *property Examples of wildcards using ls: ls *.jpeg # object whose names end with ".jpeg" ls *meta='Image' # objects of meta_type 'Image' ls *date='06-May-2001' # objects made on 6th May, 2001 ls *date='today' # object made today ls *date_since='01-05-2001' # objects made since 5th January ls *date_before='01-05-2001' # objects made before 5th January ls *size_under='50kb' # objects less than 50kb ls *size_over='500kb' # objects larger than 500kb ls *owner='nikola' # objects owned by nikola ls *property='description' # objects with a description property -------------------- 8. wget Very useful for all kinds of things Change the 'fname' code so that the default behavior is to save names under their original source names. If that id is already taken, then take action and rename. Include an flag for Zope wget to do auto renaming [like it is now]. syntax could perhaps be: wget args rename_meta # rename to append meta tag wget args rename_sub # rename to append subtype wget args rename_xyz # rename to apend _xyz # where _xyz are any continuous suffix string, "_bak" etc. 7. adduser This is going to be very cool but, meanwhile I am not not clear what to 'do' with adduser. At least until there is a Zshell mechanism to get and set permissions, and then pass them to the add user command. I confess I don't really understand Local Roles in Zope either yet :-( ..so I better shut just up and do some more homework.
* I can't make chown to work, do you have got any idea ? not yet..
cheers ./Jason ___________________________________________________________ Jason CUNLIFFE = NOMADICS['Interactive Art and Technology']
ouch sorry typo:
2. ZSHELL DTML UI SUGGESTIONS At the top of the page include all the wget commands as hyperlinks links. ^^^^ should be
2. ZSHELL DTML UI SUGGESTIONS At the top of the page include all the 'zshell' commands as hyperlinks. ./Jason
On Mon, 7 May 2001, Jason Cunliffe wrote:
Jerome Alet" <alet@unice.fr> wrote:
If you're interested I've put a 0.3 online at:
This gets better all the time :-)
I have learned so much already, just looking through your source. It makes a great Zope tutorial in unexpected ways. Thanks.
This was also unexpected !
new commands: mkver, enter, leave, save, discard (versions) and the powerful but not used at its full power until variables are checked in: the "call" command !
there are also many bug fixes and the possibility to call the method with a zshellscript argument containing the list of commands to execute.
Can you give an example to do this please.
just do something like: <UNTESTED> <dtml-let result="zshell(_, zshellscript=["mkdir foo/bar"])"> <dtml-if "result == 0"> All worked fine <dtml-else> An error occured </dtml-if> </dtml-let> </UNTESTED> When called like that, it returns only the status code of the result: 0 = no error other = errors occured
1. MORE SHELL-LIKE BEHAVIOR
I keep hitting return and expecting my code to happen. It's not just laziness. The RUN button breaks the familiar shell command line paradigm. I realise it is nice to have multiple lines, but I find it faster to type and keep typing, than have to jump back and forth to the mouse.
One solution: SHIFT + ENTER => multiline entry ENTER => execute
Don't know how to do it, but this will probably need some javascript at which my value is 0 or less. If someone can help... NB: I want it to also work fine with Lynx.
----------------------------- 2. ZSHELL DTML UI SUGGESTIONS At the top of the page include all the zshell commands as hyperlinks links. Clicking on a command displays the docstring for the command above/below the text area and also enters the comand and dummy argument string directly into the Zshell shell where one may edit.
Again will probably at least partially need some javascript.
DTML + ZSHELL
Add a new tag so that Zshell commands can be run from DTML
Interestingly we want the same things :-) Not in my priority list, but definitively needed.
3. RESULTS Normal shell would return the results in the shell itself. I can see why in Zope this may not be often such a good idea. For example, making ls return a hypelinked table as you do is terrific idea.
The new version will support at least partially pseudo standard I/O streams stdin, stdout, and stderr which contents will be retrievable. This is a necessity for piping anyway. The HTML result will be another retrievable I/O stream. I think in the future zshell will return an instance of the class I define. The code is in heavy lifting right now, so don't expect a new version quick.
4. cd Seems a little inconsistent at the moment partly becuase it does not resolve "/" I have a zshell in zope root "/"
it's better with every version, but still not perfect. My toObject() method sucks great.
Perhaps you disagree..
not at all, but I was unable to write something decent.
Also for any CD command which is not valid, I suggest including a 'pwd' by default in the first line of the Results error message:
easy.
mkdir a/b/c/d -(p)ublic -(u)ser
possibly: :set public+user attributes for all new folders :set public+user attributes for just the last folder
Perhaps control it using a simple binary flag style. For example:
mkdir a/b/c/d -p0110 -u1110
Set 'public' b and c only Add 'user' folders in a,b,c only
not very user friendly IMHO, but at least solves the problem in an elegant way. -p and -u will have to be the first parameters since mkdir accepts multiple arguments.
6. cp
Of course 'cp' should work across folders and also be able to paste in one line.
agreed
9. wildcards Some useful, obvious ones for ZopeShell wishlist whcih might be much easier I can think of:
* *meta *date
no because *'s semantic MUST mean: any object id which ends in meta, date, etc... if we want to be consistent with the shell normal behavior
8. wget
Very useful for all kinds of things Change the 'fname' code so that the default behavior is to save names under their original source names. If that id is already taken, then take action and rename.
ok, but . in ids is not a good idea in Zope/Python.
Include an flag for Zope wget to do auto renaming [like it is now]. syntax could perhaps be:
wget args rename_meta # rename to append meta tag wget args rename_sub # rename to append subtype wget args rename_xyz # rename to apend _xyz # where _xyz are any continuous suffix string, "_bak" etc.
I don't like it.
7. adduser
This is going to be very cool but, meanwhile I am not not clear what to 'do' with adduser.
add many user in one line.
At least until there is a Zshell mechanism to get and set permissions, and
will come soon. bye, and thanks for your support. PS: perhaps I should set up a mailing list somewhere to not waste Zope's one bandwidth, what do you think ? Jerome Alet
Jerome Alet <alet@unice.fr> writes:
PS: perhaps I should set up a mailing list somewhere to not waste Zope's one bandwidth, what do you think ?
NO! my ornery 2c for today. :) Using [zshell] in the subject is another option. And on that subject.. Mailing List Admin - I hereby request that [Zope], [Zope-dev] etc. be dropped from all subjects as they aren't useful. Best regards -Simon
And on that subject.. Mailing List Admin - I hereby request that [Zope], [Zope-dev] etc. be dropped from all subjects as they aren't useful.
No! my ornery 2c for today ( if we all get a free one :) ) These are useful to many people to parse through the lists. -- Andy McKay. ----- Original Message ----- From: "Simon Michael" <simon@joyful.com> To: <zope@zope.org> Sent: Monday, May 07, 2001 12:22 PM Subject: Re: [Zope] [ANN] ZShell 0.2
Jerome Alet <alet@unice.fr> writes:
PS: perhaps I should set up a mailing list somewhere to not waste Zope's one bandwidth, what do you think ?
NO!
my ornery 2c for today. :)
Using [zshell] in the subject is another option.
And on that subject.. Mailing List Admin - I hereby request that [Zope], [Zope-dev] etc. be dropped from all subjects as they aren't useful.
Best regards -Simon
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
I disagree, Simon. I find the [Zope], [Zope-dev] etc. strings in the subject line very useful. I use them in code that sorts my incoming mail messages into specific folders. Yes, I'm being selfish and lazy so that I don't have to rewrite my sorting code. :) Eric.
-----Original Message----- From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of Simon Michael Sent: Monday, May 07, 2001 12:23 PM To: zope@zope.org Subject: Re: [Zope] [ANN] ZShell 0.2 <snip...> And on that subject.. Mailing List Admin - I hereby request that [Zope], [Zope-dev] etc. be dropped from all subjects as they aren't useful.
Best regards -Simon
On Mon, May 07, 2001 at 01:12:33PM -0700, Eric Walstad wrote:
I use them in code that sorts my incoming mail messages into specific folders. Yes, I'm being selfish and lazy so that I don't have to rewrite my sorting code. :)
Personally, I'd just as soon drop the [Zope] prefix on all the list messages. The only reason I use them at all is to identify when some yahoo sticks the mailing list address in a Bcc: or something similar (ending up in my main inbox), which accounts for <1% of all the Zope mail I get. -- Mike Renfro / R&D Engineer, Center for Manufacturing Research, 931 372-3601 / Tennessee Technological University -- renfro@tntech.edu
Ha! *Surely* all today's email clients and custom scripts can sort based on the address. Those that can't, I would say are a very small number, and if someone must be inconvenienced, should it not be them as opposed to the vast majority who see a superfluous header on every single message, which obscures real information and obstructs the useful [subtopic] convention ? I'm right. Go on. Isn't it my turn to be right today ? :) -Simon
On 7 May 2001, Simon Michael wrote:
Jerome Alet <alet@unice.fr> writes:
PS: perhaps I should set up a mailing list somewhere to not waste Zope's one bandwidth, what do you think ?
NO!
my ornery 2c for today. :)
Using [zshell] in the subject is another option.
And on that subject.. Mailing List Admin - I hereby request that [Zope], [Zope-dev] etc. be dropped from all subjects as they aren't useful.
We had this debate about ten years ago (internet time). The result of that debate is obvious. Let's let dead dogs lie. -Michel
Michel Pelletier <michel@digicool.com> writes:
We had this debate about ten years ago (internet time). The result of that debate is obvious. Let's let dead dogs lie.
Hi Michel, oops - wasn't aware this was a dog. (I might have forgotten). Naturally until I see a good counter-argument from someone I'll continue to think the current setup is broken.* It looks as if you want to squelch this thread, but it would have been nice to discuss this a little longer. We might have found out more about what the current consensus is (we had 2 for & 2 against); why people find it useful; who's decision it is one way or another; etc.
From time to time I see discussions around here which seem well within bounds of reasonable tone and topic, and which interest at least some of the list membership, which "DC" seems to feel it must stamp on.
So I'll take the opportunity to ask: does DC officially frown on eg threads like this one ? -Simon * a technical term. "Not as good as it could and should be IMHO".
Simon Michael <simon@joyful.com> writes:
From time to time I see discussions around here which seem well within bounds of reasonable tone and topic, and which interest at least some of the list membership, which "DC" seems to feel it must stamp on.
PS "stamp on" isn't meant as a pejorative, nor is this message intended as criticism of anyone. I'm asking if the above perception is a mistaken one, with intent to clarify a murky issue and strengthen these lists. Thanks --SM
On 9 May 2001, Simon Michael wrote:
Michel Pelletier <michel@digicool.com> writes:
We had this debate about ten years ago (internet time). The result of that debate is obvious. Let's let dead dogs lie.
Hi Michel,
oops - wasn't aware this was a dog. (I might have forgotten). Naturally until I see a good counter-argument from someone I'll continue to think the current setup is broken.*
Of course.
It looks as if you want to squelch this thread, but it would have been nice to discuss this a little longer. We might have found out more about what the current consensus is (we had 2 for & 2 against); why people find it useful; who's decision it is one way or another; etc.
I didn't want to squelch it, I was just giving you my opinion. You and everyone else are welcome to continue to discuss it and you don't need my consent or permission to do so.
From time to time I see discussions around here which seem well within bounds of reasonable tone and topic, and which interest at least some of the list membership, which "DC" seems to feel it must stamp on.
So I'll take the opportunity to ask: does DC officially frown on eg threads like this one ?
Not at all. Absolutely nothing that I say on this list is the opinion of Digital Creations. -Michel
participants (7)
-
Andy McKay -
Eric Walstad -
Jason Cunliffe -
Jerome Alet -
Michel Pelletier -
Mike Renfro -
Simon Michael