mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-02 16:09:24 +01:00
Add some (hopefully) elucidating comments. If anyone (*cough*jemfinch*cough)
thinks they are ambiguous or could be better worded, please adjust.
This commit is contained in:
parent
aeed361d4c
commit
85780543aa
@ -544,6 +544,8 @@ class context(object):
|
|||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
return '<%s for %s>' % (self.__class__.__name__, self.spec)
|
return '<%s for %s>' % (self.__class__.__name__, self.spec)
|
||||||
|
|
||||||
|
# additional means: Look for this (and make sure it's of this type). If
|
||||||
|
# there are no arguments for us to check, then use our default.
|
||||||
class additional(context):
|
class additional(context):
|
||||||
def __init__(self, spec, default=None):
|
def __init__(self, spec, default=None):
|
||||||
self.__parent = super(additional, self)
|
self.__parent = super(additional, self)
|
||||||
@ -557,6 +559,8 @@ class additional(context):
|
|||||||
log.debug('Got IndexError, returning default.')
|
log.debug('Got IndexError, returning default.')
|
||||||
setDefault(state, self.default)
|
setDefault(state, self.default)
|
||||||
|
|
||||||
|
# optional means: Look for this, but if it's not the type I'm expecting or
|
||||||
|
# there are no arguments for us to check, then use the default value.
|
||||||
class optional(additional):
|
class optional(additional):
|
||||||
def __call__(self, irc, msg, args, state):
|
def __call__(self, irc, msg, args, state):
|
||||||
try:
|
try:
|
||||||
|
Loading…
Reference in New Issue
Block a user