infocalypse

(djk)
2009-04-30: Enabled fmsnotify sending. Set the default group for fmsread and

Enabled fmsnotify sending. Set the default group for fmsread and fmsnotify to infocalypse.notify.

diff --git a/infocalypse/config.py b/infocalypse/config.py
--- a/infocalypse/config.py
+++ b/infocalypse/config.py
@@ -26,7 +26,8 @@ import sys
 
 from fcpclient import get_usk_hash, is_usk_file, get_version, \
      get_usk_for_usk_version
-from knownrepos import DEFAULT_TRUST, DEFAULT_GROUPS
+from knownrepos import DEFAULT_TRUST, DEFAULT_GROUPS, \
+     DEFAULT_NOTIFICATION_GROUP
 from mercurial import util
 from ConfigParser import ConfigParser
 
@@ -78,8 +79,8 @@ class Config:
 
         self.defaults['FMS_HOST'] = '127.0.0.1'
         self.defaults['FMS_PORT'] = 1119
-        self.defaults['FMS_ID'] = None # REDFLAG?
-        self.defaults['FMSNOTIFY_GROUP'] = None # REDFLAG?
+        self.defaults['FMS_ID'] = None # User must set this in config.
+        self.defaults['FMSNOTIFY_GROUP'] = DEFAULT_NOTIFICATION_GROUP
 
     def get_index(self, usk_or_id):
         """ Returns the highest known USK version for a USK or None. """
diff --git a/infocalypse/fms.py b/infocalypse/fms.py
--- a/infocalypse/fms.py
+++ b/infocalypse/fms.py
@@ -49,9 +49,9 @@ def send_msgs(fms_host, fms_port, msg_tu
                                       msg_tuple[2],
                                       msg_tuple[3])
             in_file = StringIO.StringIO(raw_msg)
-            print raw_msg
+            #print raw_msg
             try:
-                #server.post(in_file)
+                server.post(in_file)
                 pass
             finally:
                 in_file.close()
diff --git a/infocalypse/infcmds.py b/infocalypse/infcmds.py
--- a/infocalypse/infcmds.py
+++ b/infocalypse/infcmds.py
@@ -843,8 +843,9 @@ def execute_fmsnotify(ui_, repo, params,
                        (stored_cfg.defaults['FMS_HOST'],
                         stored_cfg.defaults['FMS_PORT']))
 
-        ui_.status('Group: %s\nSubject: %s\n%s\n' %
-                   (stored_cfg.defaults['FMSNOTIFY_GROUP'],
+        ui_.status('Sender : %s\nGroup  : %s\nSubject: %s\n%s\n' %
+                   (stored_cfg.defaults['FMS_ID'],
+                    stored_cfg.defaults['FMSNOTIFY_GROUP'],
                     subject, text))
 
         if params['VERBOSITY'] >= 5:
diff --git a/infocalypse/knownrepos.py b/infocalypse/knownrepos.py
--- a/infocalypse/knownrepos.py
+++ b/infocalypse/knownrepos.py
@@ -36,4 +36,5 @@ DEFAULT_TRUST = {
     ('be68e8feccdd', ),
     }
 
-DEFAULT_GROUPS = ('test', )
+DEFAULT_GROUPS = ('infocalypse.notify', )
+DEFAULT_NOTIFICATION_GROUP = 'infocalypse.notify'