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'))
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' ))
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()
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()