SF.net SVN: gar:[23080] csw/mgar/gar/v2/lib/python/catalog_notifier.py

wahwah at users.sourceforge.net wahwah at users.sourceforge.net
Fri Feb 28 10:48:14 CET 2014


Revision: 23080
          http://sourceforge.net/p/gar/code/23080
Author:   wahwah
Date:     2014-02-28 09:48:13 +0000 (Fri, 28 Feb 2014)
Log Message:
-----------
catalog_notifier: Adapted to the new code

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

Modified: csw/mgar/gar/v2/lib/python/catalog_notifier.py
===================================================================
--- csw/mgar/gar/v2/lib/python/catalog_notifier.py	2014-02-28 08:18:54 UTC (rev 23079)
+++ csw/mgar/gar/v2/lib/python/catalog_notifier.py	2014-02-28 09:48:13 UTC (rev 23080)
@@ -3,21 +3,22 @@
 """Polls a designated catalog tree, and sends notifications about
 package updates."""
 
-import optparse
-import catalog
-import common_constants
 from Cheetah import Template
-import urllib2
-import logging
-import configuration
-import pprint
+from email.mime.text import MIMEText
 import cPickle
 import json
+import logging
+import optparse
 import os.path
+import pprint
 import smtplib
-from email.mime.text import MIMEText
-import rest
+import urllib2
 
+from lib.python import common_constants
+from lib.python import configuration
+from lib.python import rest
+from lib.python import catalog
+
 REPORT_TMPL = u"""Catalog update report for $email
 Catalog URL: $url
 #import re
@@ -249,7 +250,13 @@
     else:
       logging.debug("%s not found in previous_catalogs_by_triad", key)
   formatter = NotificationFormatter()
-  rest_client = rest.RestClient()
+  username, password = rest.GetUsernameAndPassword()
+  config = configuration.GetConfig()
+  rest_client = rest.RestClient(
+      pkgdb_url=config.get('rest', 'pkgdb'),
+      releases_url=config.get('rest', 'releases'),
+      username=username,
+      password=password)
   notifications = formatter.FormatNotifications(
       cat_tree_url, catalogs, rest_client)
   whitelist = frozenset()

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