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:
|
try:
|
||||||
with open('texlily.yaml', 'r') as conf:
|
with open('texlily.yaml', 'r') as conf:
|
||||||
config = yaml.safe_load(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
|
# Retrieve our configuration
|
||||||
homeserver = str(config["homeserver"])
|
homeserver = str(config["homeserver"])
|
||||||
user = str(config["user"])
|
user = str(config["user"])
|
||||||
token = str(config["token"])
|
token = str(config["token"])
|
||||||
# path = str(config["path"]) # not used
|
# 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:
|
except TypeError:
|
||||||
print("Invalid configuration file.")
|
print("Invalid configuration file.")
|
||||||
quit()
|
quit()
|
||||||
|
|
Loading…
Add table
Reference in a new issue