mirror of
https://gitlab.com/jeancf/twoot.git
synced 2025-02-22 08:12:15 +00:00
initialized loaded_toml to None
This commit is contained in:
parent
30773933f2
commit
f64645cf69
5
twoot.py
5
twoot.py
|
@ -50,7 +50,7 @@ NITTER_URLS = [
|
||||||
'https://nitter.pussthecat.org',
|
'https://nitter.pussthecat.org',
|
||||||
'https://nitter.fdn.fr',
|
'https://nitter.fdn.fr',
|
||||||
'https://nitter.eu',
|
'https://nitter.eu',
|
||||||
'https://twitter.beparanoid.de/',
|
'https://twitter.beparanoid.de',
|
||||||
'https://n.l5.ca',
|
'https://n.l5.ca',
|
||||||
'https://nitter.bus-hit.me',
|
'https://nitter.bus-hit.me',
|
||||||
]
|
]
|
||||||
|
@ -105,8 +105,8 @@ def build_config(args):
|
||||||
except ModuleNotFoundError:
|
except ModuleNotFoundError:
|
||||||
# for python < 3.11, tomli module must be installed
|
# for python < 3.11, tomli module must be installed
|
||||||
import tomli as tomllib
|
import tomli as tomllib
|
||||||
loaded_toml
|
|
||||||
|
|
||||||
|
loaded_toml = None
|
||||||
# Load toml file
|
# Load toml file
|
||||||
try:
|
try:
|
||||||
with open(toml_file, 'rb') as config_file:
|
with open(toml_file, 'rb') as config_file:
|
||||||
|
@ -118,7 +118,6 @@ def build_config(args):
|
||||||
print('Malformed config file')
|
print('Malformed config file')
|
||||||
exit(-1)
|
exit(-1)
|
||||||
|
|
||||||
# Override config parameters with values fount in the file
|
|
||||||
TOML['config'] = loaded_toml['config']
|
TOML['config'] = loaded_toml['config']
|
||||||
for k in TOML['options'].keys():
|
for k in TOML['options'].keys():
|
||||||
try: # Go through all valid keys
|
try: # Go through all valid keys
|
||||||
|
|
Loading…
Reference in New Issue
Block a user