1
我使用Sphinx来记录我用Python编写的一些代码。我在项目中使用了Stuart Gathman的pymilter库,所以我的许多功能都被装饰了。我在这里看到了有关装饰函数和Sphinx的问题,但它们不适用于我,因为我无法修改milter库代码。我无法修改的狮身人面像和装饰器
关于如何解决这个问题而不必重写我的狮身人面像文档的想法会很好。
感谢
@Milter.noreply
def header(self, name, hval):
"""
Processes headers from the incoming message and writes them to a new variable for database storage.
"""
rgxSubject = re.compile('^(subject)', re.IGNORECASE | re.DOTALL)
rgxMessageID = re.compile('^(message-id)', re.IGNORECASE | re.DOTALL)
self.fp.write("%s: %s\n" % (name, hval))
self.headers.append("%s: %s\n" % (name, hval))
if (rgxSubject.search(name)) or (rgxMessageID.search(name)):
self.log.info("%s: %s" % (name, hval))
self.subjMsgId[name] = hval
if (rgxSubject.search(name)): self.Subject = hval
return Milter.CONTINUE