add Command class

This commit is contained in:
Josh Holtrop committed 2010-12-09 21:47:16 -05:00
1 parent 920897cf2f
commit 3af40dc453
2 files changed
+13 -2

No files matched your search

+9
View 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)
+4 -2
View File
@@ -1,6 +1,7 @@
#!/usr/bin/env python
from CmdWindow import CmdWindow
from Command import Command
import sqlite3
import os
import sys
@@ -27,8 +28,9 @@ def main(argv):
for opt, arg in opts:
if opt == '-c':
cmd = doCmdWindow()
print "cmd was:", cmd
cmdline = doCmdWindow()
print "cmd was:", cmdline
cmd = Command(timenow, cmdline)
elif opt == "--help":
usage()
sys.exit()