linspector-old/lib/frontends/lish.py

33 lines
1 KiB
Python
Raw Normal View History

2013-08-14 20:36:35 +02:00
"""
2013-08-13 23:10:06 +02:00
The Linspector Interactive Shell...
This will become an interface to Linspector at "start" time. Think about MidnightCommander... and then run
Linspector in a screen session and not as daemon, why not? BTW.: Daemonization is at this point of development
cancelled, because it makes no sense to daemonize everything. Linspector is a user software which will run in any
screen session perfectly.
2013-08-14 20:36:35 +02:00
"""
2013-08-13 23:10:06 +02:00
2013-08-14 20:36:35 +02:00
from lib.frontends.frontend import Frontend
2013-08-15 02:24:05 +02:00
import argparse
2013-08-14 20:36:35 +02:00
class LishFrontend(Frontend):
2013-08-13 23:10:06 +02:00
def __init__(self, **kwargs):
2013-08-15 02:24:05 +02:00
print("linspector interactive shell: Enter h or help for commands")
parser = argparse.ArgumentParser()
jobs = kwargs["jobs"]
2013-08-15 02:34:42 +02:00
parser.add_argument("action", choices=["start", "stop"])
2013-08-15 02:24:05 +02:00
parser.add_argument("-l", "--list", help="list current jobs")
while True:
rawInput = raw_input()
print(rawInput)
args = None
try:
2013-08-15 02:34:42 +02:00
args = parser.parse_args(rawInput.split(" "))
2013-08-15 02:24:05 +02:00
except:
pass
print(str(args))