Wednesday, July 22, 2009
trac代码阅读3 - upgrade database
重写IEnvironmentSetupParticipant中的三个方法, 然后记得在__init__.py中import 你的IEnvironmentSetupParticipant实现, 此时安装并启用插件之后, 就会出现: trac-admin /path/to/trac upgrade的提示
Saturday, July 18, 2009
trac代码阅读2 - yield expressions
例:
def test(value = None):
i = value or 0
while i < 100:
yield i
i += 1
=============>>>>>
>>> s.next()
0
>>> s.next()
1
>>> s.next()
2
>>> s.next()
3
由外部逻辑控制此generator function的执行, we called it: Semi-Coroutine
Thursday, July 16, 2009
Subscribe to:
Posts (Atom)