allow multiple config

This commit is contained in:
piair338 2022-10-16 13:15:00 +00:00
parent a8dacf85d1
commit 7137448f65
1 changed files with 9 additions and 1 deletions

10
V4.py
View File

@ -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)