diff --git a/docs/scenarios/admin.rst b/docs/scenarios/admin.rst index 991cab265..141dd879a 100644 --- a/docs/scenarios/admin.rst +++ b/docs/scenarios/admin.rst @@ -84,4 +84,49 @@ Blueprint Buildout -------- -.. todo:: Write about Buildout \ No newline at end of file +.. todo:: Write about Buildout + +pbs +--- +`pbs `_ is a tool that take +python a bit closer to bash. In a pythonic more "Human" way +(not like the standard library subprocess]. + +you can utilize it like that: + +.. code-block:: python + + from pbs import ifconfig + print ifconfig("eth0") + +or for the lazy ones: + +.. code-block:: python + + from pbs import * + print ifconfig("eth0") + print du() + +RPyC +---- +`RPyC `_ is a module that can give you control on a remote interpeter, in a convientent way. +when you need two python interpeters talk with each other, make sure you try this one. + +starting the server: +.. code-block:: bash + + $ ./rpyc_classic.py -m threaded + +connect from client: +.. code-block:: python + + conn = rpyc.classic.connect("hostname") + + # using modules for anthoer interpeter/host + proc = conn.modules.subprocess.Popen("ls", stdout = -1, stderr = -1) + stdout, stderr = proc.communicate() + print stdout.split() + + remote_list = conn.builtin.range(7) + + conn.execute("print 'foo'") \ No newline at end of file diff --git a/docs/scenarios/cli.rst b/docs/scenarios/cli.rst index cea7a3f6c..275ffaf7c 100644 --- a/docs/scenarios/cli.rst +++ b/docs/scenarios/cli.rst @@ -6,4 +6,35 @@ Command Line Applications Clint ----- -.. todo:: Write about Clint \ No newline at end of file +.. todo:: Write about Clint + +commando +-------- +`commando `_ - argparse in style + +A simple wrapper for argparse that allows commands and arguments to be +defined declaratively using decorators. Note that this does not support +all the features of argparse yet. + +With commando: + +.. code-block:: python + + class Engine(Application): + + @command(description='hyde - a python static website generator', + epilog='Use %(prog)s {command} -h to get help on individual commands') + @param('-v', '--version', action='version', version='%(prog)s ' + __version__) + @param('-s', '--sitepath', action='store', default='.', help="Location of the hyde site") + def main(self, params): pass + + @subcommand('init', help='Create a new hyde site') + @param('-t', '--template', action='store', default='basic', dest='template', + help='Overwrite the current site if it exists') + @param('-f', '--force', action='store_true', default=False, dest='overwrite', + help='Overwrite the current site if it exists') + def init(self, params): + print params.sitepath + print params.template + print params.overwrite +