Update command_line.py, commander.py and one other file

This commit is contained in:
Richard Bronkhorst 2023-06-08 18:49:00 +02:00
parent b123410d43
commit e0758a7817
3 changed files with 10 additions and 15 deletions

View File

@ -28,7 +28,7 @@ class CommandLine:
self.stopping = True self.stopping = True
def prompt(self): def prompt(self):
return '> ' return '> hh'
def handle_not_found(self, c, args): def handle_not_found(self, c, args):
print(f'command not found; {c}') print(f'command not found; {c}')

View File

@ -4,20 +4,13 @@ import argparse
from store import Store from store import Store
import importlib import importlib
import sys import sys
from command_line import CommandLine
class Commander(CommandLine): class Commander(CommandLine):
pass def do_foo(self):
store_file = 'data/store.db' store_file = 'data/store.db'
s = Store(store_file) s = Store(store_file)
s.foo()
if __name__ == '__main__':
while True:
importlib.reload(command_line)
from command_line import CommandLine
c = Commander()
c.run()
if c.reloading == False:
break
Commander().run()

View File

@ -6,3 +6,5 @@ class Store:
self.engine, self.session = get_session(fil) self.engine, self.session = get_session(fil)
Base.metadata.create_all(self.engine) Base.metadata.create_all(self.engine)
def foo(self):
print('goo')