Changeset 9822 in genesis
- Timestamp:
- Dec 23, 2011, 8:54:51 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tools/rdnap.py
r8872 r9822 4 4 # longitude : lam 5 5 # 6 import os 6 7 import yaml 7 8 import urllib 8 9 9 CACHE_FILE = '/tmp/rd2etrs.yaml' 10 try: 11 CACHE_FILE = os.environ['RD2ETRS_CACHE'] 12 except KeyError: 13 CACHE_FILE = os.path.join(os.environ['HOME'],'.rd2etrs.yaml') 10 14 coordinates = None 11 15 … … 18 22 def write_yaml(gfile, datadump): 19 23 """ Write configuration yaml for 'item'""" 20 f = open(gfile, 'w') 21 f.write(yaml.dump(datadump, default_flow_style=False)) 22 f.close() 24 try: 25 f = open(gfile, 'w') 26 f.write(yaml.dump(datadump, default_flow_style=False)) 27 f.close() 28 except IOError: 29 pass 23 30 24 31 def etrs2rd(lam, phi):
Note:
See TracChangeset
for help on using the changeset viewer.