mirror of
https://git.freetards.xyz/array.in.a.matrix/TexLiLy.git
synced 2025-04-02 13:21:42 -04:00
cleaned up try..except
This commit is contained in:
parent
f8934853c6
commit
263002bc45
1 changed files with 4 additions and 5 deletions
9
main.py
9
main.py
|
@ -51,16 +51,15 @@ 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()
|
||||
try:
|
||||
# Retrieve our configuration
|
||||
homeserver = str(config["homeserver"])
|
||||
user = str(config["user"])
|
||||
token = str(config["token"])
|
||||
# path = str(config["path"]) # not used
|
||||
# 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()
|
||||
except TypeError:
|
||||
print("Invalid configuration file.")
|
||||
quit()
|
||||
|
|
Loading…
Add table
Reference in a new issue