1. Dmitri Lebedev
  2. osm2python

Commits

Dmitri Lebedev  committed d291afc

more parent argument fixes

  • Participants
  • Parent commits 5041b9f
  • Branches default

Comments (0)

Files changed (3)

File __init__.py

View file
  • Ignore whitespace
 	load_osm.elements = []
 
 	if not load_callback:
-		def load_callback(current, parent=None):
+		def load_callback(current, parent):
 			parent['children'].append(current)
 
 	element_filter = element_filter or default_element_filter

File osm_json.py

View file
  • Ignore whitespace
 
 
 def parse_json(infile, outfile):
-	def callback(elt, parent=None):
+	def callback(elt, parent):
 		if elt['name'] in ('node', 'way', 'relation'):
 			if not elt['children']:
 				del elt['children']

File tree.py

View file
  • Ignore whitespace
 	"""
 	doc = OsmDocument()
 
-	def load_callback(current, parent=None):
+	def load_callback(current, parent):
 		"""
 		Does nothing. Overriden for safety.
 		"""
 			d = doc.dicts[name]
 			element = doc.classes[name](doc, current)
 			d[element.id] = element
-		elif parent:
+		else:
 			parent['children'].append(current)
 
 	load_osm(stream, load_callback=load_callback)