Add loading current track and config. Second part and fixes #2
This commit is contained in:
14
ac_tracks.py
14
ac_tracks.py
@@ -42,8 +42,20 @@ def get_configs(track) -> list[str]:
|
||||
configdirs.remove(s)
|
||||
if (len(configdirs) == 0):
|
||||
print("===== The map you entered does not have a config! =====")
|
||||
config = ""
|
||||
return configdirs
|
||||
|
||||
def get_current_track() -> tuple[str, str]:
|
||||
track_name = ""
|
||||
config_name = ""
|
||||
config_file = os.path.join(CONFIG_PATH, CONFIG_FILE)
|
||||
with open(config_file,'r') as file:
|
||||
for line in file:
|
||||
line = line.strip()
|
||||
if line.startswith("TRACK="):
|
||||
track_name = line.replace("TRACK=","").strip()
|
||||
elif line.startswith("CONFIG_TRACK="):
|
||||
config_name = line.replace("CONFIG_TRACK=","").strip()
|
||||
return track_name, config_name
|
||||
|
||||
def change_track(newname, config=""):
|
||||
|
||||
|
||||
Reference in New Issue
Block a user