diff options
author | Yann Leboulanger <asterix@lagaule.org> | 2008-12-03 20:16:04 +0300 |
---|---|---|
committer | Yann Leboulanger <asterix@lagaule.org> | 2008-12-03 20:16:04 +0300 |
commit | 31dc32eeb92a235650e0f2f01c8aa7b5a95f1398 (patch) | |
tree | 3b31c5aabbef41d8ff6ed77f247448bba054a0bd /src/gajim-remote.py | |
parent | d4f032ecd3d1c1cd758cb97425851cae4d2e8de2 (diff) |
[thorstenp] fix redefined builtins
Diffstat (limited to 'src/gajim-remote.py')
-rwxr-xr-x | src/gajim-remote.py | 51 |
1 files changed, 19 insertions, 32 deletions
diff --git a/src/gajim-remote.py b/src/gajim-remote.py index 413a9f27a..e373a7925 100755 --- a/src/gajim-remote.py +++ b/src/gajim-remote.py @@ -387,54 +387,41 @@ class GajimRemote: def make_arguments_row(self, args): ''' return arguments list. Mandatory arguments are enclosed with: '<', '>', optional arguments - with '[', ']' ''' - str = '' - for argument in args: - str += ' ' - if argument[2]: - str += '<' + s = '' + for arg in args: + if arg[2]: + s += ' <' + arg[0] + '>' else: - str += '[' - str += argument[0] - if argument[2]: - str += '>' - else: - str += ']' - return str + s += ' [' + arg[0] + ']' + return s def help_on_command(self, command): ''' return help message for a given command ''' if command in self.commands: command_props = self.commands[command] arguments_str = self.make_arguments_row(command_props[1]) - str = _('Usage: %(basename)s %(command)s %(arguments)s \n\t %(help)s')\ + str_ = _('Usage: %(basename)s %(command)s %(arguments)s \n\t %(help)s')\ % {'basename': BASENAME, 'command': command, 'arguments': arguments_str, 'help': command_props[0]} if len(command_props[1]) > 0: - str += '\n\n' + _('Arguments:') + '\n' + str_ += '\n\n' + _('Arguments:') + '\n' for argument in command_props[1]: - str += ' ' + argument[0] + ' - ' + argument[1] + '\n' - return str + str_ += ' ' + argument[0] + ' - ' + argument[1] + '\n' + return str_ send_error(_('%s not found') % command) def compose_help(self): ''' print usage, and list available commands ''' - str = _('Usage: %s command [arguments]\nCommand is one of:\n' ) % BASENAME - commands = sorted(self.commands.keys()) - for command in commands: - str += ' ' + command - for argument in self.commands[command][1]: - str += ' ' - if argument[2]: - str += '<' - else: - str += '[' - str += argument[0] - if argument[2]: - str += '>' + s = _('Usage: %s command [arguments]\nCommand is one of:\n' ) % BASENAME + for command in sorted(self.commands): + s += ' ' + command + for arg in self.commands[command][1]: + if arg[2]: + s += ' <' + arg[0] + '>' else: - str += ']' - str += '\n' - return str + s += ' [' + arg[0] + ']' + s += '\n' + return s def print_info(self, level, prop_dict, encode_return = False): ''' return formated string from data structure ''' |