Example #1
0
def getFilledConfig():
    """!Build a config object and fill it with the config data"""
    filledConfig = ConfigYAML()
    assert filledConfig.loadConfigFile(paths.TEST_PATH +
                                       "test_config.yaml") is True
    return filledConfig
Example #2
0
    description="""BOSWatch is a Python Script to receive and
                                 decode german BOS information with rtl_fm and multimon-NG""",
    epilog="""More options you can find in the extern client.ini
                                 file in the folder /config""")
parser.add_argument("-c",
                    "--config",
                    help="Name to configuration File",
                    required=True)
parser.add_argument("-t",
                    "--test",
                    help="Start Client with testdata-set",
                    action="store_true")
args = parser.parse_args()

bwConfig = ConfigYAML()
if not bwConfig.loadConfigFile(paths.CONFIG_PATH + args.config):
    logging.error("cannot load config file")
    exit(1)

# ========== CLIENT CODE ==========
bwClient = None
inputSource = None
inputQueue = queue.Queue()

try:
    ip = bwConfig.get("server", "ip", default="127.0.0.1")
    port = bwConfig.get("server", "port", default="8080")

    if bwConfig.get("client", "useBroadcast", default=False):
        broadcastClient = BroadcastClient()
        if broadcastClient.getConnInfo():
Example #3
0
def makeDescriptor():
    """!Build a descriptor object with loaded configuration"""
    config = ConfigYAML()
    assert config.loadConfigFile(paths.TEST_PATH + "test_config.yaml") is True
    descriptor = Descriptor(config.get("descriptor_test"))
    return descriptor