|
@@ -1,9 +1,40 @@
|
|
|
import kbc_alt
|
|
|
-import Stateful
|
|
|
+import kbc_toml
|
|
|
+import kbc_sqlite
|
|
|
+import kbc_llm
|
|
|
+
|
|
|
import datetime
|
|
|
|
|
|
|
|
|
+oc = {
|
|
|
+"dt":str, # DBType
|
|
|
+"dp":str, # DBPath
|
|
|
+
|
|
|
+"cp":list, # CurrentPath
|
|
|
+"pp":list, # PreviousPath
|
|
|
+
|
|
|
+"next_move":str,
|
|
|
+
|
|
|
+"tp":list, # TargetPath
|
|
|
+"tp_in":list, # ~ after command parameter "in"(&& before command parameter "to")
|
|
|
+"tp_to":list, # ~ after command parameter "to"
|
|
|
+"tp_attr":str # ~ like "-name" in "edit -name oldName to newName"
|
|
|
+}
|
|
|
+# some thoughts:
|
|
|
+# class oc():
|
|
|
+# def get_oc(), def move_oc()
|
|
|
+
|
|
|
+
|
|
|
class kbc_controller():
|
|
|
+ def get_app_config(returnDict:bool=True):
|
|
|
+ tomls = kbc_toml.MatchTomlTable("dev.toml", "app_config", "dict")
|
|
|
+ global app_config
|
|
|
+ app_config = tomls["app_config"]
|
|
|
+
|
|
|
+ if returnDict == True:
|
|
|
+ return app_config
|
|
|
+
|
|
|
+
|
|
|
def get_help():
|
|
|
pass
|
|
|
|
|
@@ -12,18 +43,18 @@ class kbc_controller():
|
|
|
|
|
|
|
|
|
# [todo 3]
|
|
|
- def InUTC(timeZone:int=0):
|
|
|
+ def inUTC(timeZone:int=0):
|
|
|
dt_now_UTC0 = str(datetime.datetime.now(datetime.timezone.utc))
|
|
|
return(dt_now_UTC0)
|
|
|
|
|
|
|
|
|
# [todo 2]
|
|
|
# 前端只检查输入数量正确, 内容正确统一代回后端检查
|
|
|
- def InputHandler():
|
|
|
+ def inputHandler():
|
|
|
pass
|
|
|
|
|
|
|
|
|
- def TransitCommand():
|
|
|
+ def transitCommand():
|
|
|
# do while or for (1)
|
|
|
while(1):
|
|
|
app_commands = input(currentPath + "/: ", ).split(" ")
|
|
@@ -32,13 +63,6 @@ class kbc_controller():
|
|
|
# [todo 1]
|
|
|
# Controller.InputCheck(app_commands)
|
|
|
|
|
|
-
|
|
|
- # [todo 4]
|
|
|
- def GenDB():# Stateful里面还有一个一样的方法
|
|
|
- pass
|
|
|
- # 1. 先检查是否已经存在DB? y/n?
|
|
|
- # 2. 连接性检查(是否要切换到新建的DB)y/n?
|
|
|
-
|
|
|
|
|
|
def makeLog():
|
|
|
pass
|
|
@@ -54,14 +78,5 @@ class kbc_controller():
|
|
|
# kbc_controller.TransitCommand()
|
|
|
|
|
|
|
|
|
-# For ChatGLM3-6B
|
|
|
-class LLM():
|
|
|
- def call():
|
|
|
- pass
|
|
|
-
|
|
|
- def respond():
|
|
|
- pass
|
|
|
-
|
|
|
-
|
|
|
if __name__ == "__main__":
|
|
|
kbc_controller.start()
|