projects
/
dbuscron
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
93834cf
)
args for OptionsParser defaults to sys.argv
author
Konstantin Stepanov
<kstep@p-nut.info>
Sun, 28 Nov 2010 13:24:26 +0000
(15:24 +0200)
committer
Konstantin Stepanov
<kstep@p-nut.info>
Sun, 28 Nov 2010 13:26:12 +0000
(15:26 +0200)
dbuscron/parser.py
patch
|
blob
|
history
diff --git
a/dbuscron/parser.py
b/dbuscron/parser.py
index
b004fb7
..
0d26c85
100644
(file)
--- a/
dbuscron/parser.py
+++ b/
dbuscron/parser.py
@@
-78,8
+78,13
@@
class CrontabParser(object):
yield ruled, command
class OptionsParser(dict):
- def __init__(self, args, opts):
+ def __init__(self, opts, args=None):
super(OptionsParser, self).__init__()
+
+ if args is None:
+ import sys
+ args = sys.argv[1:]
+
from getopt import getopt
go, _ = getopt(args, opts)