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 :
- - 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 !!!
- - 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)
- - 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)"
- - 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)
- - ???
- - Profit ! (ok, this one comes directly from SlashDot)
- - 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 |
|