[Blends-commit] r3191 - /blends/trunk/webtools/blendstasktoolsold.py
tille at users.alioth.debian.org
tille at users.alioth.debian.org
Sat Feb 25 22:54:31 UTC 2012
Author: tille
Date: Sat Feb 25 22:54:31 2012
New Revision: 3191
URL: http://svn.debian.org/wsvn/blends/?sc=1&rev=3191
Log:
Brutally strip of all long_description related stuff because this old code is used for bugs exclusively where no long descriptions are used (hope to be able to replace this soonish to run it again on alioth)
Modified:
blends/trunk/webtools/blendstasktoolsold.py
Modified: blends/trunk/webtools/blendstasktoolsold.py
URL: http://svn.debian.org/wsvn/blends/blends/trunk/webtools/blendstasktoolsold.py?rev=3191&op=diff
==============================================================================
--- blends/trunk/webtools/blendstasktoolsold.py (original)
+++ blends/trunk/webtools/blendstasktoolsold.py Sat Feb 25 22:54:31 2012
@@ -240,7 +240,7 @@
query = """PREPARE query_pkg (text) AS SELECT
distribution, component, version, architecture, maintainer,
source, section, task, distribution, release, component, homepage,
- description, long_description FROM packages
+ description FROM packages
WHERE package = $1 ORDER BY version"""
curs.execute(query)
@@ -314,12 +314,6 @@
SELECT vcs_type AS "vcs-type", vcs_url AS "vcs-url", vcs_browser AS "vcs-browser" FROM sources
WHERE source = $1 AND (vcs_type IS NOT NULL OR vcs_url IS NOT NULL OR vcs_browser IS NOT NULL)
ORDER BY version desc LIMIT 1"""
-curs.execute(query)
-
-# Obtain description in foreign language from DDTP project if available
-# For the moment just query for the highest available version of the description
-query = """PREPARE ddtp_description (text) AS
- SELECT language, description, long_description, version FROM DdtpLanguageMaxVersion($1)"""
curs.execute(query)
# Obtain popcon data:
@@ -711,7 +705,7 @@
for prop in PROPERTIES:
self.properties[prop] = row[prop]
self.desc['en']['short'] = MarkupString(to_unicode(row['description']), self.pkg, 'ShortDesc')
- self.desc['en']['long'] = Markup(render_longdesc(to_unicode(row['long_description']).splitlines()))
+ self.desc['en']['long'] = 'unused'
(_name, _url) = email.Utils.parseaddr(row['maintainer'])
self.properties['maintainer'] = to_unicode(row['maintainer'])
self.responsible = '<a href="mailto:%s">%s</a>' % (_url, to_unicode(_name))
@@ -763,18 +757,6 @@
self.properties['last_uploader_simple'] = to_unicode('%s <%s>' % (_name, _url))
except UnicodeDecodeError, err:
logger.error("Failed to compare changed with maintainer - assume both are the same for package %s (%s)", self.pkg, err)
-
- if source == 0: # If we are querying for source packages to render BTS pages
- # tranlations are irrelevant - so only obtain ddtp translations
- # otherwise
- query = "EXECUTE ddtp_description ('%s')" % (self.pkg)
- curs.execute(query)
-
- for row in RowDictionaries(curs):
- lang = row['language']
- self.desc[lang] = {}
- self.desc[lang]['short'] = MarkupString(to_unicode(row['description']), self.pkg, 'ShortDesc - ' + lang)
- self.desc[lang]['long'] = Markup(render_longdesc(to_unicode(row['long_description']).splitlines()))
query = "EXECUTE query_check_enhances ('%"+self.pkg+"%')"
curs.execute(query)
@@ -1170,35 +1152,6 @@
row = RowDictionaries(curs)[0]
(_name, _url) = email.Utils.parseaddr(row['maintainer'])
self.responsible = '<a href="mailto:%s">%s</a>' % (_url, to_unicode(_name))
-
- # if an English description was found chances are good that we are seeking for other languages
- # as well
- if source == 0: # If we are querying for source packages to render BTS pages
- # tranlations are irrelevant - so only obtain ddtp translations
- # otherwise
- query = "EXECUTE ddtp_description ('%s')" % (self.metapkg.pkg)
- curs.execute(query)
-
- for row in RowDictionaries(curs):
- lang = row['language']
- self.metapkg.desc[lang] = {}
- try:
- short = to_unicode(row['description'])
- self.metapkg.desc[lang]['short'] = MarkupString(to_unicode(short), \
- self.metapkg.PrintedName, 'taskShortDesc - ' + lang)
- except UnicodeEncodeError, err:
- logger.error("===> UnicodeDecodeError in metapackage %s (lang='%s'): '%s'; ErrTxt: %s" % \
- (self.metapkg.pkg, lang, row['description'], err))
- short = to_unicode(row['description'],'latin1')
- self.metapkg.desc[lang]['short'] = MarkupString(short, \
- self.metapkg.PrintedName, 'taskShortDesc - ' + lang)
-
- try:
- self.metapkg.desc[lang]['long'] = Markup(render_longdesc(to_unicode(row['long_description']).splitlines()))
- except UnicodeDecodeError, err:
- logger.error("===> UnicodeDecodeError in metapackage long %s (lang='%s'): '%s'; ErrTxt: %s" % \
- (self.metapkg.pkg, lang, row['long_description'], err))
- self.metapkg.desc[lang]['long'] = 'UnicodeDecodeError'
continue
if key == 'Meta-Depends':
More information about the Blends-commit
mailing list