# for teacher-side machine authorization, please see service # thread to see how it should work, namely the REGISTER message # for now, do nothing return else: self.logger.error("Unknown machine status for %s: %s" % (machine, status)) return popup_menu.show_all() popup_menu.popup(None, None, None, event.button, event.time) return # }}} if __name__ == "__main__": # configure logging logger = system.setup_logger("openclass_teacher") # configuration file config = config.Config(logger, CONFIGFILE, SYSTEM_CONFIGFILE) config.load() # configura o timeout padrao para sockets socket.setdefaulttimeout(2) gtk.gdk.threads_init() gtk.gdk.threads_enter() logger.info("Starting broadcast..") # Main service service try: service = TeacherRunner(logger, config) except: logger.error(_("Unable to start teacher, or teacher is already running"))
return else: self.logger.error("Unknown machine status for %s: %s" % (machine, status)) return popup_menu.show_all() popup_menu.popup(None, None, None, event.button, event.time) return # }}} if __name__ == "__main__": # configure logging logger = system.setup_logger("openclass_teacher") # configuration file config = config.Config(logger, CONFIGFILE, SYSTEM_CONFIGFILE) config.load() # configura o timeout padrao para sockets socket.setdefaulttimeout(2) gtk.gdk.threads_init() gtk.gdk.threads_enter() logger.info("Starting broadcast..") # Main service service try: service = TeacherRunner(logger, config) except: logger.error(
self.logger.debug("Found teacher <%s> at %s" % (name, source)) model = self.teachers.get_model() if name not in [x[0] for x in model]: self.teachers.append_text(name) self.teachers_addr[name] = source # should we enable the login dialog? if len(model) > 0: self.teachers.set_active(0) else: # same teacher pass gobject.timeout_add(1000, self.monitor_bcast) if __name__ == "__main__": # configure logging logger = system.setup_logger("openclass_student") # configuration file config = config.Config(logger, CONFIGFILE, SYSTEM_CONFIGFILE) config.load() # configura o timeout padrao para sockets socket.setdefaulttimeout(5) # Atualizando a lista de interfaces gtk.gdk.threads_init() gtk.gdk.threads_enter() logger.info("Starting GUI..") gui = Student(logger=logger, config=config) gtk.main() # saving config changes and reference values