mirror of
https://github.com/RicterZ/nhentai.git
synced 2025-04-19 18:31:24 +02:00
use dict.update to update config values
This commit is contained in:
parent
51074ee948
commit
8462d2f2aa
@ -43,7 +43,7 @@ def load_config():
|
||||
|
||||
try:
|
||||
with open(constant.NHENTAI_CONFIG_FILE, 'r') as f:
|
||||
constant.CONFIG = json.load(f)
|
||||
constant.CONFIG.update(json.load(f))
|
||||
except json.JSONDecodeError:
|
||||
logger.error('Failed to load config file.')
|
||||
write_config()
|
||||
|
@ -1,6 +1,7 @@
|
||||
# coding: utf-8
|
||||
from __future__ import unicode_literals, print_function
|
||||
import os
|
||||
import copy
|
||||
import tempfile
|
||||
|
||||
try:
|
||||
@ -29,10 +30,10 @@ NHENTAI_HOME = os.path.join(os.getenv('HOME', tempfile.gettempdir()), '.nhentai'
|
||||
NHENTAI_HISTORY = os.path.join(NHENTAI_HOME, 'history.sqlite3')
|
||||
NHENTAI_CONFIG_FILE = os.path.join(NHENTAI_HOME, 'config.json')
|
||||
|
||||
|
||||
CONFIG = {
|
||||
'proxy': {},
|
||||
'cookie': '',
|
||||
'language': '',
|
||||
'template': '',
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user