error if no config file found

This commit is contained in:
array-in-a-matrix 2023-06-12 10:20:48 -04:00
parent 9680ddd115
commit 718627ad2e

10
main.py
View file

@ -48,14 +48,12 @@ async def main() -> None:
global client global client
config = {} config = {}
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 == None: except FileNotFoundError:
print("No config file found. ") print("No config file found.\nPlease create a file named `texlily.yaml` and read the README file.")
print("") quit()
print("Please create a file named texlily.yaml and read the")
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"])