예제 #1
0
파일: zephyrUI.py 프로젝트: jhamrick/dodona
 def __init__(self, c = "dodona-test"):
     """
     Initializes the python-zephyr utilities.
     """
     self.cls = c
     # initialize zephyr
     zephyr.init()
     # subscribe to the specified cls
     zephyr.Subscriptions().add((self.cls, '*', '*'))
     # send an initialization message
     self.send(custom_fill('Dodona is now running.  If you find that a topic you wish answered is not accounted for, please send mail to dodona AT mit DOT edu'))
예제 #2
0
파일: zephyrUI.py 프로젝트: aiedward/dodona
 def __init__(self, c="dodona-test"):
     """
     Initializes the python-zephyr utilities.
     """
     self.cls = c
     # initialize zephyr
     zephyr.init()
     # subscribe to the specified cls
     zephyr.Subscriptions().add((self.cls, '*', '*'))
     # send an initialization message
     self.send(
         custom_fill(
             'Dodona is now running.  If you find that a topic you wish answered is not accounted for, please send mail to dodona AT mit DOT edu'
         ))
예제 #3
0
파일: zephyrUI.py 프로젝트: jhamrick/dodona
    def send(self, mess, name = None):
        """
        Sends a zephyr to the specified cls, addressing
        a specific person if specified.
        """
        if name != None:
            mess = name + ": " + mess

        mess = mess.decode("utf-8") # decode the message
        mess = custom_fill(mess)
        # try to send the message
        try:
            z = zephyr.ZNotice(cls=self.cls, fields=["", mess], sender='*****@*****.**')
            foo = str(z.__dict__)
            z.send()
        except KeyboardInterrupt:
            "Dodona is no longer running."
            raise
        except:
            print traceback.format_exc()
예제 #4
0
파일: zephyrUI.py 프로젝트: aiedward/dodona
    def send(self, mess, name=None):
        """
        Sends a zephyr to the specified cls, addressing
        a specific person if specified.
        """
        if name != None:
            mess = name + ": " + mess

        mess = mess.decode("utf-8")  # decode the message
        mess = custom_fill(mess)
        # try to send the message
        try:
            z = zephyr.ZNotice(cls=self.cls,
                               fields=["", mess],
                               sender='*****@*****.**')
            foo = str(z.__dict__)
            z.send()
        except KeyboardInterrupt:
            "Dodona is no longer running."
            raise
        except:
            print traceback.format_exc()