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

Ole Streicher ole at aip.de
Fri Apr 29 14:27:04 UTC 2016


The following commit has been merged in the master branch:
commit d2dbc2cbba010c14db1a2af1c3ca8b8ba49eff72
Author: Ole Streicher <ole at aip.de>
Date:   Fri Apr 29 16:26:56 2016 +0200

    Since 'source' is a flag, use True/False here

diff --git a/webtools/blendstasktools.py b/webtools/blendstasktools.py
index c889c33..f2335e3 100644
--- a/webtools/blendstasktools.py
+++ b/webtools/blendstasktools.py
@@ -842,9 +842,9 @@ class Tasks:
             if os.path.isfile(os.path.join(self.tasksdir, task))
         )
 
-    def GetAllDependencies(self, source=0):
+    def GetAllDependencies(self, source=False):
         # If we want to subscribe ddpo we need the source package names.
-        # In this case set source=1
+        # In this case set source=True
 
         # Obtain the prefix of the meta packages of the Blend using blends-dev tools blend_get_names
         if os.access('/usr/share/blends-dev/blend-get-names', os.X_OK):
@@ -893,7 +893,7 @@ class Tasks:
             else: # Kick file that is obviously no task file from metapackage list
                 self.metapackagekeys = [name for name in self.metapackagekeys if name != task]
 
-        if source == 0:
+        if not source:
             # total number popcon submissions
             query = "EXECUTE popcon_submissions"
             _execute_udd_query(query)
@@ -1071,7 +1071,7 @@ class TaskDependencies:
         if dep.properties['dep_strength'] in ('Ignore', 'Avoid'):
             logger.debug("Ignore/Avoid package : %s" % dep.properties['name'])
             return
-        if source != 1:
+        if not source:
             # In general we can just add the dependency to the list
             self.dependencies[dep.properties['pkgstatus']].append(dep)
             return
@@ -1086,7 +1086,7 @@ class TaskDependencies:
         if not found:
             self.dependencies[dep.properties['pkgstatus']].append(dep)
 
-    def GetTaskDependencies(self, source=0):
+    def GetTaskDependencies(self, source=False):
         global dep_strength_keys
 
         found_description = False
@@ -1697,7 +1697,7 @@ class TaskDependencies:
                     if 'browser' not in self.properties['vcs']:
                         vcs['browser'] = BrowserFromVcsURL(vcs['type'], vcs['url'])
             # We are only interested in source packages (for instance for Bugs page)
-            if source == 1:
+            if source:
                 self.properties['name'] = self.properties['source']
             # Stop using source package in self.properties['name'] because we need the source package to obtain latest uploaders and
             # and bugs should be rendered in the same job - so we need the differentiation anyway
@@ -1706,7 +1706,7 @@ class TaskDependencies:
             logger.error("Failed to obtain source for package", self.properties['name'])
             return
 
-        if source == 0:
+        if not source:
             # If we are querying for source packages to render BTS pages
             # tranlations are irrelevant - so only obtain ddtp translations
             # otherwise
@@ -1772,7 +1772,7 @@ class Available:
     #    available = Available(                     # Initialize instance
     #                          release='testing',      # (default='unstable')
     #                          components=('main'), # Regard only main, default: main, contrib, non-free
-    #                          source=1             # Use source package names, default: use binaries
+    #                          source=True,         # Use source package names, default: use binaries
     #                          arch='sparc'         # (default='i386')
     #                         )
     #
diff --git a/webtools/blendstasktools_udd.py b/webtools/blendstasktools_udd.py
index 5558f69..8016076 100644
--- a/webtools/blendstasktools_udd.py
+++ b/webtools/blendstasktools_udd.py
@@ -812,9 +812,9 @@ class Tasks:
         _execute_udd_query(query)
         self.metapackagekeys = [t[0] for t in curs.fetchall()]
 
-    def GetAllDependencies(self, source=0):
+    def GetAllDependencies(self, source=False):
         # If we want to subscribe ddpo we need the source package names.
-        # In this case set source=1
+        # In this case set source=True
 
         # Obtain the prefix of the meta packages of the Blend
         try:
@@ -858,7 +858,7 @@ class Tasks:
             else: # Kick file that is obviously no task file from metapackage list
                 self.metapackagekeys = [name for name in self.metapackagekeys if name != task]
 
-        if source == 0:
+        if not source:
             # total number popcon submissions
             query = "EXECUTE popcon_submissions"
             _execute_udd_query(query)
@@ -1177,7 +1177,7 @@ class TaskDependencies:
 
             self._AppendDependency2List(dep)
 
-    def GetTaskDependencies(self, source=0):
+    def GetTaskDependencies(self, source=False):
         count = 0
         global dep_strength_keys
         dep = None
diff --git a/webtools/new_upstream.py b/webtools/new_upstream.py
index a0aa65f..67f6d46 100755
--- a/webtools/new_upstream.py
+++ b/webtools/new_upstream.py
@@ -16,7 +16,7 @@ tasks  = Tasks(argv[1])
 if tasks.data['pkglist'] == '':
     stderr.write("Config file webconf/%s.conf is lacking pkglist field.\n" % argv[1])
     exit(-1)
-tasks.GetAllDependencies(source=1)
+tasks.GetAllDependencies(source=True)
 packages = tasks.GetUpdatablePackages(dependencystatus=['official_high', 'official_low', 'non-free', 'experimental'])
 
 for task in packages.keys():

-- 
Static and dynamic websites for Debian Pure Blends



More information about the Blends-commit mailing list