Example #1
0
def launch_history_browser(argv):
    try:
        core.fork(argv)
    except Exception as e:
        _, details = utils.format_exception(e)
        title = N_("Error Launching History Browser")
        msg = N_('Cannot exec "%s": please configure a history browser') % " ".join(argv)
        Interaction.critical(title, message=msg, details=details)
Example #2
0
def do_cmd(cmd):
    if hasattr(cmd, 'DISABLED') and cmd.DISABLED:
        return None
    try:
        return cmd.do()
    except StandardError, e:
        msg, details = utils.format_exception(e)
        Interaction.critical(N_('Error'), message=msg, details=details)
        return None
Example #3
0
def do_cmd(cmd):
    if hasattr(cmd, 'DISABLED') and cmd.DISABLED:
        return None
    try:
        return cmd.do()
    except Exception as e:
        msg, details = utils.format_exception(e)
        Interaction.critical(N_('Error'), message=msg, details=details)
        return None
Example #4
0
def launch_history_browser(argv):
    try:
        core.fork(argv)
    except Exception as e:
        _, details = utils.format_exception(e)
        title = N_('Error Launching History Browser')
        msg = (N_('Cannot exec "%s": please configure a history browser') %
               ' '.join(argv))
        Interaction.critical(title, message=msg, details=details)
Example #5
0
def do_cmd(cmd):
    if hasattr(cmd, "DISABLED") and cmd.DISABLED:
        return None
    try:
        return cmd.do()
    except Exception as e:
        msg, details = utils.format_exception(e)
        Interaction.critical(N_("Error"), message=msg, details=details)
        return None
 def save(self, string):
     """Save the instruction sheet"""
     try:
         core.write(self.filename, string)
         status = 0
     except (OSError, IOError, ValueError) as e:
         msg, details = utils.format_exception(e)
         sys.stderr.write(msg + '\n\n' + details)
         status = 128
     return status
Example #7
0
    def do(self):
        argv = utils.shell_split(prefs.history_browser())
        if self.revision:
            argv.append(self.revision)
        if self.paths:
            argv.append('--')
            argv.extend(self.paths)

        try:
            core.fork(argv)
        except Exception as e:
            _, details = utils.format_exception(e)
            title = N_('Error Launching History Browser')
            msg = (N_('Cannot exec "%s": please configure a history browser') %
                   ' '.join(argv))
            Interaction.critical(title, message=msg, details=details)
Example #8
0
    def do(self):
        argv = utils.shell_split(prefs.history_browser())
        if self.revision:
            argv.append(self.revision)
        if self.paths:
            argv.append('--')
            argv.extend(self.paths)

        try:
            core.fork(argv)
        except Exception as e:
            _, details = utils.format_exception(e)
            title = N_('Error Launching History Browser')
            msg = (N_('Cannot exec "%s": please configure a history browser') %
                   ' '.join(argv))
            Interaction.critical(title, message=msg, details=details)