Ejemplo n.º 1
0
def Main(args):
    re.UNICODE = 1
    re.LOCALE = 1

    try:
        # Create our global config manager and the default (CLI) session
        config = ConfigManager(rules=mailpile.defaults.CONFIG_RULES)
        session = Session(config)
        session.config.load(session)
        session.main = True
        session.ui = UserInteraction(config)
        if sys.stdout.isatty():
            session.ui.palette = ANSIColors()
    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
        session.config.load(session)
    except AccessError, e:
        sys.stderr.write('Access denied: %s\n' % e)
        sys.exit(1)
Ejemplo n.º 3
0
def Main(args):
    # Bootstrap translations until we've loaded everything else
    mailpile.i18n.ActivateTranslation(None, ConfigManager, None)
    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)
Ejemplo n.º 4
0
Archivo: app.py Proyecto: stwn/Mailpile
def Main(args):
  re.UNICODE = 1
  re.LOCALE = 1

  # Bootstrap translations until we've loaded everything else
  translation = gettext.translation("mailpile", "locale", 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)
    session.config.load(session)
    session.main = True
    session.ui = UserInteraction(config)
    if sys.stdout.isatty():
      session.ui.palette = ANSIColors()
  except AccessError, e:
    sys.stderr.write('Access denied: %s\n' % e)
    sys.exit(1)