Skip to content

Instantly share code, notes, and snippets.

@Deiru2k
Created March 12, 2015 16:17
Show Gist options
  • Save Deiru2k/3519be4c654f6b9b126b to your computer and use it in GitHub Desktop.
Save Deiru2k/3519be4c654f6b9b126b to your computer and use it in GitHub Desktop.
KOSTYL
if object_['landProperties']:
if object_['landProperties']['landscapeType']:
if 'landtype' in object_['landProperties']['landscapeType']:
if object_['landProperties']['landscapeType']['landtype']:
if isinstance(object_['landProperties']['landscapeType']['landtype'], str):
object_['landProperties']['landscapeType']['landtype'] = \
object_['landProperties']['landscapeType']['landtype'].split(',')
object_['landProperties']['landscapeType'] = ", ".join([
self.dictionary['land_type'][land_type].lower()
for land_type in object_['landProperties']['landscapeType']['landtype']
])
else:
if isinstance(object_['landProperties']['landscapeType'], str):
object_['landProperties']['landscapeType'] = \
object_['landProperties']['landscapeType'].split(',')
object_['landProperties']['landscapeType'] = ", ".join([
self.dictionary['land_type'][land_type].lower()
for land_type in object_['landProperties']['landscapeType']
])
else:
object_['landProperties']['landscapeType'] = {'landtype': False}
else:
object_['landProperties'] = {'landscapeType': {'landtype': False}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment