[Blends-commit] [SCM] website branch, master, updated. 4c016db575165db9a75e26761169140835f9dff7

Ole Streicher ole at aip.de
Fri Mar 18 15:59:51 UTC 2016


The following commit has been merged in the master branch:
commit 4c016db575165db9a75e26761169140835f9dff7
Author: Ole Streicher <ole at aip.de>
Date:   Fri Mar 18 16:59:28 2016 +0100

    Move 'why' and 'remark' fields to properties

diff --git a/webtools/blendstasktools.py b/webtools/blendstasktools.py
index eba590c..68a0e7c 100644
--- a/webtools/blendstasktools.py
+++ b/webtools/blendstasktools.py
@@ -728,8 +728,6 @@ class DependantPackage:
         self.releases       = []    # List of releases a package might be in
         self.component      = None  # One of: 'main', 'contrib', 'non-free', if a package shows up in several components which
                                     # might happen over different releases, just prefer main over contrib over non-free
-        self.why            = None  # basically used as comment
-
         self.properties     = {}
         self.properties['license']     = 'unknown'
         for field in HOMEPAGENONEFIELDS:
@@ -746,7 +744,6 @@ class DependantPackage:
                                     # WNPP bug and finally can be used for packaging
         self.desc['en']     = {}    # An English description should be available in any case
         self.experimental   = 0     # Set to 1 if package *only* in experimental but not in unstable/testing/stable
-        self.remark         = {}    # Optional remark for a package
         self.dep_strength   = 0     # Type of Dependency (Depends, Recommends, Suggests, Experimental, New, Avoid, Ignore, WNPP
 
     # sort these objects according to the package name
@@ -1219,7 +1216,8 @@ class TaskDependencies:
                             tmp_dep_list.append(dep)
                         dep = DependantPackage(self.blendname, self.task)
                         # Store the comments in case they might be usefull for later applications
-                        dep.why            = why
+                        if why:
+                            dep.properties['why'] = why
                         if responsible:
                             (_name, _url) = email.utils.parseaddr(responsible)
                             dep.properties['maintainer'] = {'name':_name, 'email': _url}
@@ -1380,12 +1378,10 @@ class TaskDependencies:
                     dep.pkgstatus = key.lower()
                 elif key == 'Remark':
                     (shortDesc, longDesc) = SplitDescription(stanza['remark'])
-                    if dep is None:
-                        _pkg = self.metapkg.PrintedName
-                    else:
-                        _pkg = dep.pkg
-                    remark['short'] = shortDesc
-                    remark['long']  = longDesc
+                    if shortDesc:
+                        remark['short'] = shortDesc
+                    if longDesc:
+                        remark['long'] = longDesc
                     continue
                 else:
                     if key not in KEYSTOIGNORE:
@@ -1416,10 +1412,11 @@ class TaskDependencies:
                         break
 
             tmp_dep_list.append(dep)
-            # remarks which are common to several dependencies in a list have to be added to all of the dependencies
+            # remarks which are common to several dependencies in a list have
+            # to be added to all of the dependencies
             for dep in tmp_dep_list:
-                if remark != {}:
-                    dep.remark = remark
+                if remark:
+                    dep.properties['remark'] = remark
                 if fields_obsolete != [] and dep.pkgstatus != 'new':
                     logger.info("Package %s is an official package and has information in UDD. The following extra information can be removed from tasks file %s: %s"
                                 % (dep.pkg, dep.taskname, str(fields_obsolete)))
@@ -1848,7 +1845,8 @@ class TaskDependencies:
                                 tmp_dep_list.append(dep)
                             dep = DependantPackage(self.blendname, self.task)
                             # Store the comments in case they might be usefull for later applications
-                            dep.why            = why
+                            if why:
+                                dep.properties['why'] = why
                             if responsible:
                                 (_name, _url) = email.utils.parseaddr(responsible)
                                 dep.properties['maintainer'] = {'name':_name, 'email': _url}
diff --git a/webtools/blendstasktools_udd.py b/webtools/blendstasktools_udd.py
index fe0f738..2856d4f 100644
--- a/webtools/blendstasktools_udd.py
+++ b/webtools/blendstasktools_udd.py
@@ -684,7 +684,6 @@ class DependantPackage:
         self.releases       = []    # List of releases a package might be in
         self.component      = None  # One of: 'main', 'contrib', 'non-free', if a package shows up in several components which
                                     # might happen over different releases, just prefer main over contrib over non-free
-        self.why            = None  # basically used as comment
 
         self.properties     = {}
         self.properties['license']     = 'unknown'
@@ -706,7 +705,6 @@ class DependantPackage:
                                     # WNPP bug and finally can be used for packaging
         self.desc['en']     = {}    # An English description should be available in any case
         self.experimental   = 0     # Set to 1 if package *only* in experimental but not in unstable/testing/stable
-        self.remark         = {}    # Optional remark for a package
         self.dep_strength   = 0     # Type of Dependency (Depends, Recommends, Suggests, Experimental, New, Avoid, Ignore, WNPP
 
     # sort these objects according to the package name
@@ -1201,8 +1199,7 @@ class TaskDependencies:
 
             if row.get('remark'):
                 (shortDesc, longDesc) = SplitDescription(row['remark'])
-                dep.remark['short'] = shortDesc
-                dep.remark['long']  = longDesc
+                dep.properties['remark'] = {'short': shortDesc, 'long': longDesc}
 
             # Publications
             dep.SetPublications(row)
diff --git a/webtools/templates/packages.xhtml b/webtools/templates/packages.xhtml
index 0964aea..fac5539 100644
--- a/webtools/templates/packages.xhtml
+++ b/webtools/templates/packages.xhtml
@@ -584,11 +584,15 @@ function show_fulldesc(hash) {
 			</ul>
 		      </dd>
 		    </py:if>
-		    <py:if test="project.remark">
+		    <py:if test="'remark' in project.properties">
 		      <dt>Remark</dt>
 		      <dd>
-			<py:if test="project.remark['short']">${project.remark['short']}</py:if>
-			<py:if test="project.remark['long']">${render_longdesc(project.remark['long'])}</py:if>
+			<py:if test="'short' in project.properties['remark']">
+			  ${project.properties['remark']['short']}
+			</py:if>
+			<py:if test="'long' in project.properties['remark']">
+			  ${render_longdesc(project.properties['remark']['long'])}
+			</py:if>
 		      </dd>
 		    </py:if>
 		    <py:if test="project.component == 'main'
diff --git a/webtools/templates/tasks.xhtml b/webtools/templates/tasks.xhtml
index e5ae36e..caba9ec 100644
--- a/webtools/templates/tasks.xhtml
+++ b/webtools/templates/tasks.xhtml
@@ -217,10 +217,10 @@
              </div>
            </td>
          </tr>
-	 <tr py:if="project.remark">
+	 <tr py:if="'remark' in project.properties">
 	   <td colspan="3" class="remark">
-	     <div py:if="project.remark['short']"><strong>Remark of ${projectname} team:</strong> ${project.remark['short']}</div>
-	     <div py:if="project.remark['long']">${render_longdesc(project.remark['long'])}</div>
+	     <div py:if="'short' in project.properties['remark']"><strong>Remark of ${projectname} team:</strong> ${project.properties['remark']['short']}</div>
+	     <div py:if="'long' in project.properties['remark']">${render_longdesc(project.properties['remark']['long'])}</div>
 	   </td>
 	 </tr>
        </tbody>

-- 
Static and dynamic websites for Debian Pure Blends



More information about the Blends-commit mailing list