tangled
alpha
login
or
join now
zenfyr.dev
/
xmpp-discord-bridge
0
fork
atom
fork of https://f-hub.org/XMPP/xmpp-discord-bridge
0
fork
atom
overview
issues
pulls
pipelines
main: Accept the config file from the cli
Alexander "PapaTutuWawa
4 years ago
8ab23c63
40fcd404
+13
-8
1 changed file
expand all
collapse all
unified
split
xmpp_discord_bridge
main.py
+13
-8
xmpp_discord_bridge/main.py
···
489
489
asyncio.ensure_future(self._discord.start(self._token))
490
490
491
491
def main():
492
492
-
if os.path.exists("./config.toml"):
493
493
-
config = toml.load("./config.toml")
494
494
-
elif os.path.exists("/etc/discord-xmpp-bridge/config.toml"):
495
495
-
config = toml.load("/etc/discord-xmpp-bridge/config.toml")
496
496
-
else:
497
497
-
raise Exception("config.toml not found")
498
498
-
499
492
parser = OptionParser()
500
493
parser.add_option(
501
494
"-d", "--debug", dest="debug", help="Enable debug logging", action="store_true"
502
495
)
496
496
+
parser.add_option(
497
497
+
"-c", "--config", dest="config", help="Config file path"
498
498
+
)
503
499
504
500
(options, args) = parser.parse_args()
505
501
verbosity = logging.DEBUG if options.debug else logging.INFO
506
506
-
502
502
+
503
503
+
if options.config:
504
504
+
config = toml.load(options.config)
505
505
+
elif os.path.exists("./config.toml"):
506
506
+
config = toml.load("./config.toml")
507
507
+
elif os.path.exists("/etc/discord-xmpp-bridge/config.toml"):
508
508
+
config = toml.load("/etc/discord-xmpp-bridge/config.toml")
509
509
+
else:
510
510
+
raise Exception("config.toml not found")
511
511
+
507
512
general = config["general"]
508
513
xmpp = BridgeComponent(general["jid"],
509
514
general["secret"],