Applied flake8 in config.
This commit is contained in:
parent
690f8ce792
commit
5510b6d3b9
@ -1,5 +1,4 @@
|
||||
import os
|
||||
import copy
|
||||
from .p3 import configparser
|
||||
|
||||
# constant stuff (DFT = DEFAULT)
|
||||
@ -32,12 +31,15 @@ BOOLEANS = {'import_copy', 'import_move', 'color', 'version_warning'}
|
||||
# package-shared config that can be accessed using :
|
||||
# from configs import config
|
||||
_config = None
|
||||
|
||||
|
||||
def config(section=MAIN_SECTION):
|
||||
if _config is None:
|
||||
raise ValueError('not config instanciated yet')
|
||||
_config._section = section
|
||||
return _config
|
||||
|
||||
|
||||
class Config(object):
|
||||
|
||||
def __init__(self, **kwargs):
|
||||
@ -89,5 +91,6 @@ class Config(object):
|
||||
value = str2bool(value)
|
||||
yield name, value
|
||||
|
||||
|
||||
def str2bool(s):
|
||||
return str(s).lower() in ('yes', 'true', 't', 'y', '1')
|
||||
|
Loading…
x
Reference in New Issue
Block a user