Add debug command.
This commit is contained in:
parent
d23329b019
commit
4e8f82c0a5
@ -1,4 +1,3 @@
|
|||||||
import logging
|
|
||||||
from .knowledge_base import KnowledgeBase
|
from .knowledge_base import KnowledgeBase
|
||||||
from .tests import gac_100
|
from .tests import gac_100
|
||||||
from .modifiable_property import (
|
from .modifiable_property import (
|
||||||
@ -10,6 +9,12 @@ from .modifiable_property import (
|
|||||||
|
|
||||||
bye_phrases = ['bye', 'exit']
|
bye_phrases = ['bye', 'exit']
|
||||||
|
|
||||||
|
|
||||||
|
def debug(knowledge):
|
||||||
|
for key in knowledge.knowledge:
|
||||||
|
print("\x1b[1m{}\x1b[0m {}".format(key, knowledge.knowledge[key]))
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
knowledge = gac_100.main()
|
knowledge = gac_100.main()
|
||||||
while True:
|
while True:
|
||||||
@ -23,6 +28,10 @@ def main():
|
|||||||
if not data:
|
if not data:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
if data == '/debug':
|
||||||
|
debug(knowledge)
|
||||||
|
continue
|
||||||
|
|
||||||
ret = knowledge.process(data)
|
ret = knowledge.process(data)
|
||||||
if ret:
|
if ret:
|
||||||
result, _, _ = ret
|
result, _, _ = ret
|
||||||
|
Loading…
Reference in New Issue
Block a user