rename the config load function
This commit is contained in:
parent
c392edccf7
commit
f90bd45e5e
|
@ -5,7 +5,7 @@ from .bacon import (
|
||||||
beautify_lisp_string,
|
beautify_lisp_string,
|
||||||
OscCommentMacroListener,
|
OscCommentMacroListener,
|
||||||
SyntaxErrorListener,
|
SyntaxErrorListener,
|
||||||
load_config,
|
load_servers,
|
||||||
comment,
|
comment,
|
||||||
WALKER,
|
WALKER,
|
||||||
LISTENER,
|
LISTENER,
|
||||||
|
@ -16,7 +16,7 @@ __all__ = [
|
||||||
"beautify_lisp_string",
|
"beautify_lisp_string",
|
||||||
"OscCommentMacroListener",
|
"OscCommentMacroListener",
|
||||||
"SyntaxErrorListener",
|
"SyntaxErrorListener",
|
||||||
"load_config",
|
"load_servers",
|
||||||
"comment",
|
"comment",
|
||||||
"WALKER",
|
"WALKER",
|
||||||
"LISTENER",
|
"LISTENER",
|
||||||
|
|
|
@ -4,7 +4,7 @@ from .hog4 import HogNet
|
||||||
from .OscListener import beautify_lisp_string, OscCommentMacroListener
|
from .OscListener import beautify_lisp_string, OscCommentMacroListener
|
||||||
from .script import (
|
from .script import (
|
||||||
SyntaxErrorListener,
|
SyntaxErrorListener,
|
||||||
load_config,
|
load_servers,
|
||||||
comment,
|
comment,
|
||||||
WALKER,
|
WALKER,
|
||||||
LISTENER
|
LISTENER
|
||||||
|
@ -21,7 +21,7 @@ __all__ += [
|
||||||
|
|
||||||
__all__ = [
|
__all__ = [
|
||||||
"SyntaxErrorListener",
|
"SyntaxErrorListener",
|
||||||
"load_config",
|
"load_servers",
|
||||||
"comment",
|
"comment",
|
||||||
"WALKER",
|
"WALKER",
|
||||||
"LISTENER",
|
"LISTENER",
|
||||||
|
|
|
@ -14,7 +14,7 @@ from .OscListener import OscCommentMacroListener
|
||||||
|
|
||||||
__all__ = [
|
__all__ = [
|
||||||
"SyntaxErrorListener",
|
"SyntaxErrorListener",
|
||||||
"load_config",
|
"load_servers",
|
||||||
"comment",
|
"comment",
|
||||||
"WALKER",
|
"WALKER",
|
||||||
"LISTENER",
|
"LISTENER",
|
||||||
|
@ -29,7 +29,7 @@ class SyntaxErrorListener(ErrorListener):
|
||||||
raise SyntaxError(f"line {line}:{column} {msg}")
|
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."""
|
"""Load an ini style configuration file."""
|
||||||
# empty server dictionary
|
# empty server dictionary
|
||||||
servers: Dict[int, object] = {}
|
servers: Dict[int, object] = {}
|
||||||
|
|
5
bs.py
5
bs.py
|
@ -5,13 +5,12 @@
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
import sys
|
import sys
|
||||||
from .bacon import comment, LISTENER, HogNet
|
from .bacon import comment, LISTENER, HogNet, load_servers
|
||||||
from .bacon import load_config as loadBsConfig
|
|
||||||
|
|
||||||
logging.basicConfig(level=logging.INFO)
|
logging.basicConfig(level=logging.INFO)
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
LISTENER.osc = HogNet(loadBsConfig('server.cfg'))
|
LISTENER.osc = HogNet(load_servers('server.cfg'))
|
||||||
|
|
||||||
# handle user input if run directly
|
# handle user input if run directly
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
Loading…
Reference in New Issue