[Tutor] Ultra basic question

Greg Freemyer freemyer@NorcrossGroup.com
Thu Mar 27 11:27:34 2003


I have some python code I can run in winpython by opening the source file and =
clicking run.

I need to be able to run it from normal python.

 I can start python and "import rdiff_backup" but I don't know how to actually =
invoke it.

I tried simply calling rdiff_backup.Main("--version") but it complains there is =
no such attribute.

OTOH, help ("modules rdiff_backup") shows Main???


=3D=3D=3D  What I tried
$ ntpython
Python 2.2.2 (#37, Oct 14 2002, 17:02:34) [MSC 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import rdiff_backup
>>> rdiff_backup.Main("--version")
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
AttributeError: 'module' object has no attribute 'Main'

>>> help ("modules rdiff_backup")
Here is a list of matching modules.  Enter any module name to get more help.
rdiff_backup.FilenameMapping - Coordinate corresponding files with different =
nam
es
rdiff_backup.Globals - Hold a variety of constants usually set at =
initialization
.
rdiff_backup.Hardlink - Preserve and restore hard links
rdiff_backup.Main - Start (and end) here - read arguments, set global settings,
etc.
rdiff_backup.Rdiff - Invoke rdiff utility to make signatures, deltas, or patch
rdiff_backup.Security - Functions to make sure remote requests are kosher
rdiff_backup.SetConnections - Parse args and setup connections
rdiff_backup.TempFile - Manage temp files
rdiff_backup.Time - Provide time related exceptions and functions
rdiff_backup (package)
rdiff_backup.backup - High level functions for mirroring and =
mirror+incrementing
rdiff_backup.connection - Support code for remote execution and data transfer
rdiff_backup.increment - Provides functions and *ITR classes, for writing =
increm
ent files
rdiff_backup.iterfile - Convert an iterator to a file object and vice-versa
rdiff_backup.lazy - Define some lazy data structures and functions acting on =
the
m
rdiff_backup.librsync - Provides a high-level interface to some librsync =
functio
ns
rdiff_backup.log - Manage logging, displaying and recording messages with =
requir
ed verbosity
rdiff_backup.manage - list, delete, and otherwise manage increments
rdiff_backup.metadata - Store and retrieve metadata in destination directory
rdiff_backup.regress - Code for reverting the rdiff-backup directory to prev =
sta
te
rdiff_backup.restore - Read increment files and restore to original
rdiff_backup.robust - Catch various exceptions given system call
rdiff_backup.rorpiter - Operations on Iterators of Read Only Remote Paths
rdiff_backup.rpath - Wrapper class around a real path like "/usr/bin/env"
rdiff_backup.selection - Iterate exactly the requested files in a directory
rdiff_backup.static - MakeStatic and MakeClass
rdiff_backup.statistics - Generate and process aggregated backup information

=3D=3D=3D

TIA
Greg
--=20
Greg Freemyer