Browse Source

- 修改了部分方法首字母小写->大写

nandHyf 1 year ago
parent
commit
a1591d73bb
4 changed files with 11 additions and 16 deletions
  1. 5 8
      Controller.py
  2. 2 0
      Exceptions.py
  3. 1 1
      Stateful.py
  4. 3 7
      config.toml

+ 5 - 8
Controller.py

@@ -20,18 +20,18 @@ class Client():
         commands = []
 
 
-
     def get_help():
         print(Stateful.matchTomlKey("config.toml", lang, "command-help"))
 
 
-    def transitCommand():
-        app_command = input("~/: ").split(" ")
+    def TransitCommand():
+        # current path as a var instead↓ of input text
+        app_command = input("        ~/: ").split(" ")
 
 
         app_command.append(dbType)
         app_command.append(dbPath)
-        Stateful.transitHandler(app_command)
+        Stateful.TransitHandler(app_command)
 
 
     def start():
@@ -39,15 +39,12 @@ class Client():
         Client.get_config()
 
         # test code
-        Client.transitCommand()
+        Client.TransitCommand()
 
 
         # 2. list board
         # Command.list
 
-        # 3. wait command input
-
-
 
 if __name__ == "__main__":
     Client.start()

+ 2 - 0
Exceptions.py

@@ -0,0 +1,2 @@
+# err 0: correct config not found
+# err 1: correct DB not found

+ 1 - 1
Stateful.py

@@ -88,7 +88,7 @@ def operate_sqlite3(dbPath, command):
 
 
 # ----- Transit Command Handler -----
-def transitHandler(transit_command):
+def TransitHandler(transit_command):
     dbType = transit_command[-1]
     dbPath = transit_command[-2]
     exec_command = transit_command[0:-3]

+ 3 - 7
config.toml

@@ -8,6 +8,8 @@ listStyle = "tree"
 # >>>need some guidance here<<<
 EnableGlobalCommand = false
 
+# Choose between: sqlite3/toml/md/csv/mongodb
+# However toml/md/csv/mongodb are not supported in v1.0
 DBType = "sqlite3"
 DBPath = "test.db"
 
@@ -16,14 +18,8 @@ DBPath = "test.db"
 # This will not effect the "uid related" time settings(UTC+0)
 displayTime = "UTC+8"
 
-# Choose between: sqlite3/toml/md/csv/mongodb
-# However toml/md/csv/mongodb are not supported in v1.0
-[Database]
-type = "sqlite3"
-path = "test.db"
-
 
-# ----- DB Syntax Translation -----
+# ----- App Command to DB Syntax Translation -----
 [sqlite3]
 list = "SELECT"
 add = "INSERT INTO"