mirror of
				https://github.com/RicterZ/nhentai.git
				synced 2025-11-04 02:50:55 +01:00 
			
		
		
		
	use dict.update to update config values
This commit is contained in:
		@@ -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': '',
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user