1. Richo Healey
  2. doko


Richo Healey  committed 00f6b4b

Use DOKO_PRECISION environment variable to globally set precision

  • Participants
  • Parent commits 67391de
  • Branches master

Comments (0)

Files changed (1)

File doko/__init__.py

View file
 Use the Core Location framework.
+import os
 import sys
 import optparse
 from optparse import OptionValueError
     if options.strategy not in LOCATION_STRATEGIES:
         raise OptionValueError("%s is not a valid strategy" % options.strategy)
+    if os.getenv("DOKO_PRECISION"):
+        try:
+            Location.set_precision(os.getenv("DOKO_PRECISION"))
+        except ValueError:
+            raise "Invalid value in DOKO_PRECISION"
     if options.precision: