[Nym3-commit] r516 - trunk/nymbaron/Server

jr at conuropsis.org jr at conuropsis.org
Sun Jun 11 18:14:48 CEST 2006


Author: jr
Date: 2006-06-11 18:14:48 +0200 (Sun, 11 Jun 2006)
New Revision: 516

Modified:
   trunk/nymbaron/Server/User.py
Log:
- Changing of the semantic of queue and advanced_send (only in the doc_strings
  for now) 


Modified: trunk/nymbaron/Server/User.py
===================================================================
--- trunk/nymbaron/Server/User.py	2006-06-11 15:34:16 UTC (rev 515)
+++ trunk/nymbaron/Server/User.py	2006-06-11 16:14:48 UTC (rev 516)
@@ -163,7 +163,11 @@
               next 24 hours.
             - list of (time, number), ordered by time, of the number of surbs
               used less than 24 hours ago
-        - queue is a list of strings containing message to be sent"""
+        - queue is a list of (msg, fun, funargs) where
+            - msg is a string containing a message to be sent
+            - fun is a method of User which will be called upon successful
+              transmission of the message
+            - funargs is a tuple containing the arguments of fun"""
         
     def __init__(self, username, config, create = 0):
         """0 : load user data throw an error if the user doesn't exist
@@ -430,11 +434,16 @@
         """
         return self.config.path + os.sep + self.data['username'] + '.surbs'
 
-    def advanced_send(self, msg, add_status = True):
-        """Sends a message to the nymholder through the mixminion network,
-        using the surbs provided by the nymholder. Adds a status control
-        message if the add_status argument is True. Also updates the number
-        of surbs"""
+    def advanced_send(self, msg, add_status = True, fun = None, funargs = None):
+        """Schedules the sending of a message to the nymholder through the
+        mixminion network, using the surbs provided by the nymholder, and try to
+        send the elements present in the send queue. fun is a method of the User
+        object which will be called with argument funargs upon successful
+        sending of the message.
+        #TODO add_status will be removed in the near future. 
+        Adds a status control message if the add_status argument is True. Also
+        updates the number of surbs"""
+        self._load_queue()
         #TODO add surb usage management
         #TODO add the filling of the remaining place available in the the
         #message by syns and msgs here, cf 2.3 items 3



More information about the Nym3-commit mailing list