Skip to content

Commit 9560b9b

Browse files
committed
add --dump option
1 parent bbaeba6 commit 9560b9b

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ In urban areas, accuracy of less than 100 meters is possible.
4242
dump raw signals, without using API:
4343

4444
```sh
45-
python -m mozloc.signal
45+
python -m mozloc --dump
4646
```
4747

4848
### macOS

src/mozloc/__main__.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@
88
"""
99

1010
import argparse
11+
from pprint import pprint
1112

1213
from .base import log_wifi_loc, process_file
14+
from .modules import parse_signal, get_signal
1315

1416

1517
p = argparse.ArgumentParser()
@@ -26,10 +28,13 @@
2628
help="Mozilla location services URL--don't use this default test key",
2729
default="https://location.services.mozilla.com/v1/geolocate?key=test",
2830
)
31+
p.add_argument("-d", "--dump", help="print raw data to console without logging", action="store_true")
2932
p.add_argument("-i", "--infile", help="use raw text saved from command line")
3033
args = p.parse_args()
3134

32-
if args.infile:
35+
if args.dump:
36+
pprint(parse_signal(get_signal()))
37+
elif args.infile:
3338
process_file(args.infile, mozilla_url=args.url)
3439
else:
3540
log_wifi_loc(cadence_sec=args.cadence, mozilla_url=args.url, logfile=args.logfile)

src/mozloc/signal/__init__.py

Whitespace-only changes.

src/mozloc/signal/__main__.py

-5
This file was deleted.

0 commit comments

Comments
 (0)