Merge lp:~chromakode/boots/localization into lp:boots
- localization
- Merge into trunk
Proposed by
Max Goodhart
Status: | Merged |
---|---|
Merged at revision: | not available |
Proposed branch: | lp:~chromakode/boots/localization |
Merge into: | lp:boots |
Diff against target: |
1323 lines (+536/-96) 24 files modified
boots/api/__init__.py (+1/-0) boots/api/api.py (+5/-4) boots/api/constructors.py (+5/-3) boots/api/errors.py (+4/-2) boots/app/__init__.py (+1/-1) boots/app/client_config.py (+19/-17) boots/lib/__init__.py (+4/-0) boots/lib/console.py (+20/-17) boots/lib/lingos/bash_external.py (+2/-2) boots/lib/lingos/lingo.py (+3/-1) boots/lib/lingos/lisp/builtins.py (+5/-3) boots/lib/lingos/lisp/lexer.py (+3/-1) boots/lib/lingos/lisp/lisp.py (+7/-4) boots/lib/lingos/lisp/objects.py (+12/-10) boots/lib/lingos/lisp/parser.py (+5/-2) boots/lib/lingos/piped_sql.py (+8/-6) boots/lib/lingos/python.py (+2/-1) boots/lib/lingos/sql.py (+2/-1) boots/lib/ui/components/help.py (+6/-4) boots/lib/ui/components/metacommands.py (+3/-2) boots/lib/ui/plain.py (+24/-15) po/README.txt (+16/-0) po/boots.pot (+376/-0) po/createpots.sh (+3/-0) |
To merge this branch: | bzr merge lp:~chromakode/boots/localization |
Related bugs: | |
Related blueprints: |
Boots Localization
(High)
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Boots Developers | Pending | ||
Review via email: mp+20850@code.launchpad.net |
Commit message
Description of the change
Ken's localization branch + updates and fixes
To post a comment you must log in.
- 117. By Max Goodhart
-
Fix a couple translatable strings in client_config.py.
- 118. By Max Goodhart
-
Fix translatable strings again.
- 119. By Max Goodhart
-
Localize boots.api.
- 120. By Max Goodhart
-
Merge and localize latest updates to trunk.
- 121. By Max Goodhart
-
Update potfile.
- 122. By Max Goodhart
-
Update localization README.
- 123. By Max Goodhart
-
Fix another translatable string that slipped through.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'boots/api/__init__.py' | |||
2 | --- boots/api/__init__.py 2009-12-22 00:12:18 +0000 | |||
3 | +++ boots/api/__init__.py 2010-03-07 09:23:22 +0000 | |||
4 | @@ -0,0 +1,1 @@ | |||
5 | 1 | from boots.lib import _, n_ | ||
6 | 0 | \ No newline at end of file | 2 | \ No newline at end of file |
7 | 1 | 3 | ||
8 | === modified file 'boots/api/api.py' | |||
9 | --- boots/api/api.py 2010-03-05 21:07:26 +0000 | |||
10 | +++ boots/api/api.py 2010-03-07 09:23:22 +0000 | |||
11 | @@ -31,6 +31,7 @@ | |||
12 | 31 | import time | 31 | import time |
13 | 32 | from boots.api import errors | 32 | from boots.api import errors |
14 | 33 | from boots.api.nodes.node import Status | 33 | from boots.api.nodes.node import Status |
15 | 34 | from boots.api import _, n_ | ||
16 | 34 | 35 | ||
17 | 35 | _server_classes = [] | 36 | _server_classes = [] |
18 | 36 | 37 | ||
19 | @@ -85,7 +86,7 @@ | |||
20 | 85 | try: | 86 | try: |
21 | 86 | self._connection = self._connect() | 87 | self._connection = self._connect() |
22 | 87 | except self.db.Error: | 88 | except self.db.Error: |
24 | 88 | raise errors.ConnectionError("Could not connect to {0}".format(self)) | 89 | raise errors.ConnectionError(_("Could not connect to {0}").format(self)) |
25 | 89 | 90 | ||
26 | 90 | @property | 91 | @property |
27 | 91 | def is_connected(self): | 92 | def is_connected(self): |
28 | @@ -97,7 +98,7 @@ | |||
29 | 97 | def _check_connected(self): | 98 | def _check_connected(self): |
30 | 98 | """Raise a ProgrammingError if the Connection has been closed.""" | 99 | """Raise a ProgrammingError if the Connection has been closed.""" |
31 | 99 | if not self.is_connected: | 100 | if not self.is_connected: |
33 | 100 | raise errors.ConnectionError("Connection closed") | 101 | raise errors.ConnectionError(_("Connection closed")) |
34 | 101 | 102 | ||
35 | 102 | def disconnect(self): | 103 | def disconnect(self): |
36 | 103 | self._check_connected() | 104 | self._check_connected() |
37 | @@ -120,7 +121,7 @@ | |||
38 | 120 | except errors.LostConnectionError as lost_e: | 121 | except errors.LostConnectionError as lost_e: |
39 | 121 | # FIXME: this is NOT thread safe | 122 | # FIXME: this is NOT thread safe |
40 | 122 | # Attempt to reconnect and retry | 123 | # Attempt to reconnect and retry |
42 | 123 | yield Status("Lost connection to {0}. Reconnecting...".format(self)) | 124 | yield Status(_("Lost connection to {0}. Reconnecting...").format(self)) |
43 | 124 | 125 | ||
44 | 125 | if self.is_connected: | 126 | if self.is_connected: |
45 | 126 | self.disconnect() | 127 | self.disconnect() |
46 | @@ -132,7 +133,7 @@ | |||
47 | 132 | lost_e.reconnect_exception = e | 133 | lost_e.reconnect_exception = e |
48 | 133 | raise lost_e | 134 | raise lost_e |
49 | 134 | else: | 135 | else: |
51 | 135 | yield Status("Reconnected.") | 136 | yield Status(_("Reconnected.")) |
52 | 136 | 137 | ||
53 | 137 | if cursor.description: | 138 | if cursor.description: |
54 | 138 | field_indexes = extract_field_indexes(cursor.description) | 139 | field_indexes = extract_field_indexes(cursor.description) |
55 | 139 | 140 | ||
56 | === modified file 'boots/api/constructors.py' | |||
57 | --- boots/api/constructors.py 2010-03-07 07:24:29 +0000 | |||
58 | +++ boots/api/constructors.py 2010-03-07 09:23:22 +0000 | |||
59 | @@ -21,9 +21,11 @@ | |||
60 | 21 | # | 21 | # |
61 | 22 | # ##### END LICENSE BLOCK ##### | 22 | # ##### END LICENSE BLOCK ##### |
62 | 23 | 23 | ||
63 | 24 | import re | ||
64 | 25 | |||
65 | 24 | from boots.api.api import Rows, ResultInfo | 26 | from boots.api.api import Rows, ResultInfo |
66 | 25 | from boots.api.nodes.node import NodeGraph, SyncNode, IteratorNode | 27 | from boots.api.nodes.node import NodeGraph, SyncNode, IteratorNode |
68 | 26 | import re | 28 | from boots.api import _, n_ |
69 | 27 | 29 | ||
70 | 28 | _constructors = {} | 30 | _constructors = {} |
71 | 29 | 31 | ||
72 | @@ -31,7 +33,7 @@ | |||
73 | 31 | """Allow the function constructor to be used from PipedSQL under name. constructor is a | 33 | """Allow the function constructor to be used from PipedSQL under name. constructor is a |
74 | 32 | function that takes any number of strings as arguments and returns a node.""" | 34 | function that takes any number of strings as arguments and returns a node.""" |
75 | 33 | if name in _constructors: | 35 | if name in _constructors: |
77 | 34 | raise KeyError('A constructor with name ' + name + ' already exists') | 36 | raise KeyError(_('A constructor with name {0} already exists').format(name)) |
78 | 35 | 37 | ||
79 | 36 | _constructors[name] = constructor | 38 | _constructors[name] = constructor |
80 | 37 | 39 | ||
81 | @@ -42,7 +44,7 @@ | |||
82 | 42 | def construct(name, *arguments): | 44 | def construct(name, *arguments): |
83 | 43 | """Contructs a node using the given name and arguments.""" | 45 | """Contructs a node using the given name and arguments.""" |
84 | 44 | if name not in _constructors: | 46 | if name not in _constructors: |
86 | 45 | raise KeyError('There is no constructor with the name' + ' {0}.'.format(name)) | 47 | raise KeyError(_('There is no constructor with the name {0}.').format(name)) |
87 | 46 | 48 | ||
88 | 47 | return _constructors[name](*arguments) | 49 | return _constructors[name](*arguments) |
89 | 48 | 50 | ||
90 | 49 | 51 | ||
91 | === modified file 'boots/api/errors.py' | |||
92 | --- boots/api/errors.py 2010-03-05 22:13:28 +0000 | |||
93 | +++ boots/api/errors.py 2010-03-07 09:23:22 +0000 | |||
94 | @@ -24,6 +24,8 @@ | |||
95 | 24 | import exceptions | 24 | import exceptions |
96 | 25 | import traceback | 25 | import traceback |
97 | 26 | 26 | ||
98 | 27 | from boots.api import _, n_ | ||
99 | 28 | |||
100 | 27 | class BootsError(exceptions.StandardError): | 29 | class BootsError(exceptions.StandardError): |
101 | 28 | """Base class of boots error exceptions.""" | 30 | """Base class of boots error exceptions.""" |
102 | 29 | pass | 31 | pass |
103 | @@ -48,11 +50,11 @@ | |||
104 | 48 | if self.msg: | 50 | if self.msg: |
105 | 49 | msg.append(self.msg) | 51 | msg.append(self.msg) |
106 | 50 | else: | 52 | else: |
108 | 51 | msg.append("Lost connection to {0}".format(self.server)) | 53 | msg.append(_("Lost connection to {0}").format(self.server)) |
109 | 52 | 54 | ||
110 | 53 | if self.reconnect_exception: | 55 | if self.reconnect_exception: |
111 | 54 | exc_lines = traceback.format_exception_only(type(self.reconnect_exception), self.reconnect_exception) | 56 | exc_lines = traceback.format_exception_only(type(self.reconnect_exception), self.reconnect_exception) |
112 | 55 | exc_text = ". ".join(line.strip() for line in exc_lines) | 57 | exc_text = ". ".join(line.strip() for line in exc_lines) |
114 | 56 | msg.append("(Exception upon reconnect: {0})".format(exc_text)) | 58 | msg.append(_("(Exception upon reconnect: {0})").format(exc_text)) |
115 | 57 | 59 | ||
116 | 58 | return " ".join(msg) | 60 | return " ".join(msg) |
117 | 59 | 61 | ||
118 | === modified file 'boots/app/__init__.py' | |||
119 | --- boots/app/__init__.py 2009-12-23 20:58:28 +0000 | |||
120 | +++ boots/app/__init__.py 2010-03-07 09:23:22 +0000 | |||
121 | @@ -1,1 +1,1 @@ | |||
123 | 1 | __all__ = ["boots", "config", "info"] | 1 | from boots.lib import _, n_ |
124 | 2 | \ No newline at end of file | 2 | \ No newline at end of file |
125 | 3 | 3 | ||
126 | === modified file 'boots/app/client_config.py' | |||
127 | --- boots/app/client_config.py 2010-03-01 08:03:27 +0000 | |||
128 | +++ boots/app/client_config.py 2010-03-07 09:23:22 +0000 | |||
129 | @@ -29,6 +29,8 @@ | |||
130 | 29 | import os, os.path | 29 | import os, os.path |
131 | 30 | import info | 30 | import info |
132 | 31 | 31 | ||
133 | 32 | from boots.app import _, n_ | ||
134 | 33 | |||
135 | 32 | def find_executable(name): | 34 | def find_executable(name): |
136 | 33 | # Search algorithm adapted from os._execvpe | 35 | # Search algorithm adapted from os._execvpe |
137 | 34 | head, tail = os.path.split(name) | 36 | head, tail = os.path.split(name) |
138 | @@ -88,71 +90,71 @@ | |||
139 | 88 | action = "store", | 90 | action = "store", |
140 | 89 | type = "string", | 91 | type = "string", |
141 | 90 | dest = "command", | 92 | dest = "command", |
143 | 91 | help = "Execute command and exit") | 93 | help = _("Execute command and exit")) |
144 | 92 | self._cli_parser.add_option("-D", "--database", | 94 | self._cli_parser.add_option("-D", "--database", |
145 | 93 | action = "store", | 95 | action = "store", |
146 | 94 | type = "string", | 96 | type = "string", |
147 | 95 | dest = "database", | 97 | dest = "database", |
149 | 96 | help = "Use database") | 98 | help = _("Use database")) |
150 | 97 | self._cli_parser.add_option("-f", "--script", | 99 | self._cli_parser.add_option("-f", "--script", |
151 | 98 | action = "store", | 100 | action = "store", |
152 | 99 | type = "string", | 101 | type = "string", |
153 | 100 | dest = "script", | 102 | dest = "script", |
155 | 101 | help = "Execute commands from file and exit") | 103 | help = _("Execute commands from file and exit")) |
156 | 102 | self._cli_parser.add_option('-l', '--lingo', | 104 | self._cli_parser.add_option('-l', '--lingo', |
157 | 103 | action = 'store', | 105 | action = 'store', |
158 | 104 | type = 'string', | 106 | type = 'string', |
159 | 105 | dest = 'lingo', | 107 | dest = 'lingo', |
161 | 106 | help = 'Set the lingo to use') | 108 | help = _('Set the lingo to use')) |
162 | 107 | self._cli_parser.add_option("-X", "--norc", | 109 | self._cli_parser.add_option("-X", "--norc", |
163 | 108 | action = "store_true", | 110 | action = "store_true", |
164 | 109 | dest = "norc", | 111 | dest = "norc", |
166 | 110 | help = "Do not read user configuration file") | 112 | help = _("Do not read user configuration file")) |
167 | 111 | self._cli_parser.add_option("-r", "--rc", | 113 | self._cli_parser.add_option("-r", "--rc", |
168 | 112 | action = "store", | 114 | action = "store", |
169 | 113 | type = "string", | 115 | type = "string", |
170 | 114 | dest = "rcfile", | 116 | dest = "rcfile", |
172 | 115 | help = "Filename of user configuration file") | 117 | help = _("Filename of user configuration file")) |
173 | 116 | self._cli_parser.add_option("-H", "--host", | 118 | self._cli_parser.add_option("-H", "--host", |
174 | 117 | action = "store", | 119 | action = "store", |
175 | 118 | type = "string", | 120 | type = "string", |
176 | 119 | dest = "host", | 121 | dest = "host", |
178 | 120 | help = "Connect to host") | 122 | help = _("Connect to host")) |
179 | 121 | self._cli_parser.add_option("-p", "--port", | 123 | self._cli_parser.add_option("-p", "--port", |
180 | 122 | action = "store", | 124 | action = "store", |
181 | 123 | type = "int", | 125 | type = "int", |
182 | 124 | dest = "port", | 126 | dest = "port", |
184 | 125 | help = "Use port number") | 127 | help = _("Use port number")) |
185 | 126 | self._cli_parser.add_option("-u", "--user", | 128 | self._cli_parser.add_option("-u", "--user", |
186 | 127 | action = "store", | 129 | action = "store", |
187 | 128 | type = "string", | 130 | type = "string", |
188 | 129 | dest = "username", | 131 | dest = "username", |
190 | 130 | help = "Login with username") | 132 | help = _("Login with username")) |
191 | 131 | self._cli_parser.add_option("-P", "--password", | 133 | self._cli_parser.add_option("-P", "--password", |
192 | 132 | action = "store", | 134 | action = "store", |
193 | 133 | type = "string", | 135 | type = "string", |
194 | 134 | dest = "password", | 136 | dest = "password", |
196 | 135 | help = "Connect using password. If none is given, query for password") | 137 | help = _("Connect using password. If none is given, query for password")) |
197 | 136 | self._cli_parser.add_option("--pager", | 138 | self._cli_parser.add_option("--pager", |
198 | 137 | action = "store", | 139 | action = "store", |
199 | 138 | type = "string", | 140 | type = "string", |
200 | 139 | dest = "pager", | 141 | dest = "pager", |
202 | 140 | help = "Pipe query results to the specified pager.") | 142 | help = _("Pipe query results to the specified pager.")) |
203 | 141 | self._cli_parser.add_option("-t", "--terminatingchar", | 143 | self._cli_parser.add_option("-t", "--terminatingchar", |
204 | 142 | action = "store", | 144 | action = "store", |
205 | 143 | type = "string", | 145 | type = "string", |
206 | 144 | dest = "terminating_char", | 146 | dest = "terminating_char", |
208 | 145 | help = "Specify the SQL statement terminating character. Default is ';'.") | 147 | help = _("Specify the SQL statement terminating character. Default is ';'.")) |
209 | 146 | self._cli_parser.add_option("-F", "--historyfile", | 148 | self._cli_parser.add_option("-F", "--historyfile", |
210 | 147 | action = "store", | 149 | action = "store", |
211 | 148 | type = "string", | 150 | type = "string", |
212 | 149 | dest = "history_file", | 151 | dest = "history_file", |
214 | 150 | help = "Specify file to save history to") | 152 | help = _("Specify file to save history to")) |
215 | 151 | self._cli_parser.add_option("-L", "--historylength", | 153 | self._cli_parser.add_option("-L", "--historylength", |
216 | 152 | action = "store", | 154 | action = "store", |
217 | 153 | type = "int", | 155 | type = "int", |
218 | 154 | dest = "history_length", | 156 | dest = "history_length", |
220 | 155 | help = "Specify max history file length") | 157 | help = _("Specify max history file length")) |
221 | 156 | 158 | ||
222 | 157 | def __getitem__(self, key): | 159 | def __getitem__(self, key): |
223 | 158 | """Allows one to use the [] operator to get config items.""" | 160 | """Allows one to use the [] operator to get config items.""" |
224 | @@ -200,11 +202,11 @@ | |||
225 | 200 | except IOError: | 202 | except IOError: |
226 | 201 | if filepath != info.RCFILE: | 203 | if filepath != info.RCFILE: |
227 | 202 | # Only print an error if a non-default rc file was specified. | 204 | # Only print an error if a non-default rc file was specified. |
229 | 203 | print("rcfile {0} not found".format(filepath)) | 205 | print(_("rcfile {0} not found").format(filepath)) |
230 | 204 | except SyntaxError: | 206 | except SyntaxError: |
232 | 205 | print("rcfile {0} contains a syntax error".format(filepath)) | 207 | print(_("rcfile {0} contains a syntax error").format(filepath)) |
233 | 206 | except Exception as e: | 208 | except Exception as e: |
235 | 207 | print("rcfile {0} contains an error: {1}".format(filepath, e)) | 209 | print(_("rcfile {0} contains an error: {1}").format(filepath, e)) |
236 | 208 | return file_dict | 210 | return file_dict |
237 | 209 | 211 | ||
238 | 210 | def get_cli_conf(self): | 212 | def get_cli_conf(self): |
239 | 211 | 213 | ||
240 | === modified file 'boots/lib/__init__.py' | |||
241 | --- boots/lib/__init__.py 2009-12-22 00:12:18 +0000 | |||
242 | +++ boots/lib/__init__.py 2010-03-07 09:23:22 +0000 | |||
243 | @@ -0,0 +1,4 @@ | |||
244 | 1 | import gettext | ||
245 | 2 | translation = gettext.translation("boots", fallback=True) | ||
246 | 3 | _ = translation.lgettext | ||
247 | 4 | n_ = translation.lngettext | ||
248 | 0 | \ No newline at end of file | 5 | \ No newline at end of file |
249 | 1 | 6 | ||
250 | === modified file 'boots/lib/console.py' | |||
251 | --- boots/lib/console.py 2010-03-07 06:42:10 +0000 | |||
252 | +++ boots/lib/console.py 2010-03-07 09:23:22 +0000 | |||
253 | @@ -24,6 +24,8 @@ | |||
254 | 24 | """This module provides the boots Console class. This class is the core | 24 | """This module provides the boots Console class. This class is the core |
255 | 25 | driver of any boots client.""" | 25 | driver of any boots client.""" |
256 | 26 | 26 | ||
257 | 27 | import sys | ||
258 | 28 | |||
259 | 27 | from boots.api import api | 29 | from boots.api import api |
260 | 28 | from boots.api.errors import BootsError, BootsWarning, ConnectionError | 30 | from boots.api.errors import BootsError, BootsWarning, ConnectionError |
261 | 29 | from boots.api.nodes.node import NodeGraph, IteratorNode, LinkStackNode | 31 | from boots.api.nodes.node import NodeGraph, IteratorNode, LinkStackNode |
262 | @@ -37,6 +39,7 @@ | |||
263 | 37 | from boots.lib.lingos import python | 39 | from boots.lib.lingos import python |
264 | 38 | from boots.lib.lingos import piped_sql | 40 | from boots.lib.lingos import piped_sql |
265 | 39 | from boots.lib.lingos import sql | 41 | from boots.lib.lingos import sql |
266 | 42 | from boots.lib import _, n_ | ||
267 | 40 | try: | 43 | try: |
268 | 41 | from boots.lib.lingos.lisp import lisp | 44 | from boots.lib.lingos.lisp import lisp |
269 | 42 | except ImportError: | 45 | except ImportError: |
270 | @@ -63,7 +66,7 @@ | |||
271 | 63 | self.exception = exception | 66 | self.exception = exception |
272 | 64 | 67 | ||
273 | 65 | def __str__(self): | 68 | def __str__(self): |
275 | 66 | return "Boots encountered an internal error: {0}".format(self.exception) | 69 | return _("Boots encountered an internal error: {0}").format(self.exception) |
276 | 67 | 70 | ||
277 | 68 | class Console(object): | 71 | class Console(object): |
278 | 69 | def __init__(self, config, welcome_msg=None): | 72 | def __init__(self, config, welcome_msg=None): |
279 | @@ -113,20 +116,20 @@ | |||
280 | 113 | self.hooks["load"].call() | 116 | self.hooks["load"].call() |
281 | 114 | 117 | ||
282 | 115 | def _init_help(self): | 118 | def _init_help(self): |
285 | 116 | self.help = HelpTopic("boots", "Boots Help", "Help", """ | 119 | self.help = HelpTopic("boots", _("Boots Help"), _("Help"), |
286 | 117 | Boots is a flexible, extensible, and multilingual shell for working with databases. To read more about a subtopic, use `help <topic>`.""") | 120 | description = _("Boots is a flexible, extensible, and multilingual shell for working with databases. To read more about a subtopic, use `help <topic>`.")) |
287 | 118 | 121 | ||
288 | 119 | self.help["commands"] = QueryIndexTopic("commands", None, | 122 | self.help["commands"] = QueryIndexTopic("commands", None, |
290 | 120 | "List of Boots commands.", | 123 | _("List of Boots commands."), |
291 | 121 | query=("commands",)) | 124 | query=("commands",)) |
292 | 122 | 125 | ||
297 | 123 | self.help["commands"].add("\quit", "quit", "Quit boots.") | 126 | self.help["commands"].add("\quit", _("quit"), _("Quit boots.")) |
298 | 124 | self.help["commands"].add("\help", "help", "Show help for a topic.", """ | 127 | self.help["commands"].add("\help", _("help"), _("Show help for a topic."), |
299 | 125 | help <topic> | 128 | description = _("help <topic>\n" |
300 | 126 | Show help for \"topic\".""") | 129 | "Show help for \"topic\".")) |
301 | 127 | 130 | ||
304 | 128 | self.help.add("lingos", "Lingos", "Documentation for loaded lingos.", """ | 131 | self.help.add("lingos", _("Lingos"), _("Documentation for loaded lingos."), |
305 | 129 | A lingo is a command language usable within Boots.""") | 132 | description = _("A lingo is a command language usable within Boots.")) |
306 | 130 | 133 | ||
307 | 131 | def input_complete(self, command, lingo): | 134 | def input_complete(self, command, lingo): |
308 | 132 | if self.metacommands.get_metacommand(command) is not None: | 135 | if self.metacommands.get_metacommand(command) is not None: |
309 | @@ -138,7 +141,7 @@ | |||
310 | 138 | 141 | ||
311 | 139 | def run(self, command, lingo="sql"): | 142 | def run(self, command, lingo="sql"): |
312 | 140 | if not lingo in self.lingos: | 143 | if not lingo in self.lingos: |
314 | 141 | self._display_error(ConsoleError("Invalid lingo \"{0}\" specified.".format(lingo))) | 144 | self._display_error(ConsoleError(_("Invalid lingo \"{0}\" specified.").format(lingo))) |
315 | 142 | return | 145 | return |
316 | 143 | 146 | ||
317 | 144 | result_data = self.lingos[lingo].execute(command) | 147 | result_data = self.lingos[lingo].execute(command) |
318 | @@ -167,7 +170,7 @@ | |||
319 | 167 | self.servers.append(server) | 170 | self.servers.append(server) |
320 | 168 | return True | 171 | return True |
321 | 169 | else: | 172 | else: |
323 | 170 | self._display_error(ConsoleError("Could not connect to {0}:{1}".format(host, port))) | 173 | self._display_error(ConsoleError(_("Could not connect to {0}:{1}").format(host, port))) |
324 | 171 | return False | 174 | return False |
325 | 172 | 175 | ||
326 | 173 | def disconnect(self, host, port): | 176 | def disconnect(self, host, port): |
327 | @@ -186,7 +189,7 @@ | |||
328 | 186 | if self.welcome_msg and self.driver.is_interactive: | 189 | if self.welcome_msg and self.driver.is_interactive: |
329 | 187 | server_lines = [] | 190 | server_lines = [] |
330 | 188 | for server in self.servers: | 191 | for server in self.servers: |
332 | 189 | line_format = "{0.hostname}:{0.port} (server v{0.server_version})" | 192 | line_format = _("{0.hostname}:{0.port} (server v{0.server_version})") |
333 | 190 | server_lines.append(line_format.format(server)) | 193 | server_lines.append(line_format.format(server)) |
334 | 191 | server_status = "\n".join(server_lines) | 194 | server_status = "\n".join(server_lines) |
335 | 192 | 195 | ||
336 | @@ -221,7 +224,7 @@ | |||
337 | 221 | 224 | ||
338 | 222 | def quit(self, exitcode=0): | 225 | def quit(self, exitcode=0): |
339 | 223 | if self.driver.is_interactive: | 226 | if self.driver.is_interactive: |
341 | 224 | self.presenter.presenter_graph.put("Boots quit.") | 227 | self.presenter.presenter_graph.put(_("Boots quit.")) |
342 | 225 | 228 | ||
343 | 226 | self.hooks["unload"].call() | 229 | self.hooks["unload"].call() |
344 | 227 | self.disconnect(None, None) | 230 | self.disconnect(None, None) |
345 | @@ -239,9 +242,9 @@ | |||
346 | 239 | self.presenter.present(topic.format(include_index=True)) | 242 | self.presenter.present(topic.format(include_index=True)) |
347 | 240 | else: | 243 | else: |
348 | 241 | paths = ", ".join("\"{0}\"".format(" ".join(path)) for path in results) | 244 | paths = ", ".join("\"{0}\"".format(" ".join(path)) for path in results) |
350 | 242 | self.presenter.present("Did you mean: {0}?".format(paths)) | 245 | self.presenter.present(_("Did you mean: {0}?").format(paths)) |
351 | 243 | else: | 246 | else: |
353 | 244 | self.presenter.present("No help found for \"{0}\".".format(" ".join(query))) | 247 | self.presenter.present(_("No help found for \"{0}\".").format(" ".join(query))) |
354 | 245 | 248 | ||
355 | 246 | def meta_connect(self, host=None, port=None, database=None): | 249 | def meta_connect(self, host=None, port=None, database=None): |
356 | 247 | if host is None: | 250 | if host is None: |
357 | @@ -270,7 +273,7 @@ | |||
358 | 270 | try: | 273 | try: |
359 | 271 | script_driver = ScriptDriver(self, filepath, self.config["lingo"]) | 274 | script_driver = ScriptDriver(self, filepath, self.config["lingo"]) |
360 | 272 | except IOError as e: | 275 | except IOError as e: |
362 | 273 | self._display_error(ConsoleError("Could not open file {0}".format(filepath))) | 276 | self._display_error(ConsoleError(_("Could not open file {0}").format(filepath))) |
363 | 274 | return | 277 | return |
364 | 275 | 278 | ||
365 | 276 | self.driver_stack.push_input(script_driver.driver_graph.output_link) | 279 | self.driver_stack.push_input(script_driver.driver_graph.output_link) |
366 | 277 | 280 | ||
367 | === modified file 'boots/lib/lingos/bash_external.py' | |||
368 | --- boots/lib/lingos/bash_external.py 2010-02-27 05:54:13 +0000 | |||
369 | +++ boots/lib/lingos/bash_external.py 2010-03-07 09:23:22 +0000 | |||
370 | @@ -25,12 +25,12 @@ | |||
371 | 25 | from boots.lib.lingos import external | 25 | from boots.lib.lingos import external |
372 | 26 | from boots.lib.lingos import lingo | 26 | from boots.lib.lingos import lingo |
373 | 27 | from boots.lib.ui.components.help import HelpTopic | 27 | from boots.lib.ui.components.help import HelpTopic |
375 | 28 | 28 | from boots.lib import _, n_ | |
376 | 29 | 29 | ||
377 | 30 | class ExternalBashInterpreter(external.ExternalInterpreter): | 30 | class ExternalBashInterpreter(external.ExternalInterpreter): |
378 | 31 | """Provides an interface to an external bash shell.""" | 31 | """Provides an interface to an external bash shell.""" |
379 | 32 | 32 | ||
381 | 33 | help = HelpTopic("bash", "Bash Lingo", "External bash shell.") | 33 | help = HelpTopic("bash", _("Bash Lingo"), _("External bash shell.")) |
382 | 34 | 34 | ||
383 | 35 | def __init__(self, *args, **kwargs): | 35 | def __init__(self, *args, **kwargs): |
384 | 36 | super(ExternalBashInterpreter, self).__init__('bash', [], *args, **kwargs) | 36 | super(ExternalBashInterpreter, self).__init__('bash', [], *args, **kwargs) |
385 | 37 | 37 | ||
386 | === modified file 'boots/lib/lingos/lingo.py' | |||
387 | --- boots/lib/lingos/lingo.py 2010-03-04 19:09:05 +0000 | |||
388 | +++ boots/lib/lingos/lingo.py 2010-03-07 09:23:22 +0000 | |||
389 | @@ -23,6 +23,8 @@ | |||
390 | 23 | 23 | ||
391 | 24 | import sys | 24 | import sys |
392 | 25 | 25 | ||
393 | 26 | from boots.lib import _, n_ | ||
394 | 27 | |||
395 | 26 | class LingoRegistry(object): | 28 | class LingoRegistry(object): |
396 | 27 | def __init__(self): | 29 | def __init__(self): |
397 | 28 | self._lingos = {} | 30 | self._lingos = {} |
398 | @@ -31,7 +33,7 @@ | |||
399 | 31 | """Registers a lingo with the given name and interpreter. Raises a KeyError if a lingo with | 33 | """Registers a lingo with the given name and interpreter. Raises a KeyError if a lingo with |
400 | 32 | name is already registered.""" | 34 | name is already registered.""" |
401 | 33 | if name in self._lingos: | 35 | if name in self._lingos: |
403 | 34 | raise KeyError('A lingo with name {0} already exists'.format(name)) | 36 | raise KeyError(_('A lingo with name {0} already exists').format(name)) |
404 | 35 | 37 | ||
405 | 36 | self._lingos[name] = interpreter | 38 | self._lingos[name] = interpreter |
406 | 37 | 39 | ||
407 | 38 | 40 | ||
408 | === modified file 'boots/lib/lingos/lisp/builtins.py' | |||
409 | --- boots/lib/lingos/lisp/builtins.py 2010-02-27 05:40:10 +0000 | |||
410 | +++ boots/lib/lingos/lisp/builtins.py 2010-03-07 09:23:22 +0000 | |||
411 | @@ -21,8 +21,10 @@ | |||
412 | 21 | # | 21 | # |
413 | 22 | # ##### END LICENSE BLOCK ##### | 22 | # ##### END LICENSE BLOCK ##### |
414 | 23 | 23 | ||
415 | 24 | import sys | ||
416 | 25 | |||
417 | 24 | from boots.lib.lingos.lisp import objects | 26 | from boots.lib.lingos.lisp import objects |
419 | 25 | import sys | 27 | from boots.lib import _, n_ |
420 | 26 | 28 | ||
421 | 27 | nil = objects.Null() | 29 | nil = objects.Null() |
422 | 28 | t = objects.T() | 30 | t = objects.T() |
423 | @@ -57,7 +59,7 @@ | |||
424 | 57 | elif isinstance(s, objects.String): | 59 | elif isinstance(s, objects.String): |
425 | 58 | return objects.Integer(len(s.python_string())) | 60 | return objects.Integer(len(s.python_string())) |
426 | 59 | else: | 61 | else: |
428 | 60 | raise TypeError('Expected a cons, nil or a string') | 62 | raise TypeError(_('Expected a cons, nil or a string')) |
429 | 61 | 63 | ||
430 | 62 | def elt_function(s, i): | 64 | def elt_function(s, i): |
431 | 63 | """Returns the ith element of the sequence s.""" | 65 | """Returns the ith element of the sequence s.""" |
432 | @@ -66,7 +68,7 @@ | |||
433 | 66 | elif isinstance(s, objects.String): | 68 | elif isinstance(s, objects.String): |
434 | 67 | return s.python_string()[i.python_integer()] | 69 | return s.python_string()[i.python_integer()] |
435 | 68 | else: | 70 | else: |
437 | 69 | raise TypeError('Expected a cons or string') | 71 | raise TypeError(_('Expected a cons or string')) |
438 | 70 | 72 | ||
439 | 71 | def gensym_function(): | 73 | def gensym_function(): |
440 | 72 | """Returns a unique symbol that will never be the same as any other symbol even if it has the same name.""" | 74 | """Returns a unique symbol that will never be the same as any other symbol even if it has the same name.""" |
441 | 73 | 75 | ||
442 | === modified file 'boots/lib/lingos/lisp/lexer.py' | |||
443 | --- boots/lib/lingos/lisp/lexer.py 2010-02-27 05:40:10 +0000 | |||
444 | +++ boots/lib/lingos/lisp/lexer.py 2010-03-07 09:23:22 +0000 | |||
445 | @@ -23,6 +23,8 @@ | |||
446 | 23 | 23 | ||
447 | 24 | import ply.lex as lex | 24 | import ply.lex as lex |
448 | 25 | 25 | ||
449 | 26 | from boots.lib import _, n_ | ||
450 | 27 | |||
451 | 26 | tokens = ('INTEGER', 'STRING', 'SYMBOL', 'QUOTE', 'LEFT_PAREN', 'RIGHT_PAREN') | 28 | tokens = ('INTEGER', 'STRING', 'SYMBOL', 'QUOTE', 'LEFT_PAREN', 'RIGHT_PAREN') |
452 | 27 | 29 | ||
453 | 28 | t_INTEGER = r'[0-9]+' | 30 | t_INTEGER = r'[0-9]+' |
454 | @@ -34,7 +36,7 @@ | |||
455 | 34 | t_ignore = ' \t\n' | 36 | t_ignore = ' \t\n' |
456 | 35 | 37 | ||
457 | 36 | def t_error(t): | 38 | def t_error(t): |
459 | 37 | print('illegal character {0} found'.format(t.value)) | 39 | print(_('illegal character {0} found').format(t.value)) |
460 | 38 | token.lexer.skip(1) | 40 | token.lexer.skip(1) |
461 | 39 | 41 | ||
462 | 40 | lexer = lex.lex() | 42 | lexer = lex.lex() |
463 | 41 | 43 | ||
464 | === modified file 'boots/lib/lingos/lisp/lisp.py' | |||
465 | --- boots/lib/lingos/lisp/lisp.py 2010-03-07 06:59:29 +0000 | |||
466 | +++ boots/lib/lingos/lisp/lisp.py 2010-03-07 09:23:22 +0000 | |||
467 | @@ -35,13 +35,16 @@ | |||
468 | 35 | if __name__ == '__main__': | 35 | if __name__ == '__main__': |
469 | 36 | sys.path.append('../../../../') | 36 | sys.path.append('../../../../') |
470 | 37 | 37 | ||
471 | 38 | import re | ||
472 | 39 | import readline | ||
473 | 40 | |||
474 | 38 | from boots.lib.lingos import lingo | 41 | from boots.lib.lingos import lingo |
475 | 39 | from boots.lib.lingos.lisp import builtins | 42 | from boots.lib.lingos.lisp import builtins |
476 | 40 | from boots.lib.lingos.lisp import lexer | 43 | from boots.lib.lingos.lisp import lexer |
477 | 41 | from boots.lib.lingos.lisp import objects | 44 | from boots.lib.lingos.lisp import objects |
478 | 42 | from boots.lib.lingos.lisp import parser | 45 | from boots.lib.lingos.lisp import parser |
481 | 43 | import re | 46 | from boots.lib import _, n_ |
482 | 44 | import readline | 47 | |
483 | 45 | 48 | ||
484 | 46 | def input_complete(string): | 49 | def input_complete(string): |
485 | 47 | """Returns string if string is a complete lisp expression. Otherwise, None is returned.""" | 50 | """Returns string if string is a complete lisp expression. Otherwise, None is returned.""" |
486 | @@ -52,7 +55,7 @@ | |||
487 | 52 | paren_level = left_parens - right_parens | 55 | paren_level = left_parens - right_parens |
488 | 53 | 56 | ||
489 | 54 | if paren_level < 0: | 57 | if paren_level < 0: |
491 | 55 | raise SyntaxError('unmatched closing ")"') | 58 | raise SyntaxError(_('unmatched closing ")"')) |
492 | 56 | elif paren_level > 0: | 59 | elif paren_level > 0: |
493 | 57 | return None | 60 | return None |
494 | 58 | else: | 61 | else: |
495 | @@ -71,7 +74,7 @@ | |||
496 | 71 | if isinstance(stream, file): | 74 | if isinstance(stream, file): |
497 | 72 | stream = stream.readline | 75 | stream = stream.readline |
498 | 73 | elif not callable(stream): | 76 | elif not callable(stream): |
500 | 74 | raise TypeError('{0} is not a stream or a callable'.format(stream)) | 77 | raise TypeError(_('{0} is not a stream or a callable').format(stream)) |
501 | 75 | # Read lines until all open lisp expressions have been closed. | 78 | # Read lines until all open lisp expressions have been closed. |
502 | 76 | while True: | 79 | while True: |
503 | 77 | line = stream() | 80 | line = stream() |
504 | 78 | 81 | ||
505 | === modified file 'boots/lib/lingos/lisp/objects.py' | |||
506 | --- boots/lib/lingos/lisp/objects.py 2010-02-27 05:40:10 +0000 | |||
507 | +++ boots/lib/lingos/lisp/objects.py 2010-03-07 09:23:22 +0000 | |||
508 | @@ -25,6 +25,8 @@ | |||
509 | 25 | import copy | 25 | import copy |
510 | 26 | import sys | 26 | import sys |
511 | 27 | 27 | ||
512 | 28 | from boots.lib import _, n_ | ||
513 | 29 | |||
514 | 28 | _gensym_count = 1 | 30 | _gensym_count = 1 |
515 | 29 | _symbols = {} | 31 | _symbols = {} |
516 | 30 | 32 | ||
517 | @@ -96,7 +98,7 @@ | |||
518 | 96 | else_expression = car(cdr(cdr(cdr(self)))) | 98 | else_expression = car(cdr(cdr(cdr(self)))) |
519 | 97 | 99 | ||
520 | 98 | if then_expression is Null() or cdr(cdr(cdr(cdr(self)))) is not Null(): | 100 | if then_expression is Null() or cdr(cdr(cdr(cdr(self)))) is not Null(): |
522 | 99 | raise SyntaxError('wrong number of arguments for if special form {0}'.format(self)) | 101 | raise SyntaxError(_('Wrong number of arguments for if special form {0}').format(self)) |
523 | 100 | 102 | ||
524 | 101 | if condition_expression.evaluate(environment) != Null(): | 103 | if condition_expression.evaluate(environment) != Null(): |
525 | 102 | return then_expression.evaluate(environment) | 104 | return then_expression.evaluate(environment) |
526 | @@ -115,7 +117,7 @@ | |||
527 | 115 | values = arguments[2::2] | 117 | values = arguments[2::2] |
528 | 116 | 118 | ||
529 | 117 | if len(symbols) != len(values) or len(symbols) == 0: | 119 | if len(symbols) != len(values) or len(symbols) == 0: |
531 | 118 | raise SyntaxError('The number of symbols must equal the number of values and must be non-zero') | 120 | raise SyntaxError(_('The number of symbols must equal the number of values and must be non-zero')) |
532 | 119 | 121 | ||
533 | 120 | for symbol, value in zip(symbols, values): | 122 | for symbol, value in zip(symbols, values): |
534 | 121 | value = value.evaluate(environment) | 123 | value = value.evaluate(environment) |
535 | @@ -129,7 +131,7 @@ | |||
536 | 129 | else: # Handle function calls. | 131 | else: # Handle function calls. |
537 | 130 | function = self.car.evaluate(environment) | 132 | function = self.car.evaluate(environment) |
538 | 131 | if not isinstance(function, Lambda): | 133 | if not isinstance(function, Lambda): |
540 | 132 | raise TypeError('Expected a function') | 134 | raise TypeError(_('Expected a function')) |
541 | 133 | else: | 135 | else: |
542 | 134 | return function.call((argument.evaluate(environment) for argument in self.python_list()[1:]), environment) | 136 | return function.call((argument.evaluate(environment) for argument in self.python_list()[1:]), environment) |
543 | 135 | 137 | ||
544 | @@ -165,18 +167,18 @@ | |||
545 | 165 | def __getitem__(self, symbol): | 167 | def __getitem__(self, symbol): |
546 | 166 | """Returns the value of symbol in the environment.""" | 168 | """Returns the value of symbol in the environment.""" |
547 | 167 | if not isinstance(symbol, Symbol): | 169 | if not isinstance(symbol, Symbol): |
549 | 168 | raise TypeError('Expected a symbol') | 170 | raise TypeError(_('Expected a symbol')) |
550 | 169 | 171 | ||
551 | 170 | try: | 172 | try: |
552 | 171 | return self._environment[symbol][-1] | 173 | return self._environment[symbol][-1] |
553 | 172 | except KeyError: | 174 | except KeyError: |
555 | 173 | raise KeyError('No binding for {0} exists in the current environment'.format(symbol)) | 175 | raise KeyError(_('No binding for {0} exists in the current environment').format(symbol)) |
556 | 174 | 176 | ||
557 | 175 | def __setitem__(self, symbol, value): | 177 | def __setitem__(self, symbol, value): |
559 | 176 | """Sets symbol to value in the environment. If no binding for symbol exists, a binding is created at the innermost | 178 | """Sets symbol to value in the environment. If no binding for symbol exists, a binding is created at the innermost |
560 | 177 | scope.""" | 179 | scope.""" |
561 | 178 | if not isinstance(symbol, Symbol): | 180 | if not isinstance(symbol, Symbol): |
563 | 179 | raise TypeError('Expected a symbol') | 181 | raise TypeError(_('Expected a symbol')) |
564 | 180 | 182 | ||
565 | 181 | if symbol not in self._environment: | 183 | if symbol not in self._environment: |
566 | 182 | self._environment[symbol] = [value] | 184 | self._environment[symbol] = [value] |
567 | @@ -188,7 +190,7 @@ | |||
568 | 188 | # def __delitem__(self, symbol): | 190 | # def __delitem__(self, symbol): |
569 | 189 | # """Removes the first binding found for symbol. Returns True if the symbol is found and False otherwise.""" | 191 | # """Removes the first binding found for symbol. Returns True if the symbol is found and False otherwise.""" |
570 | 190 | # if not isinstance(symbol, Symbol): | 192 | # if not isinstance(symbol, Symbol): |
572 | 191 | # raise TypeError('Expected a symbol') | 193 | # raise TypeError(_('Expected a symbol')) |
573 | 192 | 194 | ||
574 | 193 | # if symbol in self._environment: | 195 | # if symbol in self._environment: |
575 | 194 | # self._environment[symbol].pop() | 196 | # self._environment[symbol].pop() |
576 | @@ -202,7 +204,7 @@ | |||
577 | 202 | # return False | 204 | # return False |
578 | 203 | 205 | ||
579 | 204 | def push(self, symbol_values): | 206 | def push(self, symbol_values): |
581 | 205 | """Adds a new innermost lexical scope as determined by symbol_values. symbol_values is a dictionary mapping Symbols | 207 | """Adds a new innermost lexical scope as determined by symbol_values. symbol_values is a dictionary mapping Symbols |
582 | 206 | to Objects and describes bindings in the current scope.""" | 208 | to Objects and describes bindings in the current scope.""" |
583 | 207 | self._scopes.append(set(symbol_values.keys())) | 209 | self._scopes.append(set(symbol_values.keys())) |
584 | 208 | 210 | ||
585 | @@ -215,7 +217,7 @@ | |||
586 | 215 | def pop(self): | 217 | def pop(self): |
587 | 216 | """Removes the innermost scope and returns a dictionary that corresponds to its bindings.""" | 218 | """Removes the innermost scope and returns a dictionary that corresponds to its bindings.""" |
588 | 217 | if len(self._scopes) <= 1: | 219 | if len(self._scopes) <= 1: |
590 | 218 | raise RuntimeError('Cannot pop the innermost scope because then no scopes would remain') | 220 | raise RuntimeError(_('Cannot pop the innermost scope because then no scopes would remain')) |
591 | 219 | symbols = self._scopes.pop() | 221 | symbols = self._scopes.pop() |
592 | 220 | 222 | ||
593 | 221 | for symbol in symbols: | 223 | for symbol in symbols: |
594 | 222 | 224 | ||
595 | === modified file 'boots/lib/lingos/lisp/parser.py' | |||
596 | --- boots/lib/lingos/lisp/parser.py 2010-03-07 06:54:29 +0000 | |||
597 | +++ boots/lib/lingos/lisp/parser.py 2010-03-07 09:23:22 +0000 | |||
598 | @@ -22,9 +22,12 @@ | |||
599 | 22 | # ##### END LICENSE BLOCK ##### | 22 | # ##### END LICENSE BLOCK ##### |
600 | 23 | 23 | ||
601 | 24 | from lexer import tokens | 24 | from lexer import tokens |
602 | 25 | import ply.yacc as yacc | ||
603 | 26 | |||
604 | 25 | from boots.lib.lingos.lisp import builtins | 27 | from boots.lib.lingos.lisp import builtins |
605 | 26 | from boots.lib.lingos.lisp import objects | 28 | from boots.lib.lingos.lisp import objects |
607 | 27 | import ply.yacc as yacc | 29 | from boots.lib import _, n_ |
608 | 30 | |||
609 | 28 | 31 | ||
610 | 29 | def p_expression_integer(p): | 32 | def p_expression_integer(p): |
611 | 30 | 'expression : INTEGER' | 33 | 'expression : INTEGER' |
612 | @@ -59,7 +62,7 @@ | |||
613 | 59 | p[0] = objects.Cons(p[1], p[2]) | 62 | p[0] = objects.Cons(p[1], p[2]) |
614 | 60 | 63 | ||
615 | 61 | def p_error(p): | 64 | def p_error(p): |
617 | 62 | raise SyntaxError('syntax error') | 65 | raise SyntaxError(_('syntax error')) |
618 | 63 | 66 | ||
619 | 64 | # Disable debugging output and caching of parse tables. | 67 | # Disable debugging output and caching of parse tables. |
620 | 65 | parser = yacc.yacc(debug = 0, write_tables = 0) | 68 | parser = yacc.yacc(debug = 0, write_tables = 0) |
621 | 66 | 69 | ||
622 | === modified file 'boots/lib/lingos/piped_sql.py' | |||
623 | --- boots/lib/lingos/piped_sql.py 2010-03-07 07:24:29 +0000 | |||
624 | +++ boots/lib/lingos/piped_sql.py 2010-03-07 09:23:22 +0000 | |||
625 | @@ -21,12 +21,14 @@ | |||
626 | 21 | # | 21 | # |
627 | 22 | # ##### END LICENSE BLOCK ##### | 22 | # ##### END LICENSE BLOCK ##### |
628 | 23 | 23 | ||
629 | 24 | import re | ||
630 | 25 | |||
631 | 24 | from boots.api.nodes.node import NodeGraph, SyncNode, IteratorNode | 26 | from boots.api.nodes.node import NodeGraph, SyncNode, IteratorNode |
632 | 25 | from boots.api.constructors import construct, csv_output_file_node, sink_node | 27 | from boots.api.constructors import construct, csv_output_file_node, sink_node |
633 | 26 | from boots.lib.ui.components.help import HelpTopic | 28 | from boots.lib.ui.components.help import HelpTopic |
634 | 27 | from boots.lib.lingos import lingo | 29 | from boots.lib.lingos import lingo |
635 | 28 | from boots.lib.lingos import sql | 30 | from boots.lib.lingos import sql |
637 | 29 | import re | 31 | from boots.lib import _, n_ |
638 | 30 | 32 | ||
639 | 31 | # Set this to another node constructor to change the default constructor used for output files. | 33 | # Set this to another node constructor to change the default constructor used for output files. |
640 | 32 | output_file_node = csv_output_file_node | 34 | output_file_node = csv_output_file_node |
641 | @@ -42,7 +44,7 @@ | |||
642 | 42 | string_re = re.compile('^(?P<text>(\'[^\']*\')|("[^"]*"))') | 44 | string_re = re.compile('^(?P<text>(\'[^\']*\')|("[^"]*"))') |
643 | 43 | 45 | ||
644 | 44 | class PipedSQLInterpreter(sql.SQLInterpreter): | 46 | class PipedSQLInterpreter(sql.SQLInterpreter): |
646 | 45 | help = HelpTopic("pipedsql", "Piped SQL Lingo", "Enhanced SQL query language supporting pipes.") | 47 | help = HelpTopic("pipedsql", _("Piped SQL Lingo"), _("Enhanced SQL query language supporting pipes.")) |
647 | 46 | 48 | ||
648 | 47 | def __init__(self, *args, **kwargs): | 49 | def __init__(self, *args, **kwargs): |
649 | 48 | super(PipedSQLInterpreter, self).__init__(*args, **kwargs) | 50 | super(PipedSQLInterpreter, self).__init__(*args, **kwargs) |
650 | @@ -54,7 +56,7 @@ | |||
651 | 54 | match = clause_re.match(clause_string) | 56 | match = clause_re.match(clause_string) |
652 | 55 | 57 | ||
653 | 56 | if not match: | 58 | if not match: |
655 | 57 | raise SyntaxError('{0} is not in the correct function call syntax'.format(clause_string)) | 59 | raise SyntaxError(_('{0} is not in the correct function call syntax').format(clause_string)) |
656 | 58 | 60 | ||
657 | 59 | constructor_call = match.group('constructor_call').strip() | 61 | constructor_call = match.group('constructor_call').strip() |
658 | 60 | output_file = match.group('output_file') | 62 | output_file = match.group('output_file') |
659 | @@ -65,7 +67,7 @@ | |||
660 | 65 | match = constructor_call_re.match(constructor_string) | 67 | match = constructor_call_re.match(constructor_string) |
661 | 66 | 68 | ||
662 | 67 | if not match: | 69 | if not match: |
664 | 68 | raise SyntaxError('{0} is not in the correct function call syntax'.format(constructor_string)) | 70 | raise SyntaxError(_('{0} is not in the correct function call syntax').format(constructor_string)) |
665 | 69 | 71 | ||
666 | 70 | name = match.group('name') | 72 | name = match.group('name') |
667 | 71 | arguments = match.group('arguments') | 73 | arguments = match.group('arguments') |
668 | @@ -92,7 +94,7 @@ | |||
669 | 92 | constructor_call, output_file = self._parse_clause(clause) | 94 | constructor_call, output_file = self._parse_clause(clause) |
670 | 93 | except SyntaxError as e: | 95 | except SyntaxError as e: |
671 | 94 | print(e) | 96 | print(e) |
673 | 95 | print 'error1' | 97 | print _('error1') |
674 | 96 | return [] # Return an empty list to avoid printing None. | 98 | return [] # Return an empty list to avoid printing None. |
675 | 97 | 99 | ||
676 | 98 | try: | 100 | try: |
677 | @@ -104,7 +106,7 @@ | |||
678 | 104 | # SQL is only allowed for the first node. | 106 | # SQL is only allowed for the first node. |
679 | 105 | if sql: | 107 | if sql: |
680 | 106 | if not first_node: | 108 | if not first_node: |
682 | 107 | raise SyntaxError('SQL is only permitted for the first clause') | 109 | raise SyntaxError(_('SQL is only permitted for the first clause')) |
683 | 108 | 110 | ||
684 | 109 | # FIXME: Add support for multiple servers here. Currently only the first server | 111 | # FIXME: Add support for multiple servers here. Currently only the first server |
685 | 110 | # is used. | 112 | # is used. |
686 | 111 | 113 | ||
687 | === modified file 'boots/lib/lingos/python.py' | |||
688 | --- boots/lib/lingos/python.py 2010-03-05 22:13:28 +0000 | |||
689 | +++ boots/lib/lingos/python.py 2010-03-07 09:23:22 +0000 | |||
690 | @@ -27,12 +27,13 @@ | |||
691 | 27 | from boots.api import errors | 27 | from boots.api import errors |
692 | 28 | from boots.lib.lingos import lingo | 28 | from boots.lib.lingos import lingo |
693 | 29 | from boots.lib.ui.components.help import HelpTopic | 29 | from boots.lib.ui.components.help import HelpTopic |
694 | 30 | from boots.lib import _, n_ | ||
695 | 30 | 31 | ||
696 | 31 | class PythonInterpreter(lingo.Interpreter): | 32 | class PythonInterpreter(lingo.Interpreter): |
697 | 32 | """Implements a python interpreter that will send commands to the python interpreter that runs | 33 | """Implements a python interpreter that will send commands to the python interpreter that runs |
698 | 33 | boots.""" | 34 | boots.""" |
699 | 34 | 35 | ||
701 | 35 | help = HelpTopic("python", "Python Lingo", "Integrated Python interpreter using the Boots API.") | 36 | help = HelpTopic("python", _("Python Lingo"), _("Integrated Python interpreter using the Boots API.")) |
702 | 36 | 37 | ||
703 | 37 | def __init__(self, *args, **kwargs): | 38 | def __init__(self, *args, **kwargs): |
704 | 38 | super(PythonInterpreter, self).__init__(*args, **kwargs) | 39 | super(PythonInterpreter, self).__init__(*args, **kwargs) |
705 | 39 | 40 | ||
706 | === modified file 'boots/lib/lingos/sql.py' | |||
707 | --- boots/lib/lingos/sql.py 2010-02-27 05:54:13 +0000 | |||
708 | +++ boots/lib/lingos/sql.py 2010-03-07 09:23:22 +0000 | |||
709 | @@ -24,9 +24,10 @@ | |||
710 | 24 | from boots.api.nodes.node import NodeGraph, SyncNode, IteratorNode | 24 | from boots.api.nodes.node import NodeGraph, SyncNode, IteratorNode |
711 | 25 | from boots.lib.ui.components.help import HelpTopic | 25 | from boots.lib.ui.components.help import HelpTopic |
712 | 26 | from boots.lib.lingos import lingo | 26 | from boots.lib.lingos import lingo |
713 | 27 | from boots.lib import _, n_ | ||
714 | 27 | 28 | ||
715 | 28 | class SQLInterpreter(lingo.Interpreter): | 29 | class SQLInterpreter(lingo.Interpreter): |
717 | 29 | help = HelpTopic("sql", "SQL Lingo", "Raw SQL commands sent to a server.") | 30 | help = HelpTopic("sql", _("SQL Lingo"), _("Raw SQL commands sent to a server.")) |
718 | 30 | 31 | ||
719 | 31 | def __init__(self, *args, **kwargs): | 32 | def __init__(self, *args, **kwargs): |
720 | 32 | super(SQLInterpreter, self).__init__(*args, **kwargs) | 33 | super(SQLInterpreter, self).__init__(*args, **kwargs) |
721 | 33 | 34 | ||
722 | === modified file 'boots/lib/ui/components/help.py' | |||
723 | --- boots/lib/ui/components/help.py 2010-02-27 05:54:13 +0000 | |||
724 | +++ boots/lib/ui/components/help.py 2010-03-07 09:23:22 +0000 | |||
725 | @@ -21,6 +21,8 @@ | |||
726 | 21 | # | 21 | # |
727 | 22 | # ##### END LICENSE BLOCK ##### | 22 | # ##### END LICENSE BLOCK ##### |
728 | 23 | 23 | ||
729 | 24 | from boots.lib import _, n_ | ||
730 | 25 | |||
731 | 24 | def issubseq(subseq, seq): | 26 | def issubseq(subseq, seq): |
732 | 25 | """Determines if the elements the sequence subseq form a subsequence of the sequence seq.""" | 27 | """Determines if the elements the sequence subseq form a subsequence of the sequence seq.""" |
733 | 26 | for start in range(len(seq) - len(subseq) + 1): | 28 | for start in range(len(seq) - len(subseq) + 1): |
734 | @@ -63,11 +65,11 @@ | |||
735 | 63 | template += "{0.description}" | 65 | template += "{0.description}" |
736 | 64 | 66 | ||
737 | 65 | if self.see_also: | 67 | if self.see_also: |
739 | 66 | template += "\n\nSee also: {0.see_also}" | 68 | template += "\n\n"+_("See also: {0.see_also}") |
740 | 67 | 69 | ||
741 | 68 | output = template.format(self) | 70 | output = template.format(self) |
742 | 69 | if include_index and self._subtopics: | 71 | if include_index and self._subtopics: |
744 | 70 | output += "\n--- Subtopics ---\n" + self.format_index() | 72 | output += "\n--- "+_("Subtopics")+" ---\n" + self.format_index() |
745 | 71 | 73 | ||
746 | 72 | return output | 74 | return output |
747 | 73 | 75 | ||
748 | @@ -101,7 +103,7 @@ | |||
749 | 101 | assert isinstance(item, str) | 103 | assert isinstance(item, str) |
750 | 102 | return query | 104 | return query |
751 | 103 | else: | 105 | else: |
753 | 104 | raise TypeError('query object {0} is not a string or tuple of strings'.format(query)) | 106 | raise TypeError(_('query object {0} is not a string or tuple of strings').format(query)) |
754 | 105 | 107 | ||
755 | 106 | def _ensure_key(self, key): | 108 | def _ensure_key(self, key): |
756 | 107 | """Creates a new subtopic that key maps to if none exists.""" | 109 | """Creates a new subtopic that key maps to if none exists.""" |
757 | @@ -198,4 +200,4 @@ | |||
758 | 198 | subtopics = self._subtopics.copy() | 200 | subtopics = self._subtopics.copy() |
759 | 199 | for path in self.root.search(self.query): | 201 | for path in self.root.search(self.query): |
760 | 200 | subtopics.update(self.root[path]._subtopics) | 202 | subtopics.update(self.root[path]._subtopics) |
761 | 201 | return subtopics | ||
762 | 202 | \ No newline at end of file | 203 | \ No newline at end of file |
763 | 204 | return subtopics | ||
764 | 203 | 205 | ||
765 | === modified file 'boots/lib/ui/components/metacommands.py' | |||
766 | --- boots/lib/ui/components/metacommands.py 2010-03-07 05:03:00 +0000 | |||
767 | +++ boots/lib/ui/components/metacommands.py 2010-03-07 09:23:22 +0000 | |||
768 | @@ -26,6 +26,7 @@ | |||
769 | 26 | import types | 26 | import types |
770 | 27 | 27 | ||
771 | 28 | from boots.api.errors import BootsError, BootsWarning | 28 | from boots.api.errors import BootsError, BootsWarning |
772 | 29 | from boots.lib import _, n_ | ||
773 | 29 | 30 | ||
774 | 30 | class MetaCommandError(BootsError): | 31 | class MetaCommandError(BootsError): |
775 | 31 | """Errors related to metacommands.""" | 32 | """Errors related to metacommands.""" |
776 | @@ -68,7 +69,7 @@ | |||
777 | 68 | # FIXME: Issue warning through the UI using ui.print | 69 | # FIXME: Issue warning through the UI using ui.print |
778 | 69 | # FIXME: Determine the offending command(s) (set.intersect?) | 70 | # FIXME: Determine the offending command(s) (set.intersect?) |
779 | 70 | # FIXME: Print offending commands | 71 | # FIXME: Print offending commands |
781 | 71 | return MetaCommandConflictWarning("Conflicts between metacommands detected.") | 72 | return MetaCommandConflictWarning(_("Conflicts between metacommands detected.")) |
782 | 72 | self.names |= newnames | 73 | self.names |= newnames |
783 | 73 | 74 | ||
784 | 74 | class MetaCommands(object): | 75 | class MetaCommands(object): |
785 | @@ -105,7 +106,7 @@ | |||
786 | 105 | name, func, args = metacommand | 106 | name, func, args = metacommand |
787 | 106 | expected_arg_count = argument_count(func) | 107 | expected_arg_count = argument_count(func) |
788 | 107 | if expected_arg_count is not None and len(args) != expected_arg_count: | 108 | if expected_arg_count is not None and len(args) != expected_arg_count: |
790 | 108 | raise InvalidArgumentError("{0} takes {1} arguments ({2} given)".format( | 109 | raise InvalidArgumentError(_("{0} takes {1} arguments ({2} given)").format( |
791 | 109 | name, expected_arg_count, len(args))) | 110 | name, expected_arg_count, len(args))) |
792 | 110 | else: | 111 | else: |
793 | 111 | func(*args) | 112 | func(*args) |
794 | 112 | 113 | ||
795 | === modified file 'boots/lib/ui/plain.py' | |||
796 | --- boots/lib/ui/plain.py 2010-03-05 22:13:28 +0000 | |||
797 | +++ boots/lib/ui/plain.py 2010-03-07 09:23:22 +0000 | |||
798 | @@ -30,12 +30,13 @@ | |||
799 | 30 | import readline | 30 | import readline |
800 | 31 | import subprocess | 31 | import subprocess |
801 | 32 | import threading | 32 | import threading |
803 | 33 | 33 | ||
804 | 34 | from boots.api.api import Rows, ResultInfo | 34 | from boots.api.api import Rows, ResultInfo |
805 | 35 | from boots.api.nodes.node import Status, NodeGraph, SyncNode, filter_none | 35 | from boots.api.nodes.node import Status, NodeGraph, SyncNode, filter_none |
806 | 36 | from boots.lib.ui.components.help import HelpTopic | 36 | from boots.lib.ui.components.help import HelpTopic |
807 | 37 | from boots.lib.ui.components.metacommands import MetaCommandError, MetaCommands, parse_metacommand | 37 | from boots.lib.ui.components.metacommands import MetaCommandError, MetaCommands, parse_metacommand |
808 | 38 | from boots.lib.ui.generic import StdinDriver, StdoutPresenter | 38 | from boots.lib.ui.generic import StdinDriver, StdoutPresenter |
809 | 39 | from boots.lib import _, n_ | ||
810 | 39 | 40 | ||
811 | 40 | class PlainUI(StdinDriver, StdoutPresenter): | 41 | class PlainUI(StdinDriver, StdoutPresenter): |
812 | 41 | """Class that provides a 'plain' UI for boots. Input is taken on stdin, | 42 | """Class that provides a 'plain' UI for boots. Input is taken on stdin, |
813 | @@ -43,11 +44,11 @@ | |||
814 | 43 | results are printed to stdout. These results are printed as tables when | 44 | results are printed to stdout. These results are printed as tables when |
815 | 44 | they are Server packets and as string interpretations otherwise.""" | 45 | they are Server packets and as string interpretations otherwise.""" |
816 | 45 | 46 | ||
819 | 46 | help = HelpTopic("plain", "Plain UI", "Plain UI documentation.", """ | 47 | help = HelpTopic("plain", _("Plain UI"), _("Plain UI documentation."), |
820 | 47 | A simple, minimal user interface for Boots.""") | 48 | _("A simple, minimal user interface for Boots.")) |
821 | 48 | 49 | ||
824 | 49 | help.add("commands", None, "List of Plain UI commands.") | 50 | help.add("commands", None, _("List of Plain UI commands.")) |
825 | 50 | help["commands"].add("\use", "use", "Switch to a different lingo.") | 51 | help["commands"].add("\use", _("use"), _("Switch to a different lingo.")) |
826 | 51 | 52 | ||
827 | 52 | def __init__(self, console): | 53 | def __init__(self, console): |
828 | 53 | """Initialize a UI giving it its parent console, primary prompt, | 54 | """Initialize a UI giving it its parent console, primary prompt, |
829 | @@ -133,7 +134,7 @@ | |||
830 | 133 | shell=False, | 134 | shell=False, |
831 | 134 | stdin=subprocess.PIPE) | 135 | stdin=subprocess.PIPE) |
832 | 135 | except: | 136 | except: |
834 | 136 | sys.stdout.write("Unable to run pager command \"{0}\". Pager disabled.\n" | 137 | sys.stdout.write(_("Unable to run pager command \"{0}\". Pager disabled.\n") |
835 | 137 | .format(self.pager_command)) | 138 | .format(self.pager_command)) |
836 | 138 | self.pager_command = None | 139 | self.pager_command = None |
837 | 139 | return False | 140 | return False |
838 | @@ -156,7 +157,7 @@ | |||
839 | 156 | def padded(fields, widths): | 157 | def padded(fields, widths): |
840 | 157 | """Utility function used to convert rows from tuples to table rows. | 158 | """Utility function used to convert rows from tuples to table rows. |
841 | 158 | Results are returned as strings.""" | 159 | Results are returned as strings.""" |
843 | 159 | return "| {0} |\n".format(" | ".join(map(str.ljust, fields, widths))) | 160 | return "| {0} |".format(" | ".join(map(str.ljust, fields, widths))) |
844 | 160 | 161 | ||
845 | 161 | def show_NULL(value): | 162 | def show_NULL(value): |
846 | 162 | """There is a 'bug' in the dbapi that does not convert NULL objects | 163 | """There is a 'bug' in the dbapi that does not convert NULL objects |
847 | @@ -168,7 +169,7 @@ | |||
848 | 168 | if self.buffer: | 169 | if self.buffer: |
849 | 169 | max_widths = map(max, [(len(column[0]), column[2]) for column in info["description"]]) | 170 | max_widths = map(max, [(len(column[0]), column[2]) for column in info["description"]]) |
850 | 170 | dashes = map(lambda x: "-"*(x+2), max_widths) | 171 | dashes = map(lambda x: "-"*(x+2), max_widths) |
852 | 171 | sep_line = "+" + "+".join(dashes) + "+\n" | 172 | sep_line = "+" + "+".join(dashes) + "+" |
853 | 172 | names = (column[0] for column in info["description"]) | 173 | names = (column[0] for column in info["description"]) |
854 | 173 | yield sep_line | 174 | yield sep_line |
855 | 174 | yield padded(names, max_widths) | 175 | yield padded(names, max_widths) |
856 | @@ -182,9 +183,13 @@ | |||
857 | 182 | elapsed = info["end_time"] - info["begin_time"] | 183 | elapsed = info["end_time"] - info["begin_time"] |
858 | 183 | noun = "row" if info["row_count"] == 1 else "rows" | 184 | noun = "row" if info["row_count"] == 1 else "rows" |
859 | 184 | if info["description"] is not None: | 185 | if info["description"] is not None: |
861 | 185 | info_line = "{count} {noun} in set ({elapsed:.2f} seconds)\n" | 186 | info_line = n_("{count} row in set ({elapsed:.2f} seconds)", |
862 | 187 | "{count} rows in set ({elapsed:.2f} seconds)", | ||
863 | 188 | info["row_count"]) | ||
864 | 186 | else: | 189 | else: |
866 | 187 | info_line = "{count} {noun} affected ({elapsed:.2f} seconds)\n" | 190 | info_line = n_("{count} row affected ({elapsed:.2f} seconds)", |
867 | 191 | "{count} rows affected ({elapsed:.2f} seconds)", | ||
868 | 192 | info["row_count"]) | ||
869 | 188 | 193 | ||
870 | 189 | yield info_line.format(count=info["row_count"], | 194 | yield info_line.format(count=info["row_count"], |
871 | 190 | noun=noun, | 195 | noun=noun, |
872 | @@ -196,25 +201,29 @@ | |||
873 | 196 | printed = False | 201 | printed = False |
874 | 197 | output = _gen_table(result.value) | 202 | output = _gen_table(result.value) |
875 | 198 | if self.pager_command and self.console.driver.is_interactive: | 203 | if self.pager_command and self.console.driver.is_interactive: |
877 | 199 | printed = self.print_with_pager("".join(output)) | 204 | printed = self.print_with_pager("\n".join(output)) |
878 | 200 | 205 | ||
879 | 201 | # Fallback if no pager set, or paging fails. | 206 | # Fallback if no pager set, or paging fails. |
880 | 202 | if not printed: | 207 | if not printed: |
881 | 203 | for line in output: | 208 | for line in output: |
882 | 204 | sys.stdout.write(line) | 209 | sys.stdout.write(line) |
883 | 210 | sys.stdout.write("\n") | ||
884 | 205 | 211 | ||
885 | 206 | # Reset values for next result set. | 212 | # Reset values for next result set. |
886 | 207 | self.buffer = [] | 213 | self.buffer = [] |
887 | 208 | elif isinstance(result, Status): | 214 | elif isinstance(result, Status): |
889 | 209 | sys.stdout.write("Status :: ") | 215 | sys.stdout.write(_("Status")) |
890 | 216 | sys.stdout.write(" :: ") | ||
891 | 210 | sys.stdout.write(str(result)) | 217 | sys.stdout.write(str(result)) |
892 | 211 | sys.stdout.write("\n") | 218 | sys.stdout.write("\n") |
893 | 212 | elif isinstance(result, Warning): | 219 | elif isinstance(result, Warning): |
895 | 213 | sys.stderr.write("WARNING :: ") | 220 | sys.stderr.write(_("WARNING")) |
896 | 221 | sys.stderr.write(" :: ") | ||
897 | 214 | sys.stderr.write(str(result)) | 222 | sys.stderr.write(str(result)) |
898 | 215 | sys.stderr.write("\n") | 223 | sys.stderr.write("\n") |
899 | 216 | elif isinstance(result, Exception): | 224 | elif isinstance(result, Exception): |
901 | 217 | sys.stderr.write("ERROR :: ") | 225 | sys.stderr.write(_("ERROR")) |
902 | 226 | sys.stderr.write(" :: ") | ||
903 | 218 | sys.stderr.write(str(result)) | 227 | sys.stderr.write(str(result)) |
904 | 219 | sys.stderr.write("\n") | 228 | sys.stderr.write("\n") |
905 | 220 | elif result is not None: | 229 | elif result is not None: |
906 | @@ -234,4 +243,4 @@ | |||
907 | 234 | if lingo in self.console.lingos: | 243 | if lingo in self.console.lingos: |
908 | 235 | self.lingo = lingo | 244 | self.lingo = lingo |
909 | 236 | else: | 245 | else: |
911 | 237 | self.present("The specified lingo \"{0}\" does not exist.".format(lingo)) | 246 | self.present(_("The specified lingo \"{0}\" does not exist.").format(lingo)) |
912 | 238 | 247 | ||
913 | === added directory 'po' | |||
914 | === added file 'po/README.txt' | |||
915 | --- po/README.txt 1970-01-01 00:00:00 +0000 | |||
916 | +++ po/README.txt 2010-03-07 09:23:22 +0000 | |||
917 | @@ -0,0 +1,16 @@ | |||
918 | 1 | ====== When adding code that outputs a string ====== | ||
919 | 2 | 1) Add (if not present already) to the import section of the .py file: | ||
920 | 3 | |||
921 | 4 | Depending on the package the file is in: | ||
922 | 5 | from boots.app import _, n_ | ||
923 | 6 | from boots.api import _, n_ | ||
924 | 7 | from boots.lib import _, n_ | ||
925 | 8 | |||
926 | 9 | Then, wrap all output strings with _("..."). | ||
927 | 10 | |||
928 | 11 | Example: | ||
929 | 12 | help = "Execute commands from file and exit") | ||
930 | 13 | should be wrapped as such: | ||
931 | 14 | help = _("Execute commands from file and exit")) | ||
932 | 15 | |||
933 | 16 | 2) Generate the updated .pot file by running the /boots/po/createpots.sh script. This will overwrite the existing pot.cms file. Any prevously generated .po .mo files can then be updated from this new file. | ||
934 | 0 | \ No newline at end of file | 17 | \ No newline at end of file |
935 | 1 | 18 | ||
936 | === added file 'po/boots.pot' | |||
937 | --- po/boots.pot 1970-01-01 00:00:00 +0000 | |||
938 | +++ po/boots.pot 2010-03-07 09:23:22 +0000 | |||
939 | @@ -0,0 +1,376 @@ | |||
940 | 1 | # SOME DESCRIPTIVE TITLE. | ||
941 | 2 | # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER | ||
942 | 3 | # This file is distributed under the same license as the PACKAGE package. | ||
943 | 4 | # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. | ||
944 | 5 | # | ||
945 | 6 | #, fuzzy | ||
946 | 7 | msgid "" | ||
947 | 8 | msgstr "" | ||
948 | 9 | "Project-Id-Version: boots\n" | ||
949 | 10 | "Report-Msgid-Bugs-To: http://translations.launchpad.net/boots\n" | ||
950 | 11 | "POT-Creation-Date: 2010-03-07 01:23-0800\n" | ||
951 | 12 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" | ||
952 | 13 | "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" | ||
953 | 14 | "Language-Team: LANGUAGE <LL@li.org>\n" | ||
954 | 15 | "MIME-Version: 1.0\n" | ||
955 | 16 | "Content-Type: text/plain; charset=CHARSET\n" | ||
956 | 17 | "Content-Transfer-Encoding: 8bit\n" | ||
957 | 18 | "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" | ||
958 | 19 | |||
959 | 20 | #: ../boots/api/api.py:89 | ||
960 | 21 | msgid "Could not connect to {0}" | ||
961 | 22 | msgstr "" | ||
962 | 23 | |||
963 | 24 | #: ../boots/api/api.py:101 | ||
964 | 25 | msgid "Connection closed" | ||
965 | 26 | msgstr "" | ||
966 | 27 | |||
967 | 28 | #: ../boots/api/api.py:124 | ||
968 | 29 | msgid "Lost connection to {0}. Reconnecting..." | ||
969 | 30 | msgstr "" | ||
970 | 31 | |||
971 | 32 | #: ../boots/api/api.py:136 | ||
972 | 33 | msgid "Reconnected." | ||
973 | 34 | msgstr "" | ||
974 | 35 | |||
975 | 36 | #: ../boots/api/constructors.py:36 | ||
976 | 37 | msgid "A constructor with name {0} already exists" | ||
977 | 38 | msgstr "" | ||
978 | 39 | |||
979 | 40 | #: ../boots/api/constructors.py:47 | ||
980 | 41 | msgid "There is no constructor with the name {0}." | ||
981 | 42 | msgstr "" | ||
982 | 43 | |||
983 | 44 | #: ../boots/api/errors.py:53 | ||
984 | 45 | msgid "Lost connection to {0}" | ||
985 | 46 | msgstr "" | ||
986 | 47 | |||
987 | 48 | #: ../boots/api/errors.py:58 | ||
988 | 49 | msgid "(Exception upon reconnect: {0})" | ||
989 | 50 | msgstr "" | ||
990 | 51 | |||
991 | 52 | #: ../boots/app/client_config.py:93 | ||
992 | 53 | msgid "Execute command and exit" | ||
993 | 54 | msgstr "" | ||
994 | 55 | |||
995 | 56 | #: ../boots/app/client_config.py:98 | ||
996 | 57 | msgid "Use database" | ||
997 | 58 | msgstr "" | ||
998 | 59 | |||
999 | 60 | #: ../boots/app/client_config.py:103 | ||
1000 | 61 | msgid "Execute commands from file and exit" | ||
1001 | 62 | msgstr "" | ||
1002 | 63 | |||
1003 | 64 | #: ../boots/app/client_config.py:108 | ||
1004 | 65 | msgid "Set the lingo to use" | ||
1005 | 66 | msgstr "" | ||
1006 | 67 | |||
1007 | 68 | #: ../boots/app/client_config.py:112 | ||
1008 | 69 | msgid "Do not read user configuration file" | ||
1009 | 70 | msgstr "" | ||
1010 | 71 | |||
1011 | 72 | #: ../boots/app/client_config.py:117 | ||
1012 | 73 | msgid "Filename of user configuration file" | ||
1013 | 74 | msgstr "" | ||
1014 | 75 | |||
1015 | 76 | #: ../boots/app/client_config.py:122 | ||
1016 | 77 | msgid "Connect to host" | ||
1017 | 78 | msgstr "" | ||
1018 | 79 | |||
1019 | 80 | #: ../boots/app/client_config.py:127 | ||
1020 | 81 | msgid "Use port number" | ||
1021 | 82 | msgstr "" | ||
1022 | 83 | |||
1023 | 84 | #: ../boots/app/client_config.py:132 | ||
1024 | 85 | msgid "Login with username" | ||
1025 | 86 | msgstr "" | ||
1026 | 87 | |||
1027 | 88 | #: ../boots/app/client_config.py:137 | ||
1028 | 89 | msgid "Connect using password. If none is given, query for password" | ||
1029 | 90 | msgstr "" | ||
1030 | 91 | |||
1031 | 92 | #: ../boots/app/client_config.py:142 | ||
1032 | 93 | msgid "Pipe query results to the specified pager." | ||
1033 | 94 | msgstr "" | ||
1034 | 95 | |||
1035 | 96 | #: ../boots/app/client_config.py:147 | ||
1036 | 97 | msgid "Specify the SQL statement terminating character. Default is ';'." | ||
1037 | 98 | msgstr "" | ||
1038 | 99 | |||
1039 | 100 | #: ../boots/app/client_config.py:152 | ||
1040 | 101 | msgid "Specify file to save history to" | ||
1041 | 102 | msgstr "" | ||
1042 | 103 | |||
1043 | 104 | #: ../boots/app/client_config.py:157 | ||
1044 | 105 | msgid "Specify max history file length" | ||
1045 | 106 | msgstr "" | ||
1046 | 107 | |||
1047 | 108 | #: ../boots/app/client_config.py:205 | ||
1048 | 109 | msgid "rcfile {0} not found" | ||
1049 | 110 | msgstr "" | ||
1050 | 111 | |||
1051 | 112 | #: ../boots/app/client_config.py:207 | ||
1052 | 113 | msgid "rcfile {0} contains a syntax error" | ||
1053 | 114 | msgstr "" | ||
1054 | 115 | |||
1055 | 116 | #: ../boots/app/client_config.py:209 | ||
1056 | 117 | msgid "rcfile {0} contains an error: {1}" | ||
1057 | 118 | msgstr "" | ||
1058 | 119 | |||
1059 | 120 | #: ../boots/lib/lingos/lisp/builtins.py:62 | ||
1060 | 121 | msgid "Expected a cons, nil or a string" | ||
1061 | 122 | msgstr "" | ||
1062 | 123 | |||
1063 | 124 | #: ../boots/lib/lingos/lisp/builtins.py:71 | ||
1064 | 125 | msgid "Expected a cons or string" | ||
1065 | 126 | msgstr "" | ||
1066 | 127 | |||
1067 | 128 | #: ../boots/lib/lingos/lisp/lexer.py:39 | ||
1068 | 129 | msgid "illegal character {0} found" | ||
1069 | 130 | msgstr "" | ||
1070 | 131 | |||
1071 | 132 | #: ../boots/lib/lingos/lisp/lisp.py:58 | ||
1072 | 133 | msgid "unmatched closing \")\"" | ||
1073 | 134 | msgstr "" | ||
1074 | 135 | |||
1075 | 136 | #: ../boots/lib/lingos/lisp/lisp.py:77 | ||
1076 | 137 | msgid "{0} is not a stream or a callable" | ||
1077 | 138 | msgstr "" | ||
1078 | 139 | |||
1079 | 140 | #: ../boots/lib/lingos/lisp/objects.py:101 | ||
1080 | 141 | msgid "Wrong number of arguments for if special form {0}" | ||
1081 | 142 | msgstr "" | ||
1082 | 143 | |||
1083 | 144 | #: ../boots/lib/lingos/lisp/objects.py:120 | ||
1084 | 145 | msgid "" | ||
1085 | 146 | "The number of symbols must equal the number of values and must be non-zero" | ||
1086 | 147 | msgstr "" | ||
1087 | 148 | |||
1088 | 149 | #: ../boots/lib/lingos/lisp/objects.py:134 | ||
1089 | 150 | msgid "Expected a function" | ||
1090 | 151 | msgstr "" | ||
1091 | 152 | |||
1092 | 153 | #: ../boots/lib/lingos/lisp/objects.py:170 | ||
1093 | 154 | #: ../boots/lib/lingos/lisp/objects.py:181 | ||
1094 | 155 | msgid "Expected a symbol" | ||
1095 | 156 | msgstr "" | ||
1096 | 157 | |||
1097 | 158 | #: ../boots/lib/lingos/lisp/objects.py:175 | ||
1098 | 159 | msgid "No binding for {0} exists in the current environment" | ||
1099 | 160 | msgstr "" | ||
1100 | 161 | |||
1101 | 162 | #: ../boots/lib/lingos/lisp/objects.py:220 | ||
1102 | 163 | msgid "Cannot pop the innermost scope because then no scopes would remain" | ||
1103 | 164 | msgstr "" | ||
1104 | 165 | |||
1105 | 166 | #: ../boots/lib/lingos/lisp/parser.py:65 | ||
1106 | 167 | msgid "syntax error" | ||
1107 | 168 | msgstr "" | ||
1108 | 169 | |||
1109 | 170 | #: ../boots/lib/lingos/bash_external.py:33 | ||
1110 | 171 | msgid "Bash Lingo" | ||
1111 | 172 | msgstr "" | ||
1112 | 173 | |||
1113 | 174 | #: ../boots/lib/lingos/bash_external.py:33 | ||
1114 | 175 | msgid "External bash shell." | ||
1115 | 176 | msgstr "" | ||
1116 | 177 | |||
1117 | 178 | #: ../boots/lib/lingos/lingo.py:36 | ||
1118 | 179 | msgid "A lingo with name {0} already exists" | ||
1119 | 180 | msgstr "" | ||
1120 | 181 | |||
1121 | 182 | #: ../boots/lib/lingos/sql.py:30 | ||
1122 | 183 | msgid "SQL Lingo" | ||
1123 | 184 | msgstr "" | ||
1124 | 185 | |||
1125 | 186 | #: ../boots/lib/lingos/sql.py:30 | ||
1126 | 187 | msgid "Raw SQL commands sent to a server." | ||
1127 | 188 | msgstr "" | ||
1128 | 189 | |||
1129 | 190 | #: ../boots/lib/lingos/python.py:36 | ||
1130 | 191 | msgid "Python Lingo" | ||
1131 | 192 | msgstr "" | ||
1132 | 193 | |||
1133 | 194 | #: ../boots/lib/lingos/python.py:36 | ||
1134 | 195 | msgid "Integrated Python interpreter using the Boots API." | ||
1135 | 196 | msgstr "" | ||
1136 | 197 | |||
1137 | 198 | #: ../boots/lib/lingos/piped_sql.py:47 | ||
1138 | 199 | msgid "Piped SQL Lingo" | ||
1139 | 200 | msgstr "" | ||
1140 | 201 | |||
1141 | 202 | #: ../boots/lib/lingos/piped_sql.py:47 | ||
1142 | 203 | msgid "Enhanced SQL query language supporting pipes." | ||
1143 | 204 | msgstr "" | ||
1144 | 205 | |||
1145 | 206 | #: ../boots/lib/lingos/piped_sql.py:59 ../boots/lib/lingos/piped_sql.py:70 | ||
1146 | 207 | msgid "{0} is not in the correct function call syntax" | ||
1147 | 208 | msgstr "" | ||
1148 | 209 | |||
1149 | 210 | #: ../boots/lib/lingos/piped_sql.py:97 | ||
1150 | 211 | msgid "error1" | ||
1151 | 212 | msgstr "" | ||
1152 | 213 | |||
1153 | 214 | #: ../boots/lib/lingos/piped_sql.py:109 | ||
1154 | 215 | msgid "SQL is only permitted for the first clause" | ||
1155 | 216 | msgstr "" | ||
1156 | 217 | |||
1157 | 218 | #: ../boots/lib/ui/components/help.py:68 | ||
1158 | 219 | msgid "See also: {0.see_also}" | ||
1159 | 220 | msgstr "" | ||
1160 | 221 | |||
1161 | 222 | #: ../boots/lib/ui/components/help.py:72 | ||
1162 | 223 | msgid "Subtopics" | ||
1163 | 224 | msgstr "" | ||
1164 | 225 | |||
1165 | 226 | #: ../boots/lib/ui/components/help.py:106 | ||
1166 | 227 | msgid "query object {0} is not a string or tuple of strings" | ||
1167 | 228 | msgstr "" | ||
1168 | 229 | |||
1169 | 230 | #: ../boots/lib/ui/components/metacommands.py:72 | ||
1170 | 231 | msgid "Conflicts between metacommands detected." | ||
1171 | 232 | msgstr "" | ||
1172 | 233 | |||
1173 | 234 | #: ../boots/lib/ui/components/metacommands.py:109 | ||
1174 | 235 | msgid "{0} takes {1} arguments ({2} given)" | ||
1175 | 236 | msgstr "" | ||
1176 | 237 | |||
1177 | 238 | #: ../boots/lib/ui/plain.py:47 | ||
1178 | 239 | msgid "Plain UI" | ||
1179 | 240 | msgstr "" | ||
1180 | 241 | |||
1181 | 242 | #: ../boots/lib/ui/plain.py:47 | ||
1182 | 243 | msgid "Plain UI documentation." | ||
1183 | 244 | msgstr "" | ||
1184 | 245 | |||
1185 | 246 | #: ../boots/lib/ui/plain.py:48 | ||
1186 | 247 | msgid "A simple, minimal user interface for Boots." | ||
1187 | 248 | msgstr "" | ||
1188 | 249 | |||
1189 | 250 | #: ../boots/lib/ui/plain.py:50 | ||
1190 | 251 | msgid "List of Plain UI commands." | ||
1191 | 252 | msgstr "" | ||
1192 | 253 | |||
1193 | 254 | #: ../boots/lib/ui/plain.py:51 | ||
1194 | 255 | msgid "use" | ||
1195 | 256 | msgstr "" | ||
1196 | 257 | |||
1197 | 258 | #: ../boots/lib/ui/plain.py:51 | ||
1198 | 259 | msgid "Switch to a different lingo." | ||
1199 | 260 | msgstr "" | ||
1200 | 261 | |||
1201 | 262 | #: ../boots/lib/ui/plain.py:137 | ||
1202 | 263 | msgid "Unable to run pager command \"{0}\". Pager disabled.\n" | ||
1203 | 264 | msgstr "" | ||
1204 | 265 | |||
1205 | 266 | #: ../boots/lib/ui/plain.py:186 | ||
1206 | 267 | msgid "{count} row in set ({elapsed:.2f} seconds)" | ||
1207 | 268 | msgid_plural "{count} rows in set ({elapsed:.2f} seconds)" | ||
1208 | 269 | msgstr[0] "" | ||
1209 | 270 | msgstr[1] "" | ||
1210 | 271 | |||
1211 | 272 | #: ../boots/lib/ui/plain.py:190 | ||
1212 | 273 | msgid "{count} row affected ({elapsed:.2f} seconds)" | ||
1213 | 274 | msgid_plural "{count} rows affected ({elapsed:.2f} seconds)" | ||
1214 | 275 | msgstr[0] "" | ||
1215 | 276 | msgstr[1] "" | ||
1216 | 277 | |||
1217 | 278 | #: ../boots/lib/ui/plain.py:215 | ||
1218 | 279 | msgid "Status" | ||
1219 | 280 | msgstr "" | ||
1220 | 281 | |||
1221 | 282 | #: ../boots/lib/ui/plain.py:220 | ||
1222 | 283 | msgid "WARNING" | ||
1223 | 284 | msgstr "" | ||
1224 | 285 | |||
1225 | 286 | #: ../boots/lib/ui/plain.py:225 | ||
1226 | 287 | msgid "ERROR" | ||
1227 | 288 | msgstr "" | ||
1228 | 289 | |||
1229 | 290 | #: ../boots/lib/ui/plain.py:246 | ||
1230 | 291 | msgid "The specified lingo \"{0}\" does not exist." | ||
1231 | 292 | msgstr "" | ||
1232 | 293 | |||
1233 | 294 | #: ../boots/lib/console.py:69 | ||
1234 | 295 | msgid "Boots encountered an internal error: {0}" | ||
1235 | 296 | msgstr "" | ||
1236 | 297 | |||
1237 | 298 | #: ../boots/lib/console.py:119 | ||
1238 | 299 | msgid "Boots Help" | ||
1239 | 300 | msgstr "" | ||
1240 | 301 | |||
1241 | 302 | #: ../boots/lib/console.py:119 | ||
1242 | 303 | msgid "Help" | ||
1243 | 304 | msgstr "" | ||
1244 | 305 | |||
1245 | 306 | #: ../boots/lib/console.py:120 | ||
1246 | 307 | msgid "" | ||
1247 | 308 | "Boots is a flexible, extensible, and multilingual shell for working with " | ||
1248 | 309 | "databases. To read more about a subtopic, use `help <topic>`." | ||
1249 | 310 | msgstr "" | ||
1250 | 311 | |||
1251 | 312 | #: ../boots/lib/console.py:123 | ||
1252 | 313 | msgid "List of Boots commands." | ||
1253 | 314 | msgstr "" | ||
1254 | 315 | |||
1255 | 316 | #: ../boots/lib/console.py:126 | ||
1256 | 317 | msgid "quit" | ||
1257 | 318 | msgstr "" | ||
1258 | 319 | |||
1259 | 320 | #: ../boots/lib/console.py:126 | ||
1260 | 321 | msgid "Quit boots." | ||
1261 | 322 | msgstr "" | ||
1262 | 323 | |||
1263 | 324 | #: ../boots/lib/console.py:127 | ||
1264 | 325 | msgid "help" | ||
1265 | 326 | msgstr "" | ||
1266 | 327 | |||
1267 | 328 | #: ../boots/lib/console.py:127 | ||
1268 | 329 | msgid "Show help for a topic." | ||
1269 | 330 | msgstr "" | ||
1270 | 331 | |||
1271 | 332 | #: ../boots/lib/console.py:128 | ||
1272 | 333 | msgid "" | ||
1273 | 334 | "help <topic>\n" | ||
1274 | 335 | "Show help for \"topic\"." | ||
1275 | 336 | msgstr "" | ||
1276 | 337 | |||
1277 | 338 | #: ../boots/lib/console.py:131 | ||
1278 | 339 | msgid "Lingos" | ||
1279 | 340 | msgstr "" | ||
1280 | 341 | |||
1281 | 342 | #: ../boots/lib/console.py:131 | ||
1282 | 343 | msgid "Documentation for loaded lingos." | ||
1283 | 344 | msgstr "" | ||
1284 | 345 | |||
1285 | 346 | #: ../boots/lib/console.py:132 | ||
1286 | 347 | msgid "A lingo is a command language usable within Boots." | ||
1287 | 348 | msgstr "" | ||
1288 | 349 | |||
1289 | 350 | #: ../boots/lib/console.py:144 | ||
1290 | 351 | msgid "Invalid lingo \"{0}\" specified." | ||
1291 | 352 | msgstr "" | ||
1292 | 353 | |||
1293 | 354 | #: ../boots/lib/console.py:173 | ||
1294 | 355 | msgid "Could not connect to {0}:{1}" | ||
1295 | 356 | msgstr "" | ||
1296 | 357 | |||
1297 | 358 | #: ../boots/lib/console.py:192 | ||
1298 | 359 | msgid "{0.hostname}:{0.port} (server v{0.server_version})" | ||
1299 | 360 | msgstr "" | ||
1300 | 361 | |||
1301 | 362 | #: ../boots/lib/console.py:227 | ||
1302 | 363 | msgid "Boots quit." | ||
1303 | 364 | msgstr "" | ||
1304 | 365 | |||
1305 | 366 | #: ../boots/lib/console.py:245 | ||
1306 | 367 | msgid "Did you mean: {0}?" | ||
1307 | 368 | msgstr "" | ||
1308 | 369 | |||
1309 | 370 | #: ../boots/lib/console.py:247 | ||
1310 | 371 | msgid "No help found for \"{0}\"." | ||
1311 | 372 | msgstr "" | ||
1312 | 373 | |||
1313 | 374 | #: ../boots/lib/console.py:276 | ||
1314 | 375 | msgid "Could not open file {0}" | ||
1315 | 376 | msgstr "" | ||
1316 | 0 | 377 | ||
1317 | === added file 'po/createpots.sh' | |||
1318 | --- po/createpots.sh 1970-01-01 00:00:00 +0000 | |||
1319 | +++ po/createpots.sh 2010-03-07 09:23:22 +0000 | |||
1320 | @@ -0,0 +1,3 @@ | |||
1321 | 1 | #!/bin/bash | ||
1322 | 2 | find ../boots/ -name *.py | xargs xgettext --language=Python --keyword="n_:1,2" --output=boots.pot --package-name="boots" --msgid-bugs-address="http://translations.launchpad.net/boots" | ||
1323 | 3 |