def __init__(self): self.logger = Logger.get_logger("Recorder-Service") self.__set_parameters() self.__initialize_gpio() #self.record_task = RecorderRunner(self.record_task_finished_callback) self.logger.info("RecorderManager: Width: %s, Height: %s" % (self.record_width, self.record_height))
@app.route('/start_recording') def start_recording(): return "%d" % rec.start_recording() @app.route('/stop_recording') def stop_recording(): return "%d" % rec.stop_recording() def shutdown_server(): func = flask.request.environ.get('werkzeug.server.shutdown') if func is None: Logger.get_logger("Recorder-Service").warning("Service could not be stopped - not running with the Werkzeug Server") func() if __name__ == '__main__': try: conf = {} execfile("/etc/picamsupervisor/recorder.conf", conf) port = conf["recorder_service_port"] except Exception, e: Logger.get_logger("Recorder-Service").warning( "RecorderService: Service initialization - cannot read config file. Using default port (808)") port = 808 app.run(host='0.0.0.0', port=port, debug=False)
def shutdown_server(): func = flask.request.environ.get('werkzeug.server.shutdown') if func is None: Logger.get_logger("Recorder-Service").warning("Service could not be stopped - not running with the Werkzeug Server") func()
def __init__(self): self.logger = Logger.get_logger("Alarm-Signal-Monitor") self.__resolve_config_file()