added argparse to cli
This commit is contained in:
15
cli/main.py
15
cli/main.py
@@ -1,8 +1,9 @@
|
||||
from cursesmenu import *
|
||||
from cursesmenu.items import *
|
||||
import argparse as ap
|
||||
from FlippR_Networking import Networking
|
||||
|
||||
networking = Networking("/tmp/S.output", "/tmp/S.input") # todo sock name
|
||||
networking = {}
|
||||
|
||||
def create_menu():
|
||||
menu = CursesMenu("FlippR")
|
||||
@@ -28,7 +29,7 @@ def create_menu():
|
||||
menu.append_item(lamp_menu_item)
|
||||
|
||||
# todo inputs
|
||||
|
||||
|
||||
menu.show()
|
||||
|
||||
|
||||
@@ -70,4 +71,12 @@ def create_submenu(title, items, fun):
|
||||
for item in items:
|
||||
fun_item = FunctionItem(item["name"], fun, args=item["name"])
|
||||
menu.append_item(fun_item)
|
||||
return menu
|
||||
return menu
|
||||
|
||||
def main():
|
||||
argparser = ap.ArgumentParser()
|
||||
argparser.add_argument("input_socket", help="path to the input socket")
|
||||
argparser.add_argument("output_socket", help="path to the output socket")
|
||||
argparser.parse_args()
|
||||
networking = Networking(argparser.output_socket, argparser.input_socket)
|
||||
create_menu()
|
||||
|
||||
Reference in New Issue
Block a user