its late
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
{
|
||||
"name" : "Out hole",
|
||||
"address" : 16,
|
||||
"priority" : 99, // least priority to make sure all other events appear before
|
||||
"priority" : 99,
|
||||
"bounce_time" : 10
|
||||
},
|
||||
{
|
||||
|
||||
16
cli/main.py
16
cli/main.py
@@ -1,8 +1,10 @@
|
||||
from cursesmenu import *
|
||||
from cursesmenu.items import *
|
||||
import curses
|
||||
import argparse as ap
|
||||
from FlippR_Networking import Networking
|
||||
import keyboard
|
||||
import os
|
||||
|
||||
networking = "notset"
|
||||
|
||||
@@ -19,6 +21,7 @@ def create_menu():
|
||||
sound_menu_item = SubmenuItem("Sounds", sound_menu, menu)
|
||||
menu.append_item(sound_menu_item)
|
||||
|
||||
#actually not supported by server
|
||||
# displays = networking.getDisplays()
|
||||
# display_menu = create_displays_submenu(displays)
|
||||
# display_menu_item = SubmenuItem("Displays", display_menu, menu)
|
||||
@@ -32,9 +35,9 @@ def create_menu():
|
||||
input_item = FunctionItem("Print Input", print_input)
|
||||
menu.append_item(input_item)
|
||||
|
||||
#win = curses.newwin(20,20,20,20)
|
||||
menu.show()
|
||||
|
||||
|
||||
def print_input():
|
||||
while(not keyboard.is_pressed('q')):
|
||||
print(networking.getInputEvent())
|
||||
@@ -81,11 +84,14 @@ def create_submenu(title, items, fun):
|
||||
|
||||
def main():
|
||||
argparser = ap.ArgumentParser()
|
||||
argparser.add_argument("output_socket", help="path to the output socket")
|
||||
argparser.add_argument("input_socket", help="path to the input socket")
|
||||
args = argparser.parse_args()
|
||||
global networking
|
||||
networking = Networking(args.output_socket, args.input_socket)
|
||||
if os.getenv("XDG_RUNTIME_DIR"):
|
||||
path = os.getenv("XDG_RUNTIME_DIR")
|
||||
else:
|
||||
path = "/tmp/"
|
||||
in_path = path + "/S.flippR_driver.in"
|
||||
out_path = path + "/S.flippR_driver.out"
|
||||
networking = Networking(out_path, in_path)
|
||||
print(networking)
|
||||
create_menu()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user