Python SVN - 输出日志消息

时间:2017-06-01 21:12:14

标签: python svn

我已成功找到打印整个日志条目的方法:

import svn.remote

control = svn.remote.RemoteClient('http://10.41.10.29/svn/directory/subdirectory')
for e in control.log_default():
      pprint.pprint(e)

...产生这样的输出:

LogEntry(date=datetime.datetime(2017, 5, 3, 17, 6, 3, 905705, tzinfo=tzutc()), msg='we did something to this', revision=24945, author='bob', changelist=None)
LogEntry(date=datetime.datetime(2017, 4, 10, 14, 52, 37, 145437, tzinfo=tzutc()), msg='wow another change we made', revision=24635, author='bobdrick', changelist=None)

......等等。有没有办法只输出条目的“msg ='...'”部分?

1 个答案:

答案 0 :(得分:0)

我弄清楚了,语法如下:

for e in control.log_default():
      pprint.pprint(e.msg)

轻松修复我忽略了