Browse Source

写了俩行

nandHyf 1 year ago
parent
commit
f0f71feaff
2 changed files with 48 additions and 23 deletions
  1. 29 4
      Stateful.py
  2. 19 19
      export_examples/export_example.toml

+ 29 - 4
Stateful.py

@@ -1,9 +1,12 @@
 # @author:hyf
-class Command:
+import sqlite3, tomlkit
+
+# -----
+class UserCommand:
     def __init__(self, obj, command) -> None:
         self.focusMode = False
         self.obj = obj
-        self.Command = command
+        self.command = command
 
 
     def app_help():
@@ -68,15 +71,37 @@ class Trigger():
         pass
 
 
-class Board(Command):
+class Board(UserCommand):
     def __init__(self) -> None:
         super().__init__()
 
 
-class Event(Command):
+class Event(UserCommand):
     def __init__(self) -> None:
         super().__init__()
 
+
+# ----- functions binding command to model -----
+class WithToml(UserCommand):
+    def __init__(self, obj, command):
+        super().__init__(obj, command)
+
+
+class WithSqlite3(UserCommand):
+    def __init__(self, obj, command):
+        super().__init__(obj, command)
+    
+
+    def add_insert():
+        pass
+
+    def edit_update():
+        pass
+
+    def del_delete():
+        pass
+
+
 # class WithMd():
 
 # class WithCsv():

+ 19 - 19
export_examples/export_example.toml

@@ -1,7 +1,7 @@
-[boardUid_1]
-boardUid.boardName = ''
-boardUid.description = ''
-# boardUid.creator = ''
+[boardName_boardUid1]
+boardUid.boardName = ""
+boardUid.description = ""
+# boardUid.creator = ""
 boardUid.createdTime = 2023-09-20T03:42:27Z
 
 boardUid.includedNum = 10
@@ -13,14 +13,14 @@ boardUid.archivedNum = 4
 
 
 # <eventName1>
-tag0.eventUid.name = ''
-tag0.eventUid.description = ''
-# tag0.eventUid.creator = ''
+tag0.eventUid.name = ""
+tag0.eventUid.description = ""
+# tag0.eventUid.creator = ""
 tag0.eventUid.createdTime = 2023-09-20T05:14:44Z
-tag0.eventUid.createdTag = ''
-# tag0.eventUid.ddlTime = ''
-# tag0.eventUid.alarmTime = ''
-tag0.eventUid.currentTag = ''
+tag0.eventUid.createdTag = ""
+# tag0.eventUid.ddlTime = ""
+# tag0.eventUid.alarmTime = ""
+tag0.eventUid.currentTag = ""
 # tag0.eventUid.stackingTime =
 # tag0.eventUid.workingTime = 
 tag0.eventUid.stuckedTime = 2023-09-20T05:16:23Z
@@ -29,14 +29,14 @@ tag0.eventUid.archivedTime = 2023-09-20T05:18:34Z
 
 
 # <evnetName2>
-tag1.eventUid.name = ''
-tag1.eventUid.description = ''
-# tag1.eventUid.creator = ''
+tag1.eventUid.name = ""
+tag1.eventUid.description = ""
+# tag1.eventUid.creator = ""
 tag1.eventUid.createdTime = 2023-09-20T05:19:44Z
-tag1.eventUid.createdTag = ''
-# tag1.eventUid.ddlTime = ''
-# tag1.eventUid.alarmTime = ''
-tag1.eventUid.currentTag = ''
+tag1.eventUid.createdTag = ""
+# tag1.eventUid.ddlTime = ""
+# tag1.eventUid.alarmTime = ""
+tag1.eventUid.currentTag = ""
 # tag1.eventUid.stackingTime =
 # tag1.eventUid.workingTime = 
 tag1.eventUid.stuckedTime = 2023-09-20T05:21:23Z
@@ -44,5 +44,5 @@ tag1.eventUid.doneTime = 2023-09-20T05:22:47Z
 tag1.eventUid.archivedTime = 2023-09-20T05:23:34Z
 
 
-[boardUid_2]
+[boardName_boardUid2]
 # etc...