[Blends-commit] [SCM] website branch, master, updated. 1bc06676f66579fdbad9c099022f1d2ad495b00a

2016-03-20 Thread Ole Streicher
The following commit has been merged in the master branch:
commit 1bc06676f66579fdbad9c099022f1d2ad495b00a
Author: Ole Streicher 
Date:   Thu Mar 17 17:01:21 2016 +0100

Do long rendering only in the templates, not in blendstasktools

diff --git a/webtools/blendsmarkdown.py b/webtools/blendsmarkdown.py
index 46c6c7c..4710daf 100644
--- a/webtools/blendsmarkdown.py
+++ b/webtools/blendsmarkdown.py
@@ -8,7 +8,7 @@ import re
 from sys import stderr
 from markdown import markdown# Markdown
 from docutils.core import publish_parts  # alternatively reST
-from genshi import Markup
+from genshi import Markup# Mark the string as rendered
 
 detect_list_start_re = re.compile("^\s+[-*+]\s+")
 detect_code_start_re = re.compile("^\s")
@@ -17,6 +17,7 @@ detect_url_re = re.compile("[fh]t?tp://")
 
 
 def PrepareMarkdownInput(lines):
+lines = lines.splitlines()
 ret = ''
 inlist = 0
 incode = 0
@@ -69,10 +70,7 @@ def PrepareMarkdownInput(lines):
 ret += line + "\n"
 return ret
 
-
-def render_longdesc(lines):
-MarkDownInput = PrepareMarkdownInput(lines)
-
+def render_longdesc(MarkDownInput):
 global rendering_lib
 if rendering_lib == 'rest':
 try:
@@ -83,7 +81,7 @@ def render_longdesc(lines):
 LongDesc = "Problems in rendering description using reST"
 else:  # by default use Markdown
 LongDesc = markdown(MarkDownInput)
-return LongDesc
+return Markup(LongDesc)
 
 
 def SplitDescription(description):
@@ -91,10 +89,8 @@ def SplitDescription(description):
 
 lines = description.splitlines()
 
-ShortDesc = lines[0].replace("&", "&") \
-.replace("<", "<") \
-.replace(">", ">")
-LongDesc = render_longdesc(lines[1:])
+ShortDesc = lines[0]
+LongDesc = PrepareMarkdownInput('\n'.join(lines[1:]))
 
 return (ShortDesc, LongDesc)
 
diff --git a/webtools/blendstasktools.py b/webtools/blendstasktools.py
index 8984ae1..ed44c16 100644
--- a/webtools/blendstasktools.py
+++ b/webtools/blendstasktools.py
@@ -26,8 +26,7 @@ import email.utils
 import psycopg2
 import gettext
 
-from genshi import Markup
-from blendsmarkdown import SplitDescription, render_longdesc
+from blendsmarkdown import SplitDescription, PrepareMarkdownInput
 
 try:
 from debian import deb822
@@ -1029,13 +1028,6 @@ class Tasks:
 # Return dictionary with description information of all tasks of a 
Blend
 return self.tasks
 
-def MarkupPreformatedStringsBlend(self):
-# Genshi does not touch strings that are marked with "Markup()" - so 
just
-# mark the strings that are ready formatted for the whole Blend
-for task in self.metapackagekeys:
-tdeps = self.tasks[task]
-tdeps.MarkupPreformatedStrings()
-
 def LinkEnhances(self):
 # To provide a connection between packages enhancing other packages a 
set of links
 # will be provided.  The links should point to paragraphs on the tasks 
pages if the
@@ -1129,7 +1121,7 @@ class TaskDependencies:
 self.metapkg.desc[lang] = {}
 self.metapkg.desc[lang]['short'] = 
ddtptranslations['description_' + lang]
 try:
-self.metapkg.desc[lang]['long'] = 
Markup(render_longdesc(ddtptranslations['long_description_' + 
lang].splitlines()))
+self.metapkg.desc[lang]['long'] = 
PrepareMarkdownInput(ddtptranslations['long_description_' + lang])
 except AttributeError as err:
 logger.error("===> AttributeError in metapackage long %s 
(lang='%s'): '%s'; ErrTxt: %s"
  % (self.metapkg.pkg, lang, 
ddtptranslations['long_description_' + lang], err))
@@ -1184,8 +1176,7 @@ class TaskDependencies:
 else:
 (shortDesc, longDesc) = 
SplitDescription(stanza['description'])
 self.metapkg.desc['en']['short'] = shortDesc
-# Markup strings to enable verbatim output of 
preformatted text
-self.metapkg.desc['en']['long']  = Markup(longDesc)
+self.metapkg.desc['en']['long']  = longDesc
 found_description = True
 continue
 if key == 'Meta-Depends':
@@ -1425,7 +1416,7 @@ class TaskDependencies:
 else:
 _pkg = dep.pkg
 remark['short'] = shortDesc
-remark['long']  = Markup(longDesc)
+remark['long']  = longDesc
 continue
 else:
 if key not in KEYSTOIGNORE:
@@ -1608,7 +1599,7 @@ class TaskDependencies:
 dep.desc[l] = {}
 dep.desc[l]['short'] = row['description_' + l]
 if row['long_description_' + l]:
-de

[Blends-commit] [SCM] website branch, master, updated. 1bc06676f66579fdbad9c099022f1d2ad495b00a

2016-03-19 Thread Ole Streicher
The following commit has been merged in the master branch:
commit 801266a98bfd0b24e23d36267ad3329969e455a2
Author: Ole Streicher 
Date:   Thu Mar 17 14:33:54 2016 +0100

Replace list in GetUpdatablePackages() by a dictionary

diff --git a/webtools/blendstasktools.py b/webtools/blendstasktools.py
index 763dba4..9f75d4a 100644
--- a/webtools/blendstasktools.py
+++ b/webtools/blendstasktools.py
@@ -985,18 +985,20 @@ class Tasks:
 
 for task in self.metapackagekeys:
 tdeps = self.tasks[task]
-list = []
+pkgList = []
 for dep in use_dependencystatus:
 for tdep in tdeps.dependencies[dep]:
 if tdep.outdated != {}:
-if 'last_uploader_simple' in tdep.properties:
-last_uploader = 
tdep.properties['last_uploader_simple']
-else:
-last_uploader = None
 # versions are ordered lists  ---v--- last one is 
needed
-list.append(((tdep.pkg, tdep.version[-1]['version'], 
tdep.outdated['version'], tdep.properties['maintainer']), last_uploader))
-if list:
-ret[task] = list
+pkgList.append({
+'name': tdep.pkg,
+'debian_version': tdep.version[-1]['version'],
+'upstream_version': tdep.outdated['version'],
+'maintainer': tdep.properties['maintainer'],
+'uploader': 
tdep.properties.get('last_uploader_simple')
+})
+if pkgList:
+ret[task] = pkgList
 return ret
 
 def GetAllDependentPackagesOfBlend(self, dependencystatus=[]):
diff --git a/webtools/new_upstream.py b/webtools/new_upstream.py
index 4b89b9a..b56e3b2 100755
--- a/webtools/new_upstream.py
+++ b/webtools/new_upstream.py
@@ -20,12 +20,15 @@ tasks.GetAllDependencies(source=1)
 packages = tasks.GetUpdatablePackages(dependencystatus=['official_high', 
'official_low', 'non-free', 'experimental'])
 
 for task in packages.keys():
-print("Updatable packages in Task %s" % task)
+print("Updatable packages in Task {0}".format(task))
 for pkg_v_o in packages[task]:
-printstring = "\t%s:\n\t\tHighest version in Debian is 
%s\n\t\tUpstream has %s\n\t\tMaintainer is %s" % (pkg_v_o[0])
-if pkg_v_o[1]:
-printstring = printstring + "\n\t\tLast uploader was " + pkg_v_o[1]
-print(printstring)
+printstring = '\t{name}:\n'
+printstring += '\t\tHighest version in Debian is {debian_version}\n'
+printstring += '\t\tUpstream has {upstream_version}\n'
+printstring += '\t\tMaintainer is {maintainer}'
+if 'uloader' in pkg_v_o:
+printstring += '\n\t\tLast uploader was {uploader}'
+print(printstring.format(**pkg_v_o))
 
 # Perhaps we should also send a mail to p...@qa.debian.org
 # keyword %(pkg) %(list) = bts bts-control upload-source katie-other 
summary default cvs ddtp derivatives contact

-- 
Static and dynamic websites for Debian Pure Blends

___
Blends-commit mailing list
Blends-commit@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/blends-commit


[Blends-commit] [SCM] website branch, master, updated. 1bc06676f66579fdbad9c099022f1d2ad495b00a

2016-03-19 Thread Ole Streicher
The following commit has been merged in the master branch:
commit 02c2a389777d051eb0610f32c9004e7c8d010558
Author: Ole Streicher 
Date:   Thu Mar 17 15:44:53 2016 +0100

Separate email from name for maintainer and uploader
This replaces the formatted versions for text and HTML by the fields
maintainer_email and maintainer_name resp. uploader_email and
uploader_name. Formatting is done during genshi output.
This removes one reason to use genshi.Markup()

diff --git a/webtools/blendstasktools.py b/webtools/blendstasktools.py
index 9f75d4a..78c1bc5 100644
--- a/webtools/blendstasktools.py
+++ b/webtools/blendstasktools.py
@@ -748,8 +748,6 @@ class DependantPackage:
 self.screenshots= []# list of {'version', 'url'} dictionary 
containing screenshot information
 self.icon   = None  # URL of small screenshot icon
 self.screenshot_url = None  # URL to screenshots.debian.net
-self.responsible= None  # E-Mail address of issuer of ITP or some 
person
-# who volunteered to care for this program
 self.filename   = None  # Filename of package in the Debian pool
 self.desc   = {}# Prospective packages should have a 
description ...
 # ... which could be copied to (or from if 
exists)
@@ -994,8 +992,10 @@ class Tasks:
 'name': tdep.pkg,
 'debian_version': tdep.version[-1]['version'],
 'upstream_version': tdep.outdated['version'],
-'maintainer': tdep.properties['maintainer'],
-'uploader': 
tdep.properties.get('last_uploader_simple')
+'maintainer_name': 
tdep.properties.get('maintainer_name'),
+'maintainer_email': 
tdep.properties.get('maintainer_email'),
+'uploader_name': 
tdep.properties.get('uploader_name'),
+'uploader_email': 
tdep.properties.get('uploader_email'),
 })
 if pkgList:
 ret[task] = pkgList
@@ -1204,16 +1204,17 @@ class TaskDependencies:
 # Make sure there is really enough information to deal 
with provided by the package
 logger.error("Missing package information for field %s 
= %s in task file %s" % (key, responsible, self.task))
 continue
-if dep.responsible is not None:
+if 'maintainer_email' in dep.properties:
 # we are dealing with an official package that has a 
real maintainer who
 # is finally responsible
 # ... but do not issue a hint about this in the logs. 
Sometimes a responsible
 # person makes sense in the tasks field
 # fields_obsolete.append(key)
 continue
-if responsible != '':
-(_name, _url) = email.Utils.parseaddr(responsible)
-dep.responsible = 'mailto:%s";>%s' % 
(_url, _name)
+if responsible:
+(_name, _url) = email.utils.parseaddr(responsible)
+dep.properties['maintainer_name'] = _name
+dep.properties['maintainer_email'] = _url
 continue
 
 if key in dep_strength_keys:
@@ -1244,7 +1245,11 @@ class TaskDependencies:
 dep = DependantPackage(self.blendname, self.task)
 # Store the comments in case they might be usefull for 
later applications
 dep.why= why
-dep.responsible= responsible
+if responsible:
+(_name, _url) = email.utils.parseaddr(responsible)
+dep.properties['maintainer_name'] = _name
+dep.properties['maintainer_email'] = _url
+
 dep.dep_strength   = key
 if dep_in_line.islower():
 dep.pkg= dep_in_line
@@ -1592,10 +1597,8 @@ class TaskDependencies:
 changed = row['changed_by']
 if changed:
 (_name, _url) = email.utils.parseaddr(changed)
-changed = 'mailto:%s";>%s' % (_url, _name)
-dep.properties['changed_by']= Markup(changed)
-dep.properties['last_uploader'] = changed
-dep.properties['last_uploader_simple'] = '%s <%s>' % 
(_name, _url)
+dep.properties['uploader_name'] = _name
+dep.properties['uploader_email'] = _url
 
 # link to packages

[Blends-commit] [SCM] website branch, master, updated. 1bc06676f66579fdbad9c099022f1d2ad495b00a

2016-03-18 Thread Ole Streicher
The following commit has been merged in the master branch:
commit ba5024bd7238167260b8d773f3947d89e68b492b
Author: Ole Streicher 
Date:   Thu Mar 17 16:02:00 2016 +0100

Don't markup short description: it is just a one-liner

diff --git a/webtools/blendstasktools.py b/webtools/blendstasktools.py
index 78c1bc5..8984ae1 100644
--- a/webtools/blendstasktools.py
+++ b/webtools/blendstasktools.py
@@ -1127,8 +1127,7 @@ class TaskDependencies:
 for lang in languages:
 if ddtptranslations['description_' + lang]:
 self.metapkg.desc[lang] = {}
-short = ddtptranslations['description_' + lang]
-self.metapkg.desc[lang]['short'] = Markup(short)
+self.metapkg.desc[lang]['short'] = 
ddtptranslations['description_' + lang]
 try:
 self.metapkg.desc[lang]['long'] = 
Markup(render_longdesc(ddtptranslations['long_description_' + 
lang].splitlines()))
 except AttributeError as err:
@@ -1184,8 +1183,8 @@ class TaskDependencies:
 logger.error("Duplicate description entry in task %s; 
you probably want to use Pkg-Description field instead!" % self.task)
 else:
 (shortDesc, longDesc) = 
SplitDescription(stanza['description'])
+self.metapkg.desc['en']['short'] = shortDesc
 # Markup strings to enable verbatim output of 
preformatted text
-self.metapkg.desc['en']['short'] = Markup(shortDesc)
 self.metapkg.desc['en']['long']  = Markup(longDesc)
 found_description = True
 continue
@@ -1425,7 +1424,7 @@ class TaskDependencies:
 _pkg = self.metapkg.PrintedName
 else:
 _pkg = dep.pkg
-remark['short'] = Markup(shortDesc)
+remark['short'] = shortDesc
 remark['long']  = Markup(longDesc)
 continue
 else:
@@ -1607,7 +1606,7 @@ class TaskDependencies:
 for l in languages:
 if row.get('description_' + l):
 dep.desc[l] = {}
-dep.desc[l]['short'] = Markup(row['description_' + l])
+dep.desc[l]['short'] = row['description_' + l]
 if row['long_description_' + l]:
 dep.desc[l]['long']  = 
Markup(render_longdesc(row['long_description_' + l].splitlines()))
 if 'short' not in dep.desc['en']:
@@ -1668,7 +1667,7 @@ class TaskDependencies:
 logger.info("The package %s is not yet in Debian but it is 
just in the new queue. (Task %s)" % (dep.pkg, dep.taskname))
 for prop in PROPERTIES:
 dep.properties[prop] = row[prop]
-dep.desc['en']['short'] = Markup(row['description_en'])
+dep.desc['en']['short'] = row['description_en']
 dep.desc['en']['long']  = 
Markup(render_longdesc(row['long_description_en'].splitlines()))
 if row['maintainer']:
 (_name, _url) = email.utils.parseaddr(row['maintainer'])
@@ -1753,7 +1752,7 @@ class TaskDependencies:
 if int(row['wnpp']) > 0:
 dep.properties['wnpp'] = row['wnpp']
 dep.SetPublications(row)
-dep.desc['en']['short'] = Markup(row['description_en'])
+dep.desc['en']['short'] = row['description_en']
 dep.desc['en']['long']  = 
Markup(render_longdesc(row['long_description_en'].splitlines()))
 if row['maintainer']:
 (_name, _url) = email.utils.parseaddr(row['maintainer'])
@@ -1916,7 +1915,6 @@ class TaskDependencies:
 for dependency in self.dependencies.values():
 for dep in dependency:
 if dep.desc['en'] != {}:
-dep.desc['en']['short'] = Markup(dep.desc['en']['short'])
 try:
 dep.desc['en']['long'] = Markup(dep.desc['en']['long'])
 except KeyError:
diff --git a/webtools/blendstasktools_udd.py b/webtools/blendstasktools_udd.py
index de7520a..07f4473 100644
--- a/webtools/blendstasktools_udd.py
+++ b/webtools/blendstasktools_udd.py
@@ -1038,8 +1038,7 @@ class TaskDependencies:
 for lang in languages:
 if ddtptranslations['description_' + lang]:
 self.metapkg.desc[lang] = {}
-short = ddtptranslations['description_' + lang]
-self.metapkg.desc[lang]['short'] = Markup(short)
+self.metapkg.desc[lang]['short'] = 
ddtptranslations['description_' + lang]
 try:
 self.metapkg.desc[lang]['long'] = 
Markup(render_longdesc(ddtptranslations['long_description_' + 
l