mirror of
https://git.freetards.xyz/array.in.a.matrix/TexLiLy.git
synced 2025-04-02 13:21:42 -04:00
fix no config file handling
This commit is contained in:
parent
718627ad2e
commit
a3720ce3bf
1 changed files with 10 additions and 5 deletions
15
main.py
15
main.py
|
@ -51,14 +51,19 @@ 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:
|
except FileNotFoundError:
|
||||||
print("No config file found.\nPlease create a file named `texlily.yaml` and read the README file.")
|
print("No config file found.\nPlease create a file named `texlily.yaml` and read the README file.")
|
||||||
quit()
|
quit()
|
||||||
# Retrieve our configuration.
|
try:
|
||||||
homeserver = str(config["homeserver"])
|
# Retrieve our configuration
|
||||||
user = str(config["user"])
|
homeserver = str(config["homeserver"])
|
||||||
token = str(config["token"])
|
user = str(config["user"])
|
||||||
path = str(config["path"])
|
token = str(config["token"])
|
||||||
|
# path = str(config["path"]) # not used
|
||||||
|
except TypeError:
|
||||||
|
print("Invalid configuration file.")
|
||||||
|
quit()
|
||||||
|
|
||||||
client = AsyncClient(homeserver)
|
client = AsyncClient(homeserver)
|
||||||
client.access_token = token
|
client.access_token = token
|
||||||
|
|
Loading…
Add table
Reference in a new issue