genPOI: use a defaultdict for markers
This is a little faster and make the code a little shorter.
This commit is contained in:
@@ -24,6 +24,7 @@ import Queue
|
|||||||
import multiprocessing
|
import multiprocessing
|
||||||
import itertools
|
import itertools
|
||||||
|
|
||||||
|
from collections import defaultdict
|
||||||
from multiprocessing import Process
|
from multiprocessing import Process
|
||||||
from multiprocessing import Pool
|
from multiprocessing import Pool
|
||||||
from optparse import OptionParser
|
from optparse import OptionParser
|
||||||
@@ -293,7 +294,7 @@ def main():
|
|||||||
worldcache = {}
|
worldcache = {}
|
||||||
|
|
||||||
markersets = set()
|
markersets = set()
|
||||||
markers = dict()
|
markers = defaultdict(list)
|
||||||
|
|
||||||
for rname, render in config['renders'].iteritems():
|
for rname, render in config['renders'].iteritems():
|
||||||
try:
|
try:
|
||||||
@@ -325,11 +326,7 @@ def main():
|
|||||||
icon=f.get('icon', 'signpost_icon.png'),
|
icon=f.get('icon', 'signpost_icon.png'),
|
||||||
createInfoWindow=f.get('createInfoWindow',True),
|
createInfoWindow=f.get('createInfoWindow',True),
|
||||||
checked = f.get('checked', False))
|
checked = f.get('checked', False))
|
||||||
try:
|
markers[rname].append(to_append)
|
||||||
l = markers[rname]
|
|
||||||
l.append(to_append)
|
|
||||||
except KeyError:
|
|
||||||
markers[rname] = [to_append]
|
|
||||||
|
|
||||||
if not options.skipscan:
|
if not options.skipscan:
|
||||||
handleEntities(rset, os.path.join(destdir, rname), render, rname, config)
|
handleEntities(rset, os.path.join(destdir, rname), render, rname, config)
|
||||||
|
|||||||
Reference in New Issue
Block a user