Get the wifi interface status.
481733
def status(self, obj):
        """"""

        data_size = DWORD()
        data = PDWORD()
        opcode_value_type = DWORD()
        self._wlan_query_interface(self._handle, obj['guid'], 6,
                                   byref(data_size), byref(data),
                                   byref(opcode_value_type))

        return status_dict[data.contents.value]
707667
def check_connection(self):
        """"""
        host = self.urlparts[1]
        addresses = socket.getaddrinfo(host, 80, 0, 0, socket.SOL_TCP)
        args = {'host': host}
        if addresses:
            args['ips'] = [x[4][0] for x in addresses]
            self.set_result(_('%(host)s resolved to IPs %(ips)s') % args, valid=True)
        else:
            self.set_result(_('%(host)r could not be resolved') % args, valid=False)
371625
def get_connection_status(self, connection_id):
        
        with self._connections_lock:
            try:
                connection_info = self._connections[connection_id]
                return connection_info.status
            except KeyError:
                return None
1299345
def vpn_status(self):
        """"""

        # Start signal handler thread if it should be running
        if not self.check_pid and not self.thread_started:
            self._start_handler_thread()

        # Set color_bad as default output. Replaced if VPN active.
        name = None
        color = self.py3.COLOR_BAD

        # If we are acting like the default i3status module
        if self.check_pid:
            if self._check_pid():
                name = "yes"
                color = self.py3.COLOR_GOOD

        # Otherwise, find the VPN name, if it is active
        else:
            vpn = self._get_vpn_status()
            if vpn:
                name = ", ".join(vpn)
                color = self.py3.COLOR_GOOD

        # Format and create the response dict
        full_text = self.py3.safe_format(self.format, {"name": name})
        response = {
            "full_text": full_text,
            "color": color,
            "cached_until": self.py3.CACHE_FOREVER,
        }

        # Cache forever unless in check_pid mode
        if self.check_pid:
            response["cached_until"] = self.py3.time_in(self.cache_timeout)
        return response
1311566
public function getStatus()
    {
        $this->initialize();
        if ( ! ($this->riakClient instanceof RiakClient)) {
            return null;
        }

        return $this->riakClient->status;
    }
522991
def get_relay_state(self):
        """"""
        self.get_status()
        try:
            self.state = self.data['relay']
        except TypeError:
            self.state = False

        return bool(self.state)
979117
def wstatus_to_str(status):
    
    if os.WIFEXITED(status):
        return 'exited with return code %d' % (os.WEXITSTATUS(status),)
    if os.WIFSIGNALED(status):
        n = os.WTERMSIG(status)
        return 'exited due to signal %d (%s)' % (n, SIGNAL_BY_NUM.get(n))
    if os.WIFSTOPPED(status):
        n = os.WSTOPSIG(status)
        return 'stopped due to signal %d (%s)' % (n, SIGNAL_BY_NUM.get(n))
    return 'unknown wait status (%d)' % (status,)
728563
def interfaces(self):
        """"""
        
        ifaces = []
        for f in sorted(os.listdir(CTRL_IFACE_DIR)):
            sock_file = '/'.join([CTRL_IFACE_DIR, f])
            mode = os.stat(sock_file).st_mode
            if stat.S_ISSOCK(mode):
                iface = {}
                iface['name'] = f
                ifaces.append(iface)
                self._connect_to_wpa_s(f)

        return ifaces
1153557
def get_status(self, device_id):
        """"""
        devices = self.get_devices()

        if devices != False:
            for device in devices:
                if device['door'] == device_id:
                    return device['status']

        return False
1259944
def widget_status(self):
        """"""
        widget_status_list = []
        for i in self.widgetlist:
            widget_status_list += [[i.name, i.status]]
        return widget_status_list
460116
def status(self, obj):
        """"""

        reply = self._send_cmd_to_wpas(obj['name'], 'STATUS', True)
        result = reply.split('\n')

        status = ''
        for l in result:
            if l.startswith('wpa_state='):
                status = l[10:]
                return status_dict[status.lower()]
1344144
def _check_status(self, ibsta):
        """"""
        if ibsta & 0x4000:
            raise LinuxGpib.Timeout()
        elif ibsta & 0x8000:
            raise LinuxGpib.Error(self.error_status)
65876
def _wifi_connect():
    """"""
    if not wlan.isconnected():
        wlan.active(True)
        print("NETWORK: connecting to network %s..." % settings.WIFI_SSID)
        wlan.connect(settings.WIFI_SSID, secret)
        while not wlan.isconnected():
            print("NETWORK: waiting for connection...")
            utime.sleep(1)
        print("NETWORK: Connected, network config: %s" % repr(wlan.ifconfig()))
1326578
def network_profiles(self):
        """"""

        profiles = self._wifi_ctrl.network_profiles(self._raw_obj)

        if self._logger.isEnabledFor(logging.INFO):
            for profile in profiles:
                self._logger.info("Get profile:")
                self._logger.info("\tssid: %s", profile.ssid)
                self._logger.info("\tauth: %s", profile.auth)
                self._logger.info("\takm: %s", profile.akm)
                self._logger.info("\tcipher: %s", profile.cipher)

        return profiles
1224285
def get_device_status(self, t):
        ''''''
        data = {}
        for name, (func, _, _) in self.addons.iteritems():
            data[name] = func(t)
        return data
1113558
def _get_static_info(interface):
    '''
    
    '''
    data = {
        'connectionid': interface.name,
        'label': interface.name,
        'hwaddr': interface.hwaddr[:-1],
        'up': False,
        'ipv4': {
            'supportedrequestmodes': ['static', 'dhcp_linklocal', 'disabled'],
            'requestmode': 'static'
        },
        'wireless': False
    }
    hwaddr_section_number = ''.join(data['hwaddr'].split(':'))
    if os.path.exists(INTERFACES_CONFIG):
        information = _load_config(hwaddr_section_number, ['IPv4', 'Nameservers'], filename=INTERFACES_CONFIG)
        if information['IPv4'] != '':
            ipv4_information = information['IPv4'].split('/')
            data['ipv4']['address'] = ipv4_information[0]
            data['ipv4']['dns'] = information['Nameservers'].split(',')
            data['ipv4']['netmask'] = ipv4_information[1]
            data['ipv4']['gateway'] = ipv4_information[2]
    return data
1138462
def show_network_ip_availability(self, network, **_params):
        """"""
        return self.get(self.network_ip_availability_path % (network),
                        params=_params)