comparison MoinMoin/action/SyncPages.py @ 4397:64d9d0f74a6a

SyncPages: improve code readability
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Wed, 29 Oct 2008 05:25:29 +0100
parents a1a9ac307c0e
children 1c373ce7f3a4
comparison
equal deleted inserted replaced
4396:d53527e1264e 4397:64d9d0f74a6a
72 """ Transforms self.status into a user readable table. """ 72 """ Transforms self.status into a user readable table. """
73 table_line = u"|| %(smiley)s || %(message)s%(raw_suffix)s ||" 73 table_line = u"|| %(smiley)s || %(message)s%(raw_suffix)s ||"
74 table = [] 74 table = []
75 75
76 for line in self.status: 76 for line in self.status:
77 if line[1]: 77 level, message, substitutions, raw_suffix = line
78 if line[2]: 78 if message:
79 macro_args = [line[1]] + list(line[2]) 79 if substitutions:
80 macro_args = [message] + list(substitutions)
80 message = u"<<GetText2(|%s)>>" % (packLine(macro_args), ) 81 message = u"<<GetText2(|%s)>>" % (packLine(macro_args), )
81 else: 82 else:
82 message = u"<<GetText(%s)>>" % (line[1], ) 83 message = u"<<GetText(%s)>>" % (message, )
83 else: 84 else:
84 message = u"" 85 message = u""
85 table.append(table_line % {"smiley": line[0][1], 86 table.append(table_line % {"smiley": level[1],
86 "message": message, 87 "message": message,
87 "raw_suffix": line[3].replace("\n", "<<BR>>")}) 88 "raw_suffix": raw_suffix.replace("\n", "<<BR>>")})
88 89
89 return "\n".join(table) 90 return "\n".join(table)
90 91
91 def parse_page(self): 92 def parse_page(self):
92 """ Parses the parameter page and returns the read arguments. """ 93 """ Parses the parameter page and returns the read arguments. """