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

« back to all changes in this revision

Viewing changes to ubuntu_sso/networkstate/__init__.py

Added the network status implementation for windows.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# -*- coding: utf-8 -*-
 
2
# Author: Manuel de la Pena <manuel@canonical.com>
 
3
#
 
4
# Copyright 2011 Canonical Ltd.
 
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/>.
 
17
"""Platform specific network status."""
 
18
 
 
19
import sys
 
20
 
 
21
# ignore global naming issues.
 
22
# pylint: disable=C0103
 
23
 
 
24
NetworkManagerState = None
 
25
ONLINE = None
 
26
OFFLINE = None
 
27
UNKNOWN = None
 
28
 
 
29
if sys.platform == 'win32':
 
30
    from ubuntu_sso.networkstate import windows
 
31
    NetworkManagerState = windows.NetworkManagerState
 
32
    ONLINE = windows.ONLINE
 
33
    OFFLINE = windows.OFFLINE
 
34
    UNKNOWN = windows.UNKNOWN
 
35
else:
 
36
    from ubuntu_sso.networkstate import linux
 
37
    NetworkManagerState = linux.NetworkManagerState
 
38
    ONLINE = linux.ONLINE
 
39
    OFFLINE = linux.OFFLINE
 
40
    UNKNOWN = linux.UNKNOWN