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

Akshita Jha akshita-guest at users.alioth.debian.org
Wed Jul 22 07:43:07 UTC 2015


The following commit has been merged in the master branch:
commit 77a45af97b987d1813bbeca25e2dfe05c1a5f048
Author: Akshita Jha <akshita-guest at users.alioth.debian.org>
Date:   Wed Jul 22 13:12:32 2015 +0530

    Modify blendstasktools_udd.py : Use logger instance - logger.debug instead of print statements

diff --git a/webtools/blendstasktools_udd.py b/webtools/blendstasktools_udd.py
index c300956..135f5b8 100644
--- a/webtools/blendstasktools_udd.py
+++ b/webtools/blendstasktools_udd.py
@@ -574,19 +574,15 @@ def RowDictionaries(cursor):
     """Return a list of dictionaries which specify the values by their column names"""
 
     description = cursor.description
-    #print "Description : ",description
     if not description:
         # even if there are no data sets to return the description should contain the table structure.  If not something went
         # wrong and we return NULL as to represent a problem
-	#print "RETURNING NULL"
         return NULL
     if cursor.rowcount <= 0:
-        #print "RETURNING []"
 	# if there are no rows in the cursor we return an empty list
         return []
 
     data = cursor.fetchall()
-    #print "data : ",data
     result = []
     for row in data:
         resultrow = {}
@@ -595,7 +591,6 @@ def RowDictionaries(cursor):
             resultrow[dd[0]] = row[i]
             i += 1
         result.append(resultrow)
-    #print "RETURNING RESULT"
     return result
 
 def BrowserFromVcsURL(vcs_type, vcs_url):
@@ -840,10 +835,9 @@ class Tasks:
                 translations = metapkg_translations[pkgname]
         
             td.SetMetapackageInfo(pkgname, translations)
-	    # print "task : ",task
+	    logger.debug("Task : %s " % task)	    
             if td.GetTaskDependencies(source):
                 self.tasks[task] = td
-       		# print "I am in here ",self.tasks[task] 
             else: # Kick file that is obviously no task file from metapackage list
                 self.metapackagekeys = filter(lambda name: name != task, self.metapackagekeys)
 
@@ -1012,7 +1006,7 @@ class TaskDependencies:
         if dep == None:
             return
         if dep.dep_strength == 'i' or dep.dep_strength == 'a':
-	    #print "Ignore dep.pkg : ",dep.pkg
+	    logger.debug("Ignore/Avoid package : %s" % dep.pkg)
             return
 
 	# Solves UnicodeEncodeError because of characters present in the
@@ -1036,7 +1030,7 @@ class TaskDependencies:
         except:
            pass
 
-	#print "Appending dep.pkg : ",dep.pkg
+	logger.debug("Appending package to list : %s" % dep.pkg)
         self.dependencies[dep.pkgstatus].append(dep)
         return
 
@@ -1045,23 +1039,23 @@ class TaskDependencies:
 
 	# official pacakage
 	# if pkg_src == 1: 
-	#	print "\n=============OFFICIAL==============\n"
+	#    logger.debug("=============OFFICIAL PACKAGES=============")
 	# prospective package
 	# elif pkg_src == 2:
-	#	print "\n==============PROSPECTIVE==========\n"
+	#    logger.debug("=============PROSPECTIVE PACKAGES==========")
 	# new package
-	# else: 
-	#	print "\n==============NEW==================\n"
+	# elif pkg_src == 3: 
+	#    logger.debug("=============NEW PACKAGES==================")
+	# else:
+	#    logger.debug("=============UNKNOWN PACKAGE===============")
 	
      	for row in RowDictionaries(curs):
-	    #for r in row:
-	    #	print r, ":", row[r]
 	
             # seek for package name in list of packages mentioned in tasks file
             found = False
             for dep in dependencies:
                 if dep.pkg == row['package']:
-		    # print dep.pkg, ":",
+		    logger.debug("Package : %s" % dep.pkg)
                     found = True
                     break
 	
@@ -1235,8 +1229,6 @@ class TaskDependencies:
         _execute_udd_query(query)
         if curs.rowcount > 0:
             dep_info = curs.fetchall()
-            #print "dep_info : ",dep_info
-	    #print 
             for each_dep in dep_info:
                 # class DependantPackage - This class contains all the possible information about a package
                 # Create an object of class DependantPackage
@@ -1255,7 +1247,7 @@ class TaskDependencies:
         _execute_udd_query(query)
         if curs.rowcount > 0:
             self.GetDepInfo(curs, dependencies, 1)
-	    #print "+++++++++++++++++++++", self.task
+	    logger.debug("Executed query for official packages for %s task" % self.task)
 	
 
         # Get the package_name, license, dependency of the prospective dependencies of the task
@@ -1268,9 +1260,7 @@ class TaskDependencies:
         dependencies = []
         if curs.rowcount > 0:
             pros_info = curs.fetchall() 
-	    #print "pros_info : ",pros_info
-
-            for each_pros in pros_info:
+	    for each_pros in pros_info:
                 dep = DependantPackage(self.blendname, self.task)
                 
                 dep.pkg = each_pros[0]          # Name
@@ -1280,8 +1270,6 @@ class TaskDependencies:
                 alldepends.append(dep.pkg)
                 dependencies.append(dep)
 	
-	    #print "alldepends prospective : ",alldepends
-	    #print "dependencies prospective : ",dependencies
 
 	query = "SELECT DISTINCT bp.package, bp.license, b.dependency, bp.component, bp.homepage, bp.section, \
                         bp.source, bp.vcs_type, bp.vcs_url, bp.vcs_browser, bp.changed_by, \
@@ -1300,9 +1288,8 @@ class TaskDependencies:
                 WHERE bp.blend='%s' and b.task='%s' ORDER BY bp.package" % (self.blendname, self.task)
         _execute_udd_query(query)
         if curs.rowcount > 0:
-	    #print "going into getdepinfo from prospective : "
             self.GetDepInfo(curs, dependencies, 2)
-	    #print "-----------------", self.task
+	    logger.debug("Executed query for prospective packages for %s task" % self.task)
 
 
         # Get information about new dependencies of the task
@@ -1314,7 +1301,6 @@ class TaskDependencies:
 	pkgs_new = []
         if curs.rowcount > 0:
             pkgs_new = curs.fetchall()
-	    #print "pkgs_new : ",pkgs_new
 
 	    for each_new_pkg in pkgs_new:
                 dep = DependantPackage(self.blendname, self.task)
@@ -1328,7 +1314,7 @@ class TaskDependencies:
         _execute_udd_query(query)
         if curs.rowcount > 0:
             self.GetDepInfo(curs, dependencies, 3)
-	    #print "xxxxxxxxxxxxxxxxxxx", self.task
+	    logger.debug("Executed query for new packages for %s task" % self.task)
 
 	return 1
 

-- 
Static and dynamic websites for Debian Pure Blends



More information about the Blends-commit mailing list