示例#1
0
文件: main.py 项目: csytan/pycmds
 def suggest(self, prefix):
     if CACHING:
         suggestions = memcache.get('suggest:' + prefix)
         if suggestions:
             return suggestions
     suggestions = pycmds.suggest(prefix)
     if CACHING:
         memcache.add('suggest:' + prefix, suggestions, time=6000)
     return suggestions
示例#2
0
文件: misc.py 项目: csytan/pycmds
def list_commands():
    commands = pycmds.suggest('')
    html = ''
    for command in commands:
        html += '<pre>' + command + '</pre>'
    return html