Skip to content

Commit 4ac9899

Browse files
committed
Localize unnamed arguments with named arguments and mapping - invalid syntax 2
During install of an Ubuntu package; File "/usr/lib/python2.7/dist-packages/jarabe/controlpanel/cmd.py", line 102 % ('key': key, 'module': module)) ^ SyntaxError: invalid syntax Regression introduced by e4e2d87. Also removed double translation, and a message that will never be translated.
1 parent 35e100f commit 4ac9899

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

src/jarabe/controlpanel/cmd.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
' option with the same name: %(key)s'
2929
' module: %(module)r')
3030
_no_option_error = _('sugar-control-panel: key=%s not an available option')
31-
_general_error = _('sugar-control-panel: %s')
31+
_general_error = 'sugar-control-panel: %s'
3232

3333

3434
def cmd_help():
@@ -98,10 +98,10 @@ def main():
9898
if found == 1:
9999
print method.__doc__
100100
else:
101-
print _(_same_option_warning
102-
% ('key': key, 'module': module))
101+
print _same_option_warning % \
102+
{'key': key, 'module': module}
103103
if found == 0:
104-
print _(_no_option_error % key)
104+
print _no_option_error % key
105105
if option in ('-l'):
106106
for module in modules:
107107
methods = dir(module)
@@ -121,12 +121,12 @@ def main():
121121
try:
122122
method()
123123
except Exception as detail:
124-
print _(_general_error % detail)
124+
print _general_error % detail
125125
else:
126-
print _(_same_option_warning %
127-
('key': key, 'module': module))
126+
print _same_option_warning % \
127+
{'key': key, 'module': module}
128128
if found == 0:
129-
print _(_no_option_error % key)
129+
print _no_option_error % key
130130
if option in ('-s'):
131131
for module in modules:
132132
method = getattr(module, 'set_' + key, None)
@@ -137,14 +137,14 @@ def main():
137137
try:
138138
note = method(*args)
139139
except Exception as detail:
140-
print _(_general_error % detail)
140+
print _general_error % detail
141141
if note == _RESTART:
142142
note_restart()
143143
else:
144-
print _(_same_option_warning %
145-
('key': key, 'module': module))
144+
print _same_option_warning % \
145+
{'key': key, 'module': module}
146146
if found == 0:
147-
print _(_no_option_error % key)
147+
print _no_option_error % key
148148
if option in ('-c'):
149149
for module in modules:
150150
method = getattr(module, 'clear_' + key, None)
@@ -155,11 +155,11 @@ def main():
155155
try:
156156
note = method(*args)
157157
except Exception as detail:
158-
print _(_general_error % detail)
158+
print _general_error % detail
159159
if note == _RESTART:
160160
note_restart()
161161
else:
162-
print _(_same_option_warning %
163-
('key': key, 'module': module))
162+
print _same_option_warning % \
163+
{'key': key, 'module': module}
164164
if found == 0:
165-
print _(_no_option_error % key)
165+
print _no_option_error % key

0 commit comments

Comments
 (0)