1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 |
- import Alt, Stateful
- import datetime
-
- class Client():
- def get_config():
-
- configs = ['DBType', 'DBPath', 'lang', 'listStyle', 'displayTimeZone']
-
- rl = Stateful.MatchTomlKeys("dev_config.toml", configs)
-
- global lang, listStyle, dbType, dbPath
- dbType = rl[0]
- dbPath = rl[1]
- lang = rl[2]
- listStyle = rl[3]
- displayTimeZone = rl[4]
-
- def get_help():
- print(Stateful.matchTomlKey("clean_config.toml", lang, "command-help"))
-
- def InUTC(timeZone=0):
- dt_now_UTC0 = str(datetime.datetime.now(datetime.timezone.utc))
- return(dt_now_UTC0)
-
-
-
- def InputCheck(inputs):
- pass
-
- def TransitCommand():
-
- while(1):
- app_commands = input(currentPath + "/: ", ).split(" ")
-
-
-
-
- if len(app_commands) < 5:
-
- app_commands.append(dbPath)
- app_commands.append(dbType)
- Stateful.PackHandler(app_commands)
- elif len(app_commands) >= 5:
- print(">5 error")
- break
-
- def start():
-
- Client.get_config()
- global currentPath
- currentPath = " "
-
-
-
- startState = Stateful.Handler(['/', dbPath, dbType])
- print(startState)
- Client.TransitCommand()
- class View:
- def ToDisplayTime(utcTime, TimeZone):
- displayTime = "displayTime translation not finished"
- return displayTime
-
- def Refresh():
- pass
-
- if __name__ == "__main__":
- Client.start()
|