SF.net SVN: gar:[23178] csw/mgar/gar/v2/lib/python/models.py
wahwah at users.sourceforge.net
wahwah at users.sourceforge.net
Mon Mar 10 21:57:13 CET 2014
Revision: 23178
http://sourceforge.net/p/gar/code/23178
Author: wahwah
Date: 2014-03-10 20:57:12 +0000 (Mon, 10 Mar 2014)
Log Message:
-----------
pkgdb-web: bring back svn information
We're already in the part of code where we can talk to the database, so let's
add back the method returning the stats struct, it's still used for some
endpoints.
Modified Paths:
--------------
csw/mgar/gar/v2/lib/python/models.py
Modified: csw/mgar/gar/v2/lib/python/models.py
===================================================================
--- csw/mgar/gar/v2/lib/python/models.py 2014-03-10 20:36:01 UTC (rev 23177)
+++ csw/mgar/gar/v2/lib/python/models.py 2014-03-10 20:57:12 UTC (rev 23178)
@@ -338,8 +338,12 @@
s = s + u" (bad unicode detected)"
return s
+ def GetStatsStruct(self):
+ pkg_stats_sqo = Srv4FileStatsBlob.selectBy(
+ md5_sum=self.md5_sum).getOne()
+ return cjson.decode(pkg_stats_sqo.json)
+
def _GetBuildSource(self):
- return "_GetBuildSource(): Not implemented"
data = self.GetStatsStruct()
build_src = None
if "OPENCSW_REPOSITORY" in data["pkginfo"]:
@@ -364,7 +368,6 @@
return trac_url
def GetVendorUrl(self):
- return "GetVendorUrl(): Not implemented"
data = self.GetStatsStruct()
vendor_url = None
if "VENDOR" in data["pkginfo"]:
@@ -396,14 +399,14 @@
'pkgname': self.pkginst_str,
}
if not quick:
- data['arch'] = self.arch.name
- data['filename_arch'] = self.filename_arch.name
- data['maintainer_email'] = self.maintainer.email
- data['maintainer_full_name'] = self.maintainer.full_name
- data['maintainer_id'] = self.maintainer.id
- data['vendor_url'] = self.GetVendorUrl()
- data['repository_url'] = self.GetSvnUrl()
- # 'in_catalogs': unicode([unicode(x) for x in self.in_catalogs]),
+ # These data are used by the package database integration
+ data['arch'] = self.arch.name
+ data['filename_arch'] = self.filename_arch.name
+ data['maintainer_email'] = self.maintainer.email
+ data['maintainer_full_name'] = self.maintainer.full_name
+ data['maintainer_id'] = self.maintainer.id
+ data['vendor_url'] = self.GetVendorUrl()
+ data['repository_url'] = self.GetSvnUrl()
return mimetype, data
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