From d29ed1423a3ab8339e9f9971424b6d848919158b Mon Sep 17 00:00:00 2001 From: williambl Date: Thu, 5 Nov 2015 17:00:50 +0000 Subject: [PATCH] Ignore CMAN.zip & add list mods feature We are now ready for release! Whoo! v1.0 Autonomous Aardvark coming soon! --- .gitignore | 3 ++- CMAN.py | 10 ++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 1d61899..ec85469 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ Data/* -LocalData/* \ No newline at end of file +LocalData/* +CMAN.zip \ No newline at end of file diff --git a/CMAN.py b/CMAN.py index 0593aeb..8dae7f6 100644 --- a/CMAN.py +++ b/CMAN.py @@ -74,6 +74,11 @@ def switch_path_dir(path, dir): #switches root of path to dir given pathsplit[0] = dir.split(os.sep)[-1] #just in case it ends with os.sep return(os.sep.join(pathsplit)) +def listmods(): + modsinstalled = get_installed_jsons() + print("Installed mods:") + print(str(modsinstalled)) + def mergedirs(dir1, dir2): files1 = [] files2 = [] @@ -404,6 +409,7 @@ def print_help(): print(" update: update the CMAN archive") print(" help: display this help message") print(" version: display the CMAN version number") + print(" list: list installed mods") print(" exit: exit CMAN") def get_upgrades(): #returns a list of 2-element lists of jsons (in which index 0 is the version you have and index 1 is the newest version) @@ -496,8 +502,8 @@ def check_upgrades(full): #full is a flag for whether to print full list of upda elif(len(command.split(" ")) == 1): mod = None get_info(mod) - else: - print("Invalid command syntax.") + elif(command.split(" ")[0] == "list"): + listmods() elif(command.split(" ")[0] == "version"): print("CMAN v"+version) elif(command.split(" ")[0] == "help" or command.split(" ")[0] == "?"):