1
# -*- coding: utf-8 -*-
3
# Copyright 2012 Canonical Ltd.
5
# This program is free software: you can redistribute it and/or modify it
6
# under the terms of the GNU General Public License version 3, as published
7
# by the Free Software Foundation.
9
# This program is distributed in the hope that it will be useful, but
10
# WITHOUT ANY WARRANTY; without even the implied warranties of
11
# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
12
# PURPOSE. See the GNU General Public License for more details.
14
# You should have received a copy of the GNU General Public License along
15
# with this program. If not, see <http://www.gnu.org/licenses/>.
17
"""Main module to open the GTK UI."""
23
from ubuntu_sso.gtk.gui import UbuntuSSOClientGUI
27
"""Parse sys.argv options."""
28
parser = argparse.ArgumentParser(description='Open the GTK SSO UI.')
29
parser.add_argument('--app_name', required=True,
30
help='the name of the application to retrieve credentials for')
31
parser.add_argument('--ping_url', default='',
32
help='a link to be used as the ping url (to notify about new tokens)')
33
parser.add_argument('--tc_url', default='',
34
help='a link to be used as Terms & Conditions url')
35
parser.add_argument('--help_text', default='',
36
help='extra text that will be shown below the headers')
37
parser.add_argument('--window_id', type=int, default=0,
38
help='the window id to be set transient for the SSO GTK dialogs')
39
parser.add_argument('--login_only', action='store_true', default=False,
40
help='whether the SSO GTK UI should only offer login or not')
42
args = parser.parse_args()
47
"""Start the GTK mainloop and open the main window."""
48
UbuntuSSOClientGUI(close_callback=gtk.main_quit, **kwargs)