def config_verify(self): '''Verify configuration Parameters ''' if not validate.validate_ip(ConfigParser.web_server_ip) or \ not validate.validate_ip(ConfigParser.presenter_server_ip) or \ not validate.validate_port(ConfigParser.web_server_port) or \ not validate.validate_port(ConfigParser.presenter_server_port): return False if not validate.validate_integer(ConfigParser.max_face_num, 0, 100): print("Max face num should be 1-100.") logging.warning("Max face num should be 1-100.") return False threshold = ConfigParser.face_match_threshold if not validate.validate_float(threshold, 0, 1): print("Face match threshold should be 0-1.") logging.warning("Face match threshold should be 0-1.") return False if not os.path.isdir(ConfigParser.storage_dir): print("You should create directory \"%s\" manually." % (ConfigParser.storage_dir)) logging.warning("You should create directory \"%s\" manually.", ConfigParser.storage_dir) return False return True
def config_verify(self): '''Verify configuration Parameters ''' if not validate.validate_ip(ConfigParser.web_server_ip) or \ not validate.validate_ip(ConfigParser.presenter_server_ip) or \ not validate.validate_port(ConfigParser.web_server_port) or \ not validate.validate_port(ConfigParser.presenter_server_port): return False return True
def config_verify(self): if not validate.validate_ip(ConfigParser.web_server_ip) or \ not validate.validate_ip(ConfigParser.presenter_server_ip) or \ not validate.validate_port(ConfigParser.web_server_port) or \ not validate.validate_port(ConfigParser.presenter_server_port): return False if not validate.validate_integer(ConfigParser.max_app_num, 0, 10): print("Max app num should be 1-10.") logging.warning("Max app num should be 1-10.") return False if not validate.Integer_greater(ConfigParser.reserved_space, 1024): print("Reserved space should be greater than 1024") logging.warning("Reserved space should be greater than 1024") return False if not os.path.isdir(ConfigParser.storage_dir): print("You should create directory \"%s\" manually." %(ConfigParser.storage_dir)) logging.warning("You should create directory \"%s\" manually.", ConfigParser.storage_dir) return False return True