please unify ZODB scripts
Bug #767416 reported by
Toni Mueller
on 2011-04-20
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
| ZODB |
Undecided
|
Unassigned |
Bug Description
Eg. 'analyze.py':
$ diff -uw analyze.py.old analyze.py
--- analyze.py.old 2010-12-26 18:43:56.000000000 +0100
+++ analyze.py 2011-04-20 19:52:09.000000000 +0200
@@ -138,6 +138,11 @@
except Exception, err:
print err
-if __name__ == "__main__":
+
+def main():
path = sys.argv[1]
report(
+
+if __name__ == "__main__":
+ main()
+
This should make it easier to call the scripts from anywhere (eg. generate wrappers around them via zc.buildout).
Toni Mueller (support-oeko-net)
on 2011-04-20
description: | updated |
Jim Fulton (jim-zope) wrote : | #1 |
Jim Fulton (jim-zope) wrote : | #2 |
BTW, the main function should look more liike:
def main(args=None):
if args is None:
args = sys.argv[1:]
[path] = args
report(
To post a comment you must log in.
This would get applied a lot faster if there was a test.