Added a new config file parser.
The new config file parser has an interface that's nearly identical to
the OptionParser of optparse.
Below is a sample settings.py config file:
$ cat settings.py
import multiprocessing
if 'rendermode' not in locals():
rendermode="lighting"
cachedir = "cache.%s.cachedir" % rendermode
procs = multiprocessing.cpu_count() - 1
This commit is contained in:
8
world.py
8
world.py
@@ -103,12 +103,12 @@ class WorldRenderer(object):
|
||||
files to update. If it includes a trailing newline, it is stripped, so you
|
||||
can pass in file handles just fine.
|
||||
"""
|
||||
def __init__(self, worlddir, cachedir, chunklist=None, lighting=False, night=False, spawn=False, useBiomeData=False):
|
||||
def __init__(self, worlddir, cachedir, chunklist=None, rendermode="normal", useBiomeData=False):
|
||||
self.worlddir = worlddir
|
||||
self.caves = False
|
||||
self.lighting = lighting or night or spawn
|
||||
self.night = night or spawn
|
||||
self.spawn = spawn
|
||||
self.lighting = rendermode in ("lighting","night","spawn")
|
||||
self.night = rendermode in ("night","spawn")
|
||||
self.spawn = rendermode in ("spawn",)
|
||||
self.cachedir = cachedir
|
||||
self.useBiomeData = useBiomeData
|
||||
|
||||
|
||||
Reference in New Issue
Block a user