def run(self): """ Start of main cycle of the application """ log.debug('Starter::run()') try: Server(conf.port).run() except Exception as E: log.critical(E)
def run(self): """ Method which starts TCP-server """ log.debug("Server::run()") if not HandlerClass: log.critical('No protocol handlers specified! (use --handler)') return server_thread = Thread(target=self.server.serve_forever) server_thread.setDaemon(False) server_thread.start() log.info("Server is started on port %s", self.port)
def run(): """ Start of main cycle of the application """ log.debug('Starter::run()') try: # check specified port if not conf.port: raise Exception("Please specify port number! (use --port)") Server(conf.port).run() except Exception as E: log.critical(E)
def run(self): """ Starting check for incoming emails """ log.debug('CameraChecker::run()') try: for email in self.getEmails(): data = self.parseEmail(email) if not data: continue log.debug('Data found: %s, %s', data["uid"], data["time"]) self.store.send(data) except Exception as E: log.critical(E)
conf.redisPort = int(conf.get("redis", "port")) conf.redisPassword = conf.get("redis", "password") conf.amqpConnection = conf.get("amqp", "connection") conf.hostName = conf.get("pipe", "hostname") conf.hostIp = conf.get("pipe", "hostip") if not conf.hostIp: from lib.ip import get_ip conf.hostIp = get_ip() if not conf.hostName: conf.hostName = conf.hostIp conf.environment = conf.get("pipe", "environment") if not conf.environment: conf.environment = 'production' except Exception as E: log.critical("Error reading " + options.pipeconf + ": %s", E) exit(1) try: conf.read(options.handlerconf) # server's base settings if options.port and (options.port != '0'): conf.port = int(options.port) else: conf.port = conf.getint("general", "port") conf.socketPacketLength = conf.getint("general", "socketPacketLength") conf.pathStorage = conf.get("general", "pathStorage") conf.pathTrash = conf.get("general", "pathTrash") except Exception as E: