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
|
||||
|
||||
config = {}
|
||||
with open('texlily.yaml', 'r') as conf:
|
||||
config = yaml.safe_load(conf)
|
||||
if config == None:
|
||||
print("No config file found. ")
|
||||
print("")
|
||||
print("Please create a file named texlily.yaml and read the")
|
||||
print("README.")
|
||||
return
|
||||
try:
|
||||
with open('texlily.yaml', 'r') as conf:
|
||||
config = yaml.safe_load(conf)
|
||||
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"])
|
||||
|
|
Loading…
Add table
Reference in a new issue