mirror of
				https://gitea.augustin64.fr/piair/MsRewards-Reborn.git
				synced 2025-11-03 23:23:53 +01:00 
			
		
		
		
	only the number of the config
This commit is contained in:
		@@ -44,7 +44,7 @@ parser.add_argument(
 | 
				
			|||||||
    "-c", 
 | 
					    "-c", 
 | 
				
			||||||
    "--config", 
 | 
					    "--config", 
 | 
				
			||||||
    help="Choose a specific config file", 
 | 
					    help="Choose a specific config file", 
 | 
				
			||||||
    type=argparse.FileType('r')
 | 
					    default=""
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
parser.add_argument(
 | 
					parser.add_argument(
 | 
				
			||||||
@@ -88,15 +88,20 @@ g.islinux = platform == "linux" # if the computer running this program is Linux,
 | 
				
			|||||||
g.start_time = time()
 | 
					g.start_time = time()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#reading configuration
 | 
					#reading configuration
 | 
				
			||||||
 | 
					 | 
				
			||||||
config_path = f"{path.abspath(path.dirname(path.dirname( __file__ )))}/user_data/config.cfg"
 | 
					 | 
				
			||||||
if args.config :
 | 
					 | 
				
			||||||
    config_path = path.abspath(args.config.name)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
config = configparser.ConfigParser()
 | 
					config = configparser.ConfigParser()
 | 
				
			||||||
config.read(config_path)
 | 
					
 | 
				
			||||||
 | 
					if args.config :
 | 
				
			||||||
 | 
					    try :
 | 
				
			||||||
 | 
					        config_path  =f"{path.abspath(path.dirname(path.dirname( __file__ )))}/user_data/config{args.config}.cfg"
 | 
				
			||||||
 | 
					        config.read(config_path)
 | 
				
			||||||
 | 
					        g.mot_path = config["PATH"]["motpath"]
 | 
				
			||||||
 | 
					    except :
 | 
				
			||||||
 | 
					        config_path = path.abspath(args.config)
 | 
				
			||||||
 | 
					        config.read(config_path)
 | 
				
			||||||
 | 
					else : 
 | 
				
			||||||
 | 
					    config_path = f"{path.abspath(path.dirname(path.dirname( __file__ )))}/user_data/config.cfg"
 | 
				
			||||||
 | 
					    config.read(config_path)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# path configurations
 | 
					# path configurations
 | 
				
			||||||
g.mot_path = config["PATH"]["motpath"]
 | 
					g.mot_path = config["PATH"]["motpath"]
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user