mirror of
https://git.freetards.xyz/array.in.a.matrix/TexLiLy.git
synced 2025-04-02 13:21:42 -04:00
fix no config file handling
This commit is contained in:
parent
718627ad2e
commit
a3720ce3bf
1 changed files with 10 additions and 5 deletions
15
main.py
15
main.py
|
@ -51,14 +51,19 @@ async def main() -> None:
|
|||
try:
|
||||
with open('texlily.yaml', 'r') as conf:
|
||||
config = yaml.safe_load(conf)
|
||||
# if config file does not exist, quit
|
||||
except FileNotFoundError:
|
||||
print("No config file found.\nPlease create a file named `texlily.yaml` and read the README file.")
|
||||
quit()
|
||||
# Retrieve our configuration.
|
||||
homeserver = str(config["homeserver"])
|
||||
user = str(config["user"])
|
||||
token = str(config["token"])
|
||||
path = str(config["path"])
|
||||
try:
|
||||
# Retrieve our configuration
|
||||
homeserver = str(config["homeserver"])
|
||||
user = str(config["user"])
|
||||
token = str(config["token"])
|
||||
# path = str(config["path"]) # not used
|
||||
except TypeError:
|
||||
print("Invalid configuration file.")
|
||||
quit()
|
||||
|
||||
client = AsyncClient(homeserver)
|
||||
client.access_token = token
|
||||
|
|
Loading…
Add table
Reference in a new issue