Commits

Richo Healey  committed 00f6b4b

Use DOKO_PRECISION environment variable to globally set precision

  • Participants
  • Parent commits 67391de

Comments (0)

Files changed (1)

File doko/__init__.py

 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:
         Location.set_precision(options.precision)