[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[minion-cvs] Improve documentation
Update of /home/minion/cvsroot/src/minion/lib/mixminion
In directory moria.mit.edu:/tmp/cvs-serv20030/lib/mixminion
Modified Files:
Config.py
Log Message:
Improve documentation
Index: Config.py
===================================================================
RCS file: /home/minion/cvsroot/src/minion/lib/mixminion/Config.py,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -d -r1.36 -r1.37
--- Config.py 17 Jan 2003 06:18:06 -0000 1.36
+++ Config.py 4 Feb 2003 02:03:35 -0000 1.37
@@ -130,7 +130,9 @@
def _parseIntervalList(s):
- """DOCDOC"""
+ """Validation functions. Parse a list of comma-separated intervals
+ in the form ((every)? INTERVAL for INTERVAL)|INTERVAL into a list
+ of interval lengths in seconds."""
items = s.strip().lower().split(",")
ilist = []
for item in items:
@@ -144,8 +146,7 @@
if interval < 1:
raise ConfigError("Repeated interval too small in %s"%s)
- for _ in xrange(ceilDiv(duration, interval)):
- ilist.append(interval)
+ ilist += [interval] * ceilDiv(duration, interval)
elif item.startswith("every "):
raise ConfigError(
"Bad syntax on interval %s. (Did you mean %s for X days?)",
@@ -482,6 +483,8 @@
# default, ) }
# _restrictFormat is 1/0: do we allow full RFC822ness, or do
# we insist on a tight data format?
+ # _restrictKeys is 1/0: do we raise a ConfigError when we see an
+ # unrecognized key, or do we simply generate a warning?
## Validation rules:
# A key without a corresponding entry in _syntax gives an error.
@@ -497,7 +500,7 @@
_syntax = None
_restrictFormat = 0
- _restrictKeys = 1 #DOCDOC
+ _restrictKeys = 1
def __init__(self, filename=None, string=None, assumeValid=0):
"""Create a new _ConfigFile. If <filename> is set, read from