allow multiple config
This commit is contained in:
parent
a8dacf85d1
commit
7137448f65
10
V4.py
10
V4.py
@ -48,7 +48,7 @@ parser.add_argument(
|
|||||||
)
|
)
|
||||||
|
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"-c", "--config", help="Choose a specific config file", dest="fast", action="store_true"
|
"-c", "--config", help="Choose a specific config file", type=argparse.FileType('r')
|
||||||
)
|
)
|
||||||
|
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
@ -79,7 +79,15 @@ else:
|
|||||||
system("") # enable colors in windows cmd
|
system("") # enable colors in windows cmd
|
||||||
|
|
||||||
#reading configuration
|
#reading configuration
|
||||||
|
|
||||||
config_path = f"{path.abspath( path.dirname( __file__ ) )}/user_data/config.cfg"
|
config_path = f"{path.abspath( path.dirname( __file__ ) )}/user_data/config.cfg"
|
||||||
|
if args.file :
|
||||||
|
config_path = os.path.abspath(args.file.name)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
config = configparser.ConfigParser()
|
config = configparser.ConfigParser()
|
||||||
config.read(config_path)
|
config.read(config_path)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user