Changeset 13325 in genesis


Ignore:
Timestamp:
Jul 28, 2015, 8:51:36 AM (9 years ago)
Author:
rick
Message:

Checking if keys are defined and not if they have content

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tools/gformat.py

    r13324 r13325  
    19671967          datadump = fix_boolean(datadump)
    19681968
    1969           if datadump['rdnap_x'] and datadump['rdnap_y']:
     1969          if 'rdnap_x' in datadump and 'rdnap_y' in datadump:
    19701970            datadump['latitude'], datadump['longitude'] = map(lambda x: "%.5f" % x, rd2etrs(datadump['rdnap_x'], datadump['rdnap_y']))
    1971           elif datadump['latitude'] and datadump['longitude']:
     1971          elif 'latitude' in  datadump and 'longitude' in datadump:
    19721972            datadump['rdnap_x'], datadump['rdnap_y'] = etrs2rd(datadump['latitude'], datadump['longitude'])
    19731973
Note: See TracChangeset for help on using the changeset viewer.