Skip to content

Commit

Permalink
Added 'show new modules'.
Browse files Browse the repository at this point in the history
Shows all the modules that are not installed.
  • Loading branch information
vdbaan committed Oct 2, 2016
1 parent cf89ed3 commit 47ec8f7
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/framework.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,23 @@ def show_module():
" " + filename_short + " " * temp_number + description)
print("\n")

def show_new_modules():
modules_path = os.getcwd() + "/modules/"
for path, subdirs, files in os.walk(modules_path):
for name in files:
filename = os.path.join(path, name)
if not "__init__.py" in filename or not "install_update_all":
filename_short = filename.replace(os.getcwd() +"/","")
filename_short = filename_short.replace(".py","")
filename_short = str(filename_short)
description = module_parser(filename, "DESCRIPTION")
location = module_parser(filename,"INSTALL_LOCATION")
if not ((location is None) or (os.path.exists(os.path.join(path.replace("ptf/modules/",""), location)))):
if description != None:
temp_number = 53 - len(filename_short)
print(
" " + filename_short + " " * temp_number + description)
print("\n")

# this is when a use <module> command is initiated
def use_module(module, all_trigger):
Expand Down Expand Up @@ -484,6 +501,11 @@ def find_containing_file(directory, location):
base_counter = 1
show_module()

# list new modules
if prompt == "show new modules":
base_counter = 1
show_new_modules()

# inside joke
if prompt == "install sleeves":
print_error("Scott White? Sleeves? F Sleeves. Scott Rules.")
Expand Down

0 comments on commit 47ec8f7

Please sign in to comment.