diff --git a/README.rst b/README.rst index 0548053..510d083 100644 --- a/README.rst +++ b/README.rst @@ -191,6 +191,10 @@ Options a short description of each. If you provide more than one mode (separated by commas), Overviewer will render all of them at once, and provide a toggle on the resulting map to switch between them. + + If for some reason commas do not work for your shell (like if you're using + Powershell on Windows), you can also use a colon ':' or a forward slash '/' + to separate the modes. --list-rendermodes List the available render modes, and a short description of each. diff --git a/overviewer.py b/overviewer.py index b0103b7..c04001e 100755 --- a/overviewer.py +++ b/overviewer.py @@ -104,7 +104,7 @@ def main(): parser.add_option("-z", "--zoom", dest="zoom", helptext="Sets the zoom level manually instead of calculating it. This can be useful if you have outlier chunks that make your world too big. This value will make the highest zoom level contain (2**ZOOM)^2 tiles", action="store", type="int", advanced=True) parser.add_option("--regionlist", dest="regionlist", helptext="A file containing, on each line, a path to a regionlist to update. Instead of scanning the world directory for regions, it will just use this list. Normal caching rules still apply.") parser.add_option("--forcerender", dest="forcerender", helptext="Force re-rendering the entire map (or the given regionlist). Useful for re-rendering without deleting it.", action="store_true") - parser.add_option("--rendermodes", dest="rendermode", helptext="Specifies the render types, separated by commas. Use --list-rendermodes to list them all.", type="choice", choices=avail_rendermodes, required=True, default=avail_rendermodes[0], listify=True) + parser.add_option("--rendermodes", dest="rendermode", helptext="Specifies the render types, separated by ',', ':', or '/'. Use --list-rendermodes to list them all.", type="choice", choices=avail_rendermodes, required=True, default=avail_rendermodes[0], listify=True) parser.add_option("--list-rendermodes", dest="list_rendermodes", action="store_true", helptext="List available render modes and exit.", commandLineOnly=True) parser.add_option("--imgformat", dest="imgformat", helptext="The image output format to use. Currently supported: png(default), jpg.", advanced=True ) parser.add_option("--imgquality", dest="imgquality", default=95, helptext="Specify the quality of image output when using imgformat=\"jpg\".", type="int", advanced=True) diff --git a/overviewer_core/configParser.py b/overviewer_core/configParser.py index 621979d..af46a33 100644 --- a/overviewer_core/configParser.py +++ b/overviewer_core/configParser.py @@ -11,6 +11,7 @@ class ConfigOptionParser(object): def __init__(self, **kwargs): self.cmdParser = optparse.OptionParser(usage=kwargs.get("usage","")) self.configFile = kwargs.get("config","settings.py") + self.listifyDelimiters = kwargs.get("listdelim", ",:/") self.configVars = [] self.advancedHelp = [] # these are arguments not understood by OptionParser, so they must be removed @@ -154,7 +155,12 @@ class ConfigOptionParser(object): if 'listify' in a.keys(): # this thing may be a list! if configResults.__dict__[n] != None and type(configResults.__dict__[n]) == str: - configResults.__dict__[n] = configResults.__dict__[n].split(a.get("listdelim",",")) + delimiters = a.get("listdelim", self.listifyDelimiters) + # replace the rest of the delimiters with the first + for delim in delimiters[1:]: + configResults.__dict__[n] = configResults.__dict__[n].replace(delim, delimiters[0]) + # split at each occurance of the first delimiter + configResults.__dict__[n] = configResults.__dict__[n].split(delimiters[0]) elif type(configResults.__dict__[n]) != list: configResults.__dict__[n] = [configResults.__dict__[n]] if 'type' in a.keys() and configResults.__dict__[n] != None: