Exemplo n.º 1
0
def main(options):
    if options.username:
        username = options.username
    else:
        username = pwd.getpwuid(os.getuid()).pw_name
    if options.login_type == 'oauth2':
        gui = tkinter.GuiOauth(options.server_url, username)

    else:
        raise NotImplementedError('Unsupported login type: %s',
                                  options.login_type)

    storage = glue.GetStorage()
    if not storage:
        gui.ShowFatalError('Could not determine File System type')
        return 1
    _, encrypted_volumes, _ = storage.GetStateAndVolumeIds()
    try:
        if encrypted_volumes:
            gui.EncryptedVolumePrompt(status_callback=status_callback)
        else:
            gui.PlainVolumePrompt(options.welcome,
                                  status_callback=status_callback)
    except Exception as e:  # pylint: disable=broad-except
        gui.ShowFatalError(e)
        return 1
    finally:
        return exit_status  # pylint: disable=lost-exception
Exemplo n.º 2
0
def main(options):
  if options.login_type == 'oauth2':
    gui = tkinter.GuiOauth(options.server_url)
  else:
    raise NotImplementedError('Unsupported login type: %s', options.login_type)

  _, encrypted_volumes, _ = corestorage.GetStateAndVolumeIds()
  try:
    if encrypted_volumes:
      gui.EncryptedVolumePrompt()
    else:
      gui.PlainVolumePrompt(options.no_welcome)
  except Exception as e:  # pylint: disable=broad-except
    gui.ShowFatalError(e)
    return 1

  return 0
Exemplo n.º 3
0
def run_tkinter_gui(username, options):
    """Runs CauliflowerVest with a Tkinter GUI."""
    if options.login_type == 'oauth2':
        gui = tkinter.GuiOauth(options.server_url, username)
    else:
        raise NotImplementedError('Unsupported login type: %s',
                                  options.login_type)

    storage = glue.GetStorage()
    if not storage:
        gui.ShowFatalError('Could not determine File System type')
        return 1
    _, encrypted_volumes, _ = storage.GetStateAndVolumeIds()
    try:
        if encrypted_volumes:
            gui.EncryptedVolumePrompt(status_callback=status_callback)
        else:
            gui.PlainVolumePrompt(options.welcome,
                                  status_callback=status_callback)
    except Exception as e:  # pylint: disable=broad-except
        gui.ShowFatalError(e)
        return 1
    finally:
        return exit_status  # pylint: disable=lost-exception