[csw-devel] SF.net SVN: gar:[10759] csw/mgar/gar/v2/lib/python/pkgdb.py
wahwah at users.sourceforge.net
wahwah at users.sourceforge.net
Tue Aug 17 11:52:27 CEST 2010
Revision: 10759
http://gar.svn.sourceforge.net/gar/?rev=10759&view=rev
Author: wahwah
Date: 2010-08-17 09:52:27 +0000 (Tue, 17 Aug 2010)
Log Message:
-----------
mGAR v2: pkgdb, added a parameter to specify the template.
Modified Paths:
--------------
csw/mgar/gar/v2/lib/python/pkgdb.py
Modified: csw/mgar/gar/v2/lib/python/pkgdb.py
===================================================================
--- csw/mgar/gar/v2/lib/python/pkgdb.py 2010-08-17 08:57:07 UTC (rev 10758)
+++ csw/mgar/gar/v2/lib/python/pkgdb.py 2010-08-17 09:52:27 UTC (rev 10759)
@@ -57,6 +57,8 @@
parser.add_option("-d", "--debug", dest="debug",
default=False, action="store_true",
help="Turn on debugging messages")
+ parser.add_option("-t", "--pkg-review-template", dest="pkg_review_template",
+ help="A Cheetah template used for package review reports.")
options, args = parser.parse_args()
if options.debug:
logging.basicConfig(level=logging.DEBUG)
@@ -104,17 +106,20 @@
data = cPickle.loads(str(srv4.data))
if "OPENCSW_REPOSITORY" in data["pkginfo"]:
build_src = data["pkginfo"]["OPENCSW_REPOSITORY"]
- build_src = re.sub(r"@(\d+)$", r"?rev=\1", build_src)
+ build_src = re.sub(r"@(\d+)$", r"", build_src)
else:
build_src = None
data["build_src"] = build_src
pkgstats.append(data)
# This assumes the program is run as "bin/pkgdb", and not "lib/python/pkgdb.py".
- tmpl_filename = os.path.join(os.path.split(__file__)[0],
- "..",
- "lib",
- "python",
- "pkg-review-template.html")
+ if not options.pkg_review_template:
+ tmpl_filename = os.path.join(os.path.split(__file__)[0],
+ "..",
+ "lib",
+ "python",
+ "pkg-review-template.html")
+ else:
+ tmpl_filename = options.pkg_review_template
tmpl_str = open(tmpl_filename, "r").read()
t = Template(tmpl_str, searchList=[{
"pkgstats": pkgstats,
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