mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-23 11:12:47 +01:00
core & Factoids: Allow commands to disable doc-availability checks for programmatically setting it.
This commit is contained in:
parent
f82a7c7e17
commit
43563bcc1c
@ -310,7 +310,7 @@ class Factoids(callbacks.Plugin, plugins.ChannelDBHandler):
|
||||
else:
|
||||
irc.error("This key-factoid relationship already exists.")
|
||||
|
||||
learn = wrap(learn, ['factoid'])
|
||||
learn = wrap(learn, ['factoid'], checkDoc=False)
|
||||
learn._fake__doc__ = _("""[<channel>] <key> %s <value>
|
||||
|
||||
Associates <key> with <value>. <channel> is only
|
||||
|
@ -1038,9 +1038,9 @@ class Spec(object):
|
||||
raise callbacks.ArgumentError
|
||||
return state
|
||||
|
||||
def _wrap(f, specList=[], name=None, **kw):
|
||||
def _wrap(f, specList=[], name=None, checkDoc=True, **kw):
|
||||
name = name or f.func_name
|
||||
assert hasattr(f, '__doc__') and f.__doc__, \
|
||||
assert (not checkDoc) or (hasattr(f, '__doc__') and f.__doc__), \
|
||||
'Command %r has no docstring.' % name
|
||||
f = internationalizeDocstring(f)
|
||||
spec = Spec(specList, **kw)
|
||||
|
Loading…
Reference in New Issue
Block a user