[csw-devel] SF.net SVN: gar:[13343] csw/mgar/gar/v2/lib/python/csw_upload_pkg.py

wahwah at users.sourceforge.net wahwah at users.sourceforge.net
Thu Feb 17 08:58:40 CET 2011


Revision: 13343
          http://gar.svn.sourceforge.net/gar/?rev=13343&view=rev
Author:   wahwah
Date:     2011-02-17 07:58:40 +0000 (Thu, 17 Feb 2011)

Log Message:
-----------
csw-upload-pkg: Better screen output

Less Python data structures, making it easier to read from screen

Modified Paths:
--------------
    csw/mgar/gar/v2/lib/python/csw_upload_pkg.py

Modified: csw/mgar/gar/v2/lib/python/csw_upload_pkg.py
===================================================================
--- csw/mgar/gar/v2/lib/python/csw_upload_pkg.py	2011-02-16 17:41:16 UTC (rev 13342)
+++ csw/mgar/gar/v2/lib/python/csw_upload_pkg.py	2011-02-17 07:58:40 UTC (rev 13343)
@@ -93,6 +93,11 @@
       self._RemoveFromCatalog(filename, cat_arch, cat_osrel, file_metadata)
 
   def _RemoveFromCatalog(self, filename, arch, osrel, file_metadata):
+    logging.info("Removing %s (%s %s) from catalog %s %s",
+                 file_metadata["catalogname"],
+                 file_metadata["arch"],
+                 file_metadata["osrel"],
+                 arch, osrel)
     md5_sum = self._GetFileMd5sum(filename)
     basename = os.path.basename(filename)
     parsed_basename = opencsw.ParsePackageFileName(basename)
@@ -184,7 +189,8 @@
             catalogs.append(cat_key)
           else:
             logging.info(
-                "Not inserting %s package into %s containing a %s package",
+                "Not inserting %s %s package into %s containing a %s package",
+                catalogname,
                 srv4_osrel, osrel, srv4_in_catalog["osrel"])
           logging.debug(
               "Catalog %s %s %s has another version of %s.",
@@ -217,9 +223,14 @@
       self._InsertIntoCatalog(filename, cat_arch, cat_osrel, file_metadata)
 
   def _InsertIntoCatalog(self, filename, arch, osrel, file_metadata):
-    logging.info(
+    logging.debug(
         "_InsertIntoCatalog(%s, %s, %s)",
         repr(arch), repr(osrel), repr(filename))
+    logging.info("Inserting %s (%s %s) into catalog %s %s",
+                 file_metadata["catalogname"],
+                 file_metadata["arch"],
+                 file_metadata["osrel"],
+                 arch, osrel)
     md5_sum = self._GetFileMd5sum(filename)
     basename = os.path.basename(filename)
     parsed_basename = opencsw.ParsePackageFileName(basename)
@@ -262,7 +273,7 @@
         logging.fatal("Response: %s %s", http_code, d.getvalue())
       raise RestCommunicationError("%s - HTTP code: %s" % (url, http_code))
     else:
-      logging.info("Response: %s %s", http_code, d.getvalue())
+      logging.debug("Response: %s %s", http_code, d.getvalue())
     return http_code
 
   def _GetSrv4FileMetadata(self, md5_sum):
@@ -293,7 +304,7 @@
     return successful, metadata
 
   def _PostFile(self, filename):
-    logging.info("_PostFile(%s)", repr(filename))
+    logging.info("Uploading %s", repr(filename))
     md5_sum = self._GetFileMd5sum(filename)
     c = pycurl.Curl()
     d = StringIO()


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.


More information about the devel mailing list