diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f2c22c7 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +venv/ +__pycache__ +node_modules diff --git a/controller/controller.py b/controller/controller.py index bfd782c..3c5e031 100755 --- a/controller/controller.py +++ b/controller/controller.py @@ -105,10 +105,10 @@ def main(arg): def run(): config.set_option('server.headless', True) - # bootstrap.run(gui.__file__, 'streamlit run gui.py --server.headless True', [], di) + bootstrap.run(gui.__file__, 'streamlit run gui.py --server.headless True', [], di) - # p = multiprocessing.Process(target=run) - # p.start() + p = multiprocessing.Process(target=run) + p.start() # import requests @@ -122,15 +122,15 @@ def main(arg): # cli.main_run(str(gui.__file__)) # from streamlit.web.server import Server # server = Server(gui.__file__, 'streamlit run gui.py --server.headless True') - import tornado.web + # import tornado.web - class MainHandler(tornado.web.RequestHandler): - def get(self): - self.write("Hello, world") + # class MainHandler(tornado.web.RequestHandler): + # def get(self): + # self.write("Hello, world") - application = tornado.web.Application([ - (r"/", ), ]) - application.listen(8888) + # application = tornado.web.Application([ + # (r"/", ), ]) + # application.listen(8888) webview.create_window('LED Control', application) webview.start() diff --git a/controller/gui.py b/controller/gui.py index 24c2656..cfc2b04 100644 --- a/controller/gui.py +++ b/controller/gui.py @@ -33,7 +33,6 @@ def main(): except FileNotFoundError: return {'color': '000000', 'saved': []} - def save(conf): path = os.path.expanduser("~/.config/lc/lc.dmp") with open(path, 'wb') as f: @@ -63,7 +62,7 @@ def main(): st.session_state.config['color'] = color[1:] save(st.session_state.config) - controller.set_pixels(color[1:]) + #controller.set_pixels(color[1:]) img = Image.new(mode="RGB", size=(30,30), color=(int(r * 255),int(g * 255),int(b * 255))) st.subheader(color)