Skip to content

Commit

Permalink
Merge pull request #19 from killswitch-GUI/dev-sort
Browse files Browse the repository at this point in the history
Add ordered list
  • Loading branch information
killswitch-GUI committed Jun 20, 2016
2 parents bd98b02 + 15d3b7d commit bc39e7e
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions Common/TaskController.py
Original file line number Diff line number Diff line change
Expand Up @@ -726,13 +726,17 @@ def load_modules(self):
def ListModules(self):
print helpers.color(" [*] Available Modules are:\n", blue=True)
self.logger.debug("User Executed ListModules")
lastBase = None
x = 1
ordList = []
finalList = []
for name in self.modules:
parts = name.split("/")
if lastBase and parts[0] != lastBase:
print ""
lastBase = parts[0]
ordList.append(parts[-1])
ordList = sorted(ordList)
for name in ordList:
name = 'Modules/' + name
finalList.append(name)
for name in finalList:
print "\t%s)\t%s" % (x, '{0: <24}'.format(name))
x += 1
print ""
Expand Down

0 comments on commit bc39e7e

Please sign in to comment.