0

Scrub parens from poi group names

Fixes #814
This commit is contained in:
Andrew Chin
2012-09-21 08:28:15 -04:00
parent 58b5c12172
commit 14a3727bed

View File

@@ -24,6 +24,13 @@ from overviewer_core import logger
from overviewer_core import nbt
from overviewer_core import configParser, world
def replaceBads(s):
"Replaces bad characters with good characters!"
bads = [" ", "(", ")"]
x=s
for bad in bads:
x = x.replace(bad,"_")
return x
def handleSigns(rset, outputdir, render, rname):
@@ -156,7 +163,7 @@ def main():
for f in render['markers']:
markersets.add(((f['name'], f['filterFunction']), rset))
name = f['name'].replace(" ","_") + hex(hash(f['filterFunction']))[-4:] + "_" + hex(hash(rset))[-4:]
name = replaceBads(f['name']) + hex(hash(f['filterFunction']))[-4:] + "_" + hex(hash(rset))[-4:]
to_append = dict(groupName=name,
displayName = f['name'],
icon=f.get('icon', 'signpost_icon.png'),
@@ -179,7 +186,7 @@ def main():
filter_name = flter[0]
filter_function = flter[1]
name = filter_name.replace(" ","_") + hex(hash(filter_function))[-4:] + "_" + hex(hash(rset))[-4:]
name = replaceBads(filter_name) + hex(hash(filter_function))[-4:] + "_" + hex(hash(rset))[-4:]
markerSetDict[name] = dict(created=False, raw=[], name=filter_name)
for poi in rset._pois['TileEntities']:
result = filter_function(poi)