~mvo/ubuntu-sso-client/strawman-lp711413

812.3.1 by Natalia B. Bidart
- Have a single executable to start the service (LP: #890416).
1
#!/usr/bin/env python
2
# -*- coding: utf-8 -*-
531 by natalia.bidart at canonical
Built correct structure.
3
#
812.129.1 by Rodney Dawes
Add OpenSSL license exception
4
# Copyright 2009-2012 Canonical Ltd.
531 by natalia.bidart at canonical
Built correct structure.
5
#
6
# This program is free software: you can redistribute it and/or modify it
7
# under the terms of the GNU General Public License version 3, as published
8
# by the Free Software Foundation.
9
#
10
# This program is distributed in the hope that it will be useful, but
11
# WITHOUT ANY WARRANTY; without even the implied warranties of
12
# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
13
# PURPOSE.  See the GNU General Public License for more details.
14
#
15
# You should have received a copy of the GNU General Public License along
16
# with this program.  If not, see <http://www.gnu.org/licenses/>.
812.129.1 by Rodney Dawes
Add OpenSSL license exception
17
#
18
# In addition, as a special exception, the copyright holders give
19
# permission to link the code of portions of this program with the
20
# OpenSSL library under certain conditions as described in each
21
# individual source file, and distribute linked combinations
22
# including the two.
23
# You must obey the GNU General Public License in all respects
24
# for all of the code used other than OpenSSL.  If you modify
25
# file(s) with this exception, you may extend this exception to your
26
# version of the file(s), but you are not obligated to do so.  If you
27
# do not wish to do so, delete this exception statement from your
28
# version.  If you delete this exception statement from all source
29
# files in the program, then also delete it here.
812.3.1 by Natalia B. Bidart
- Have a single executable to start the service (LP: #890416).
30
"""Start the sso service."""
611.2.1 by natalia.bidart at canonical
Removed all the old auth mechanism (LP: #616121).
31
659.2.4 by Natalia B. Bidart
Fixed lint issues.
32
# Invalid name "ubuntu-sso-login", pylint: disable=C0103
33
34
# import decimal even if we don't need it, pylint: disable=W0611
633.1.1 by natalia.bidart at canonical
Workaround for LP: #467397.
35
import decimal
36
# This is a workaround for LP: #467397. Some module in our depency chain sets
37
# the locale and imports decimal, and that generates the following trace:
38
# Traceback (most recent call last):
39
#   File "/usr/lib/ubuntu-sso-client/ubuntu-sso-login", line 33
794.2.1 by Natalia B. Bidart
- Removing the deprecated SSOCredentials interface (LP: #859635).
40
#     from ubuntu_sso.main import SSOLogin
633.1.1 by natalia.bidart at canonical
Workaround for LP: #467397.
41
#   File "/usr/lib/pymodules/python2.6/ubuntu_sso/main.py", line 42
42
#     from lazr.restfulclient.resource import ServiceRoot
43
#   File "/usr/lib/python2.6/dist-packages/lazr/restfulclient/resource.py",
44
# line 34
45
#     import simplejson
46
#   File "/usr/lib/pymodules/python2.6/simplejson/__init__.py", line 109
47
#     from decimal import Decimal
48
#   File "/usr/lib/python2.6/decimal.py", line 3649, in <module>
49
#     val = globals()[globalname]
50
# KeyError: 'ROUND_CEiLiNG'
51
812.3.5 by Natalia B. Bidart
All tests green in every platform.
52
import sys
53
54
if sys.platform == 'win32':
55
    from PyQt4 import QtGui
56
    # need to create the QApplication before installing the reactor
57
    QtGui.QApplication(sys.argv)
58
812.3.8 by Natalia B. Bidart
Fixed lint issue.
59
    # pylint: disable=F0401
812.3.5 by Natalia B. Bidart
All tests green in every platform.
60
    import qt4reactor
61
    qt4reactor.install()
62
812.3.1 by Natalia B. Bidart
- Have a single executable to start the service (LP: #890416).
63
from ubuntu_sso.main import main
640.1.3 by Alejandro J. Cura
restoring sighup handler to log when stopping
64
617.1.1 by natalia.bidart at canonical
Added handler for SIGHUP to stop the service (LP: #633300).
65
531 by natalia.bidart at canonical
Built correct structure.
66
if __name__ == "__main__":
812.3.1 by Natalia B. Bidart
- Have a single executable to start the service (LP: #890416).
67
    main()