mirror of
https://github.com/JoelBender/bacpypes
synced 2025-09-28 22:15:23 +08:00
allow the INI file name to be specified in the environment
This commit is contained in:
parent
f6a235d4b1
commit
e75257c7d0
|
@ -25,6 +25,7 @@ _debug = 0
|
|||
_log = ModuleLogger(globals())
|
||||
|
||||
# configuration
|
||||
BACPYPES_INI = os.getenv('BACPYPES_INI', 'BACpypes.ini')
|
||||
BACPYPES_DEBUG = os.getenv('BACPYPES_DEBUG', '')
|
||||
BACPYPES_COLOR = os.getenv('BACPYPES_COLOR', None)
|
||||
BACPYPES_MAXBYTES = int(os.getenv('BACPYPES_MAXBYTES', 1048576))
|
||||
|
@ -209,7 +210,7 @@ class ConfigArgumentParser(ArgumentParser):
|
|||
# add a way to read a configuration file
|
||||
self.add_argument('--ini',
|
||||
help="device object configuration file",
|
||||
default="BACpypes.ini",
|
||||
default=BACPYPES_INI,
|
||||
)
|
||||
|
||||
def parse_args(self, *args, **kwargs):
|
||||
|
|
|
@ -19,6 +19,7 @@ _debug = 0
|
|||
_log = ModuleLogger(globals())
|
||||
|
||||
# configuration
|
||||
BACPYPES_INI = os.getenv('BACPYPES_INI', 'BACpypes.ini')
|
||||
BACPYPES_DEBUG = os.getenv('BACPYPES_DEBUG', '')
|
||||
BACPYPES_COLOR = os.getenv('BACPYPES_COLOR', None)
|
||||
BACPYPES_MAXBYTES = int(os.getenv('BACPYPES_MAXBYTES', 1048576))
|
||||
|
@ -199,7 +200,7 @@ class ConfigArgumentParser(ArgumentParser):
|
|||
# add a way to read a configuration file
|
||||
self.add_argument('--ini',
|
||||
help="device object configuration file",
|
||||
default="BACpypes.ini",
|
||||
default=BACPYPES_INI,
|
||||
)
|
||||
|
||||
def parse_args(self, *args, **kwargs):
|
||||
|
|
|
@ -19,6 +19,7 @@ _debug = 0
|
|||
_log = ModuleLogger(globals())
|
||||
|
||||
# configuration
|
||||
BACPYPES_INI = os.getenv('BACPYPES_INI', 'BACpypes.ini')
|
||||
BACPYPES_DEBUG = os.getenv('BACPYPES_DEBUG', '')
|
||||
BACPYPES_COLOR = os.getenv('BACPYPES_COLOR', None)
|
||||
BACPYPES_MAXBYTES = int(os.getenv('BACPYPES_MAXBYTES', 1048576))
|
||||
|
@ -199,7 +200,7 @@ class ConfigArgumentParser(ArgumentParser):
|
|||
# add a way to read a configuration file
|
||||
self.add_argument('--ini',
|
||||
help="device object configuration file",
|
||||
default="BACpypes.ini",
|
||||
default=BACPYPES_INI,
|
||||
)
|
||||
|
||||
def parse_args(self, *args, **kwargs):
|
||||
|
|
Loading…
Reference in New Issue
Block a user