mirror of
https://git.freetards.xyz/array.in.a.matrix/TexLiLy.git
synced 2025-04-02 13:21:42 -04:00
error if no config file found
This commit is contained in:
parent
9680ddd115
commit
718627ad2e
1 changed files with 6 additions and 8 deletions
14
main.py
14
main.py
|
@ -48,14 +48,12 @@ async def main() -> None:
|
||||||
global client
|
global client
|
||||||
|
|
||||||
config = {}
|
config = {}
|
||||||
with open('texlily.yaml', 'r') as conf:
|
try:
|
||||||
config = yaml.safe_load(conf)
|
with open('texlily.yaml', 'r') as conf:
|
||||||
if config == None:
|
config = yaml.safe_load(conf)
|
||||||
print("No config file found. ")
|
except FileNotFoundError:
|
||||||
print("")
|
print("No config file found.\nPlease create a file named `texlily.yaml` and read the README file.")
|
||||||
print("Please create a file named texlily.yaml and read the")
|
quit()
|
||||||
print("README.")
|
|
||||||
return
|
|
||||||
# Retrieve our configuration.
|
# Retrieve our configuration.
|
||||||
homeserver = str(config["homeserver"])
|
homeserver = str(config["homeserver"])
|
||||||
user = str(config["user"])
|
user = str(config["user"])
|
||||||
|
|
Loading…
Add table
Reference in a new issue