add Command class
This commit is contained in:
parent
920897cf2f
commit
3af40dc453
9
Command.py
Normal file
9
Command.py
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
|
||||||
|
class Command:
|
||||||
|
def __init__(self, timenow, cmdline):
|
||||||
|
self.time = timenow
|
||||||
|
self.command = 'start'
|
||||||
|
self.parseCommandLine(cmdline)
|
||||||
|
|
||||||
|
def parseCommandLine(self, cmdline):
|
||||||
|
parts = cmdline.split(None, 1)
|
6
dwtt
6
dwtt
@ -1,6 +1,7 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
|
||||||
from CmdWindow import CmdWindow
|
from CmdWindow import CmdWindow
|
||||||
|
from Command import Command
|
||||||
import sqlite3
|
import sqlite3
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
@ -27,8 +28,9 @@ def main(argv):
|
|||||||
|
|
||||||
for opt, arg in opts:
|
for opt, arg in opts:
|
||||||
if opt == '-c':
|
if opt == '-c':
|
||||||
cmd = doCmdWindow()
|
cmdline = doCmdWindow()
|
||||||
print "cmd was:", cmd
|
print "cmd was:", cmdline
|
||||||
|
cmd = Command(timenow, cmdline)
|
||||||
elif opt == "--help":
|
elif opt == "--help":
|
||||||
usage()
|
usage()
|
||||||
sys.exit()
|
sys.exit()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user