[Tutor] problem reading script
Lisi
lisi.reisz at gmail.com
Fri Jul 1 11:15:08 CEST 2011
I am supposed to be looking at scripts on-line, reading them and making sure
that I understand them. I think taht most of teh things I can't make more
than a guess at, are modules taht I don't know, and I can mostly make them
out. But the unpaired double quotation mark, " , in the following has me
stumped:
report['BzrLogTail'] = ''.join(bzr_log_tail)
The line ends accurately as it did in the script I was looking at. In case
you need the whole script to make out what the " means, the URL is:
http://bazaar.launchpad.net/~bzr-pqm/bzr/bzr.dev/view/head:/apport/source_bzr.py
and I have copied and pasted the function definition in which it is to be
found after my signature.
I would be extremely grateful for an explanation/translation!
Lisi
def _add_log_tail(report):
# may have already been added in-process
if 'BzrLogTail' in report:
return
bzr_log_lines = open(bzr_log).readlines()
bzr_log_lines.reverse()
bzr_log_tail = []
blanks = 0
for line in bzr_log_lines:
if line == '\n':
blanks += 1
bzr_log_tail.append(line)
27
if blanks >= 2:
28
break
29
30
bzr_log_tail.reverse()
31
report['BzrLogTail'] = ''.join(bzr_log_tail)
More information about the Tutor
mailing list