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 77Uses nmcli on Linux in a short, simple Mozilla Location Services with Wifi from Python.
88Goal 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 ) .
1112Let 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
5960Debian comes without NetworkManager by default.
6061Be careful as you lose Wifi password etc. by this procedure
6162
Original file line number Diff line number Diff line change @@ -36,11 +36,12 @@ install_requires =
3636[options.extras_require]
3737tests =
3838 pytest
39+ cov =
3940 pytest-cov
4041 coveralls
4142 flake8
4243 mypy
43- kml =
44+ io =
4445 simplekml
4546
4647[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():
2020
2121
2222if __name__ == '__main__' :
23- pytest .main ()
23+ pytest .main ([ '-xrsv' , __file__ ] )
Original file line number Diff line number Diff line change 11import 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" )
97def 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
3635if __name__ == '__main__' :
37- pytest .main ()
36+ pytest .main ([ '-xrsv' , __file__ ] )
You can’t perform that action at this time.
0 commit comments