Skip to content

Commit f163d83

Browse files
committed
modernize
1 parent dd8be20 commit f163d83

File tree

5 files changed

+38
-12
lines changed

5 files changed

+38
-12
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
Uses nmcli on Linux in a short, simple Mozilla Location Services with Wifi from Python.
88
Goal was to be as simple as possible.
99

10-
Note that a similar service with better accuracy is available from [Google](https://developers.google.com/maps/documentation/geolocation/intro).
10+
Note that a similar service with better accuracy is available from
11+
[Google](https://developers.google.com/maps/documentation/geolocation/intro).
1112
Let us know if you're interested.
1213

1314
## Install
@@ -55,7 +56,7 @@ Would like to add Bluetooth, should be simple.
5556
* [Alternative using Skyhook and geoclue](https://github.com/scivision/python-geoclue)
5657
* [Raspberry Pi NetworkManager](https://raspberrypi.stackexchange.com/a/73816)
5758

58-
### Raspberry Pi 3
59+
### Raspberry Pi 3 / Zero W
5960
Debian comes without NetworkManager by default.
6061
Be careful as you lose Wifi password etc. by this procedure
6162

setup.cfg

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,12 @@ install_requires =
3636
[options.extras_require]
3737
tests =
3838
pytest
39+
cov =
3940
pytest-cov
4041
coveralls
4142
flake8
4243
mypy
43-
kml =
44+
io =
4445
simplekml
4546

4647
[options.entry_points]

tests/Test.kml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<kml xmlns="http://www.opengis.net/kml/2.2" xmlns:gx="http://www.google.com/kml/ext/2.2">
3+
<Document id="1">
4+
<name>Tracks</name>
5+
<Placemark id="3">
6+
<name>test</name>
7+
<gx:Track>
8+
<when>2010-05-28T02:02:09Z</when>
9+
<when>2010-05-28T02:02:35Z</when>
10+
<when>2010-05-28T02:02:44Z</when>
11+
<when>2010-05-28T02:02:53Z</when>
12+
<when>2010-05-28T02:02:54Z</when>
13+
<when>2010-05-28T02:02:55Z</when>
14+
<when>2010-05-28T02:02:56Z</when>
15+
<gx:coord>-122.207881 37.371915 156.0</gx:coord>
16+
<gx:coord>-122.205712 37.373288 152.0</gx:coord>
17+
<gx:coord>-122.204678 37.373939 147.0</gx:coord>
18+
<gx:coord>-122.203572 37.37463 142.199997</gx:coord>
19+
<gx:coord>-122.203451 37.374706 141.800003</gx:coord>
20+
<gx:coord>-122.203329 37.37478 141.199997</gx:coord>
21+
<gx:coord>-122.203207 37.374857 140.199997</gx:coord>
22+
</gx:Track>
23+
</Placemark>
24+
</Document>
25+
</kml>

tests/test_all.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ def test_nm_connection():
2020

2121

2222
if __name__ == '__main__':
23-
pytest.main()
23+
pytest.main(['-xrsv', __file__])

tests/test_kml.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
import pytest
2-
try:
3-
from simplekml import Kml
4-
except ImportError:
5-
Kml = None
2+
from pathlib import Path
3+
4+
R = Path(__file__).parent
65

76

8-
@pytest.mark.skipif(Kml is None, reason="SimpleKML wasn't installed")
97
def test_kml():
8+
simplekml = pytest.importorskip('simplekml')
109
# Data for the track
1110
when = ["2010-05-28T02:02:09Z",
1211
"2010-05-28T02:02:35Z",
@@ -24,14 +23,14 @@ def test_kml():
2423
(-122.203329, 37.374780, 141.199997),
2524
(-122.203207, 37.374857, 140.199997)]
2625

27-
kml = Kml(name="Tracks",)
26+
kml = simplekml.Kml(name="Tracks",)
2827
trk = kml.newgxtrack(name='test')
2928

3029
trk.newwhen(when)
3130
trk.newgxcoord(coord)
3231

33-
kml.save('Test.kml')
32+
kml.save(R/'Test.kml')
3433

3534

3635
if __name__ == '__main__':
37-
pytest.main()
36+
pytest.main(['-xrsv', __file__])

0 commit comments

Comments
 (0)