You are not logged in Log in Join
You are here: Home » Members » jerome_alet » ZShellScripts » swpackage_view

Log in
Name

Password

 
 

ZShellScripts

ZShellScripts

The Grand Unification Theory :

Why would Zope only support Python Scripts ?

Install ZShellScripts instead.

This will allow you to add your own languages interpreters, and even define your own language syntax. Here's how :

  1. - Create a Shell instance somewhere. Several types of Shell instances are currently provided :
    • Shell (Python) -- Can execute standard Zope Python Scripts. Code was shamelessly borrowed from Zope 2.5.1
    • Shell (Unix) -- Can execute real Unix commands as the user Zope is run as. The commands are executed at the underlying OS level.
    • Shell (Lisp) -- Can execute Lisp scripts in the PyLisp dialect.
    • Shell (Perl) -- Can execute Perl scripts as the user Zope is run as.
    • Shell (PHP) -- Can execute PHP scripts as the user Zope is run as.
    • Shell (Zope) -- Can (will soon) execute Zope ZShell commands. This part is currently not working but be sure you'll get it soon !!!
  2. - Create a "Script (ZShell)" instance, and put the path to your Shell instance on its first line in the usual Unix shell scripts way :

    #! /path/to/myshell (this path represents a path inside the ZODB)

  3. - Put content in your ZShellScript instance, for example put Python code in it if the shell you use is an instance of "Shell (Python)", or Unix shell commands if it is an instance of "Shell (Unix)"
  4. - Run your "Script (ZShell)" instance as usual, as if it was a standard Zope Python Script for example.

    Launching your instance, will in fact delegate the code execution to the Shell instance which path you specified on the first line of your "Script (ZShell)" instance.

    The REQUEST's contents, as well as the variables usually available in native Python Scripts object, are also available transparently in your language of choice, for example, in Perl ZShellScripts you can write :

    print $context->title_or_id;

    and so on...

    Use your language facilities to learn what variables are directly accessible and their values (e.g. printenv in Unix scripts)

  5. - ???
  6. - Profit ! (ok, this one comes directly from SlashDot)
  7. - Use ShellUnix.py, ShellPython.py, ShellLisp.py or ShellZope.py as examples to create your own Shell class. ZShellScripts.py doesn't need to change.

NB : YOU DON'T NEED ZShell TO USE ZShellScripts

Enjoy !

Comments are VERY welcome.

Latest Release: 0.3
Last Updated: 2002-12-02 08:37:27
Author: ZopeOrgSite
Categories: Content Object, Developer, Helpers
Maturity: Development

Available Releases

Version Maturity Platform Released
0.3 Development   2002-12-02 08:37:27
  ZShellScripts-0.3.tar.gz (62 K) All