Ejemplo n.º 1
0
def Main(args):
    # Bootstrap translations until we've loaded everything else
    translation = gettext.translation("mailpile", getLocaleDirectory(),
                                      fallback=True)
    translation.install(unicode=True)

    try:
        # Create our global config manager and the default (CLI) session
        config = ConfigManager(rules=mailpile.defaults.CONFIG_RULES)
        session = Session(config)
        cli_ui = session.ui = UserInteraction(config)
        session.main = True
        session.config.load(session)
    except AccessError, e:
        sys.stderr.write('Access denied: %s\n' % e)
        sys.exit(1)
Ejemplo n.º 2
0
def Main(args):
    # Bootstrap translations until we've loaded everything else
    translation = gettext.translation("mailpile", getLocaleDirectory(),
                                      fallback=True)
    translation.install(unicode=True)

    try:
        # Create our global config manager and the default (CLI) session
        config = ConfigManager(rules=mailpile.defaults.CONFIG_RULES)
        session = Session(config)
        cli_ui = session.ui = UserInteraction(config)
        session.main = True
        try:
            config.load(session)
        except IOError:
            session.ui.error(_('Failed to decrypt configuration, '
                               'please log in!'))
        config.prepare_workers(session)
    except AccessError, e:
        session.ui.error('Access denied: %s\n' % e)
        sys.exit(1)