From f90bd45e5efa2c0e3342a4ffa487f1b615f421a5 Mon Sep 17 00:00:00 2001 From: Kevin Matz Date: Thu, 12 May 2022 23:19:40 -0400 Subject: [PATCH] rename the config load function --- __init__.py | 4 ++-- bacon/__init__.py | 4 ++-- bacon/script.py | 4 ++-- bs.py | 5 ++--- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/__init__.py b/__init__.py index 365d0ec..8d6f085 100644 --- a/__init__.py +++ b/__init__.py @@ -5,7 +5,7 @@ from .bacon import ( beautify_lisp_string, OscCommentMacroListener, SyntaxErrorListener, - load_config, + load_servers, comment, WALKER, LISTENER, @@ -16,7 +16,7 @@ __all__ = [ "beautify_lisp_string", "OscCommentMacroListener", "SyntaxErrorListener", - "load_config", + "load_servers", "comment", "WALKER", "LISTENER", diff --git a/bacon/__init__.py b/bacon/__init__.py index e9ba15d..a2737c8 100644 --- a/bacon/__init__.py +++ b/bacon/__init__.py @@ -4,7 +4,7 @@ from .hog4 import HogNet from .OscListener import beautify_lisp_string, OscCommentMacroListener from .script import ( SyntaxErrorListener, - load_config, + load_servers, comment, WALKER, LISTENER @@ -21,7 +21,7 @@ __all__ += [ __all__ = [ "SyntaxErrorListener", - "load_config", + "load_servers", "comment", "WALKER", "LISTENER", diff --git a/bacon/script.py b/bacon/script.py index c1160e3..dddaef7 100644 --- a/bacon/script.py +++ b/bacon/script.py @@ -14,7 +14,7 @@ from .OscListener import OscCommentMacroListener __all__ = [ "SyntaxErrorListener", - "load_config", + "load_servers", "comment", "WALKER", "LISTENER", @@ -29,7 +29,7 @@ class SyntaxErrorListener(ErrorListener): raise SyntaxError(f"line {line}:{column} {msg}") -def load_config(file: str = 'server.cfg') -> Dict[int, object]: +def load_servers(file: str = 'server.cfg') -> Dict[int, object]: """Load an ini style configuration file.""" # empty server dictionary servers: Dict[int, object] = {} diff --git a/bs.py b/bs.py index 28f3340..b345e9a 100755 --- a/bs.py +++ b/bs.py @@ -5,13 +5,12 @@ import logging import sys -from .bacon import comment, LISTENER, HogNet -from .bacon import load_config as loadBsConfig +from .bacon import comment, LISTENER, HogNet, load_servers logging.basicConfig(level=logging.INFO) log = logging.getLogger(__name__) -LISTENER.osc = HogNet(loadBsConfig('server.cfg')) +LISTENER.osc = HogNet(load_servers('server.cfg')) # handle user input if run directly if __name__ == '__main__':