mirror of
https://git.disroot.org/pranav/pybatmesh.git
synced 2024-11-30 02:32:24 +05:30
Added main.py
This file at the moment contains debugging code. Changed HACKING.md
This commit is contained in:
parent
b1d970a0f6
commit
91be0b0189
@ -1,6 +1,6 @@
|
||||
# Hacking
|
||||
|
||||
Everyone is welcome to [hack][] naxalnet.
|
||||
Antinationals and urban naxals are welcome to [hack][] naxalnet.
|
||||
See below for how to hack.
|
||||
|
||||
## Reporting issues and suggesting ideas
|
||||
@ -14,10 +14,9 @@ relevant label.
|
||||
To push to this repo, you need your username to be in the
|
||||
contributors list.
|
||||
To add you as a contributor, email any of the authors with
|
||||
your username to:
|
||||
your username:
|
||||
|
||||
- libreinator plus nxlnet at disroot dot org (change plus, at,
|
||||
dot to symbols)
|
||||
- `echo yvoervangbe cyhf akyarg ng qvfebbg qbg bet | tr 'A-Za-z' 'N-ZA-Mn-za-m' | sed 's/plus/+/' | sed 's/ at /@/' | sed 's/dot/./' | tr -d ' '`
|
||||
|
||||
## Packaging
|
||||
|
||||
|
@ -132,6 +132,9 @@ class Device:
|
||||
adapter_path = self._proxy.Adapter
|
||||
self.adapter = self._iwd.get_name_from_path(adapter_path)
|
||||
|
||||
def __str__(self):
|
||||
return self.name
|
||||
|
||||
def is_powered_on(self) -> bool:
|
||||
"""returns True if devie is powered on"""
|
||||
return self._proxy.Powered
|
||||
@ -192,3 +195,6 @@ class Device:
|
||||
self.power_on()
|
||||
|
||||
self._proxy.StartOpen(name)
|
||||
|
||||
|
||||
# TODO: make a class Adapter with power_on() and power_off()
|
||||
|
16
naxalnet/main.py
Normal file
16
naxalnet/main.py
Normal file
@ -0,0 +1,16 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
# This file should import libraries and do
|
||||
# what /usr/bin/naxalnet used to do
|
||||
|
||||
# TODO: change to naxalnet.iwd
|
||||
from iwd import IWD, Device
|
||||
|
||||
iwd = IWD()
|
||||
devices = iwd.get_devices()
|
||||
|
||||
print("Devices:", devices)
|
||||
|
||||
for i in devices:
|
||||
dev = Device(i)
|
||||
print(dev)
|
Loading…
Reference in New Issue
Block a user