本文整理汇总了Python中Output.help方法的典型用法代码示例。如果您正苦于以下问题:Python Output.help方法的具体用法?Python Output.help怎么用?Python Output.help使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Output
的用法示例。
在下文中一共展示了Output.help方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: import Output [as 别名]
# 或者: from Output import help [as 别名]
def main(args):
# get the absolute path of the FastSearch directory
fastSearchDir = os.path.abspath(args[0])[:os.path.abspath(args[0]).rfind(os.sep)] + os.sep
# instantiate the exit code
code = EXIT_CLEAN
# instantiate pre-run update condition
preRunUpdateCheck = False
# declare options list
optionsList = FileHandler.initializeOptionsList(fastSearchDir, [])
colors = Output.Colors(optionsList)
# FastSearch has been updated
if len(args) > 3 and args[1] == '-updatesuccess':
print colors.alert() + '\nFastSearch has been successfully updated to v' + str(Updater.CURRENT_VERSION) + '!' + colors.end()
# display the post update message retrieved from the server
if not (args[2] in ('None', '', None)):
print colors.alert() + args[2:] + colors.end()
# run a QuickSearch and return the results as a list and quit the application
if len(args) > 1 and args[1][1:].lower() in ('r', 'return'):
if len(args) > 2:
optionsList = FileHandler.defaultList
if len(args) > 3 and args[2][1:].lower() in ('d', 'deep', 'deepsearch', 'ds'):
optionsList[0] = True
start = 3
else:
start = 2
# if the user requested a deep search but provided no string
if args[start][1:] in ('d', 'deep', 'deepsearch', 'ds'):
return EXIT_RESULTS_BAD, None
string = args[start].lower()
for i in range(start + 1, len(args)):
string += ' ' + args[i].lower()
search = Search.Search(string, optionsList, colors)
search.start()
search.join()
return EXIT_RESULTS, search.finish()
else:
return EXIT_RESULTS_BAD, None
print colors.blue() + '\n::Welcome to FastSearch v' + str(Updater.CURRENT_VERSION) + ' by Alex Laird::' + colors.end()
# if arguments are specified, use them as the search string
if len(args) > 1 and not args[1] == '-updatesuccess':
if args[1].startswith('-'):
if len(args) == 2 and not args[1][1:].lower() in ('d', 'debug'):
if args[1][1:].lower() in ('help', 'h'):
Output.help(colors)
elif args[1][1:].lower() in ('update', 'updates', 'u'):
runUpdater(fastSearchDir, colors)
elif args[1][1:].lower() in ('credit', 'credits', 'c'):
Output.credits(colors)
elif args[1][1:].lower() in ('option', 'options', 'o', 'pref', 'preferences', 'setting', 'settings'):
optionsList = Options.options(fastSearchDir, optionsList, colors)
else:
print colors.alert() + 'The command-line arguments were not valid. View the help menu for assistance.\n' + colors.end()
# run a benchmark comparing a standard os.walk method (with no comparisons) to the FastSearch localWalk method
elif args[1][1:].lower() in ('d', 'debug'):
try:
code = debug(args, colors)
except:
code = EXIT_DEBUG_ERROR
return code
else:
print colors.alert() + 'The command-line arguments were not valid. View the help menu for assistance.\n' + colors.end()
else:
string = args[1].lower()
for i in range(2, len(args)):
string += ' ' + args[i].lower()
# the search will be launched immedietly with the current working directory as root
code = runSearch(fastSearchDir, string, optionsList, False, colors)[0]
# if no arguments were specified
elif len(args) == 1:
if preRunUpdateCheck:
simpleUpdateChecker(colors)
looping = True
results = None
# loop until the user wants out
while looping:
# retreive a command from the user
string = raw_input(colors.blue() + 'Type (s)earch, (o)ptions, (u)pdate, (h)elp, (c)redits, or (q)uit: ' + colors.end()).lower()
# the user entered a number
if string.strip('[]').isdigit():
if not results == None:
location = int(string.strip('[]')) - 1
ref = 0
# decrement the number as needed to keep it consistent with the correct results subarray
if location > len(results[0]) - 1:
location -= len(results[0])
#.........这里部分代码省略.........