[csw-devel] SF.net SVN: gar:[10421] csw/mgar/gar/v2/bin/checkpkg_inspect_stats.py
wahwah at users.sourceforge.net
wahwah at users.sourceforge.net
Sun Jul 4 15:51:05 CEST 2010
Revision: 10421
http://gar.svn.sourceforge.net/gar/?rev=10421&view=rev
Author: wahwah
Date: 2010-07-04 13:51:05 +0000 (Sun, 04 Jul 2010)
Log Message:
-----------
mGAR v2: A helper tool for package statistics inspection.
Added Paths:
-----------
csw/mgar/gar/v2/bin/checkpkg_inspect_stats.py
Added: csw/mgar/gar/v2/bin/checkpkg_inspect_stats.py
===================================================================
--- csw/mgar/gar/v2/bin/checkpkg_inspect_stats.py (rev 0)
+++ csw/mgar/gar/v2/bin/checkpkg_inspect_stats.py 2010-07-04 13:51:05 UTC (rev 10421)
@@ -0,0 +1,37 @@
+#!/opt/csw/bin/python2.6
+# coding=utf-8
+
+import code
+import logging
+import optparse
+import os
+import pprint
+import sys
+
+# The following bit of code sets the correct path to Python libraries
+# distributed with GAR.
+path_list = [os.path.dirname(__file__),
+ "..", "lib", "python"]
+sys.path.append(os.path.join(*path_list))
+import checkpkg
+import opencsw
+
+def main():
+ parser = optparse.OptionParser()
+ parser.add_option("-d", "--debug", dest="debug",
+ default=False, action="store_true",
+ help="Turn on debugging messages")
+ options, args = parser.parse_args()
+ if options.debug:
+ logging.basicConfig(level=logging.DEBUG)
+ else:
+ logging.basicConfig(level=logging.INFO)
+ logging.debug("Collecting statistics about given package files.")
+ filenames = args
+ srv4_pkgs = [opencsw.CswSrv4File(x) for x in filenames]
+ pkgstats = [checkpkg.PackageStats(x) for x in srv4_pkgs]
+ pkgstats = [x.GetAllStats() for x in pkgstats]
+ code.interact(local=locals())
+
+if __name__ == '__main__':
+ main()
Property changes on: csw/mgar/gar/v2/bin/checkpkg_inspect_stats.py
___________________________________________________________________
Added: svn:executable
+ *
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the devel
mailing list