ds-backup.py - confusion
krstic at solarsail.hcs.harvard.edu
Thu May 1 03:16:17 EDT 2008
On May 1, 2008, at 2:57 AM, Martin Langhoff wrote:
> I'm no Python wiz (that's well known ;-) ) but I can't get
> ds-backup.py to do anything for me... :-/ Hopefully these questions
> are not too clueless...
The line that executes write_index_since is commented out. You'll want
to uncomment it.
> That strange (for me) way of trying to trigger some code as
> "main" function by testing for __main__ at the bottom is... well...
It's idiomatic Python.
> - Are the "error classes" defined at the top empty? Can we just error
> out with classic error codes that can be handled by callers? (AFAICT
> throwing exceptions like that forces our hand into calling this via
> Python to get decent error handling - good ol' error codes will work
> with callers regardless of language or colour of skin).
It was written to be used as a Python library, only incidentally
providing some CLI functionality. If you want it to be mostly
standalone, you can certainly replace the error handling code to
sys.exit() with a particular error code.
I'll see if I can get you the server-side code, which I should have
Ivan Krstić <krstic at solarsail.hcs.harvard.edu> | http://radian.org
More information about the Devel