Skip to content

Commit

Permalink
add --dump option
Browse files Browse the repository at this point in the history
  • Loading branch information
scivision committed Jun 11, 2024
1 parent bbaeba6 commit 9560b9b
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ In urban areas, accuracy of less than 100 meters is possible.
dump raw signals, without using API:

```sh
python -m mozloc.signal
python -m mozloc --dump
```

### macOS
Expand Down
7 changes: 6 additions & 1 deletion src/mozloc/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@
"""

import argparse
from pprint import pprint

from .base import log_wifi_loc, process_file
from .modules import parse_signal, get_signal


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

if args.infile:
if args.dump:
pprint(parse_signal(get_signal()))
elif args.infile:
process_file(args.infile, mozilla_url=args.url)
else:
log_wifi_loc(cadence_sec=args.cadence, mozilla_url=args.url, logfile=args.logfile)
Empty file removed src/mozloc/signal/__init__.py
Empty file.
5 changes: 0 additions & 5 deletions src/mozloc/signal/__main__.py

This file was deleted.

0 comments on commit 9560b9b

Please sign in to comment.