File tree Expand file tree Collapse file tree 5 files changed +38
-12
lines changed Expand file tree Collapse file tree 5 files changed +38
-12
lines changed Original file line number Diff line number Diff line change 7
7
Uses nmcli on Linux in a short, simple Mozilla Location Services with Wifi from Python.
8
8
Goal was to be as simple as possible.
9
9
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 ) .
11
12
Let us know if you're interested.
12
13
13
14
## Install
@@ -55,7 +56,7 @@ Would like to add Bluetooth, should be simple.
55
56
* [ Alternative using Skyhook and geoclue] ( https://github.com/scivision/python-geoclue )
56
57
* [ Raspberry Pi NetworkManager] ( https://raspberrypi.stackexchange.com/a/73816 )
57
58
58
- ### Raspberry Pi 3
59
+ ### Raspberry Pi 3 / Zero W
59
60
Debian comes without NetworkManager by default.
60
61
Be careful as you lose Wifi password etc. by this procedure
61
62
Original file line number Diff line number Diff line change @@ -36,11 +36,12 @@ install_requires =
36
36
[options.extras_require]
37
37
tests =
38
38
pytest
39
+ cov =
39
40
pytest-cov
40
41
coveralls
41
42
flake8
42
43
mypy
43
- kml =
44
+ io =
44
45
simplekml
45
46
46
47
[options.entry_points]
Original file line number Diff line number Diff line change
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 >
Original file line number Diff line number Diff line change @@ -20,4 +20,4 @@ def test_nm_connection():
20
20
21
21
22
22
if __name__ == '__main__' :
23
- pytest .main ()
23
+ pytest .main ([ '-xrsv' , __file__ ] )
Original file line number Diff line number Diff line change 1
1
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
6
5
7
6
8
- @pytest .mark .skipif (Kml is None , reason = "SimpleKML wasn't installed" )
9
7
def test_kml ():
8
+ simplekml = pytest .importorskip ('simplekml' )
10
9
# Data for the track
11
10
when = ["2010-05-28T02:02:09Z" ,
12
11
"2010-05-28T02:02:35Z" ,
@@ -24,14 +23,14 @@ def test_kml():
24
23
(- 122.203329 , 37.374780 , 141.199997 ),
25
24
(- 122.203207 , 37.374857 , 140.199997 )]
26
25
27
- kml = Kml (name = "Tracks" ,)
26
+ kml = simplekml . Kml (name = "Tracks" ,)
28
27
trk = kml .newgxtrack (name = 'test' )
29
28
30
29
trk .newwhen (when )
31
30
trk .newgxcoord (coord )
32
31
33
- kml .save ('Test.kml' )
32
+ kml .save (R / 'Test.kml' )
34
33
35
34
36
35
if __name__ == '__main__' :
37
- pytest .main ()
36
+ pytest .main ([ '-xrsv' , __file__ ] )
You can’t perform that action at this time.
0 commit comments