diff options
author | Andrew Cady <d@jerkface.net> | 2016-12-26 17:20:59 -0500 |
---|---|---|
committer | Andrew Cady <d@jerkface.net> | 2016-12-26 18:56:06 -0500 |
commit | ecc267c230251ccbb19e421caddb7866d83451a1 (patch) | |
tree | d24303a3fb9b84b83e00d70bd9a4cd5932841cb6 | |
parent | 0aa115e59f10176e36d61f17b028f7e34e0091bd (diff) |
readdata.py supports --g5 and --g4 options
-rw-r--r-- | dexcom_reader/readdata.py | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/dexcom_reader/readdata.py b/dexcom_reader/readdata.py index d60188b..5e2436b 100644 --- a/dexcom_reader/readdata.py +++ b/dexcom_reader/readdata.py | |||
@@ -332,4 +332,18 @@ def GetDevice (port, G5=False): | |||
332 | return Dexcom(port) | 332 | return Dexcom(port) |
333 | 333 | ||
334 | if __name__ == '__main__': | 334 | if __name__ == '__main__': |
335 | Dexcom.LocateAndDownload() | 335 | |
336 | from optparse import OptionParser | ||
337 | |||
338 | G5_IS_DEFAULT = False | ||
339 | |||
340 | parser = OptionParser() | ||
341 | parser.add_option("--g4", action="store_false", dest="g5", default=G5_IS_DEFAULT, help="use Dexcom G4 instead of Dexcom G5") | ||
342 | parser.add_option("--g5", action="store_true", dest="g5", default=G5_IS_DEFAULT, help="use Dexcom G5 instead of Dexcom G4") | ||
343 | |||
344 | (options, args) = parser.parse_args() | ||
345 | |||
346 | if options.g5: | ||
347 | DexcomG5.LocateAndDownload() | ||
348 | else: | ||
349 | Dexcom.LocateAndDownload() | ||