feature/repl
Rui Carmo 2017-05-15 21:51:08 +01:00
rodzic 3307bf281c
commit 315a5bcd2e
1 zmienionych plików z 8 dodań i 7 usunięć

15
piku.py
Wyświetl plik

@ -3,7 +3,7 @@
"Piku Micro-PaaS" "Piku Micro-PaaS"
from click import argument, command, group, get_current_context, option, secho as echo from click import argument, command, group, get_current_context, option, secho as echo
from click_repl import repl #from click_repl import repl
from collections import defaultdict, deque from collections import defaultdict, deque
from datetime import datetime from datetime import datetime
from fcntl import fcntl, F_SETFL, F_GETFL from fcntl import fcntl, F_SETFL, F_GETFL
@ -973,12 +973,13 @@ cat | PIKU_ROOT="%s" %s git-hook %s""" % (PIKU_ROOT, realpath(__file__), app))
call('git-shell -c "%s" ' % (argv[1] + " '%s'" % app), cwd=GIT_ROOT, shell=True) call('git-shell -c "%s" ' % (argv[1] + " '%s'" % app), cwd=GIT_ROOT, shell=True)
@piku.command() # TODO: test further and include better autocompletion
def prompt(): #@piku.command()
"""Starts an interactive prompt""" #def prompt():
repl(get_current_context(), # """Starts an interactive prompt"""
prompt_kwargs={'history': FileHistory(join(dirname(realpath(__file__)), '.piku_history'))}, # repl(get_current_context(),
allow_system_commands=False) # prompt_kwargs={'history': FileHistory(join(dirname(realpath(__file__)), '.piku_history'))},
# allow_system_commands=False)
if __name__ == '__main__': if __name__ == '__main__':
piku() piku()