|
@@ -151,15 +151,21 @@ class OWS:
|
|
|
mapobj.shapepath = self.cachedir
|
|
mapobj.shapepath = self.cachedir
|
|
|
mapobj.setMetaData("wms_encoding","utf-8")
|
|
mapobj.setMetaData("wms_encoding","utf-8")
|
|
|
|
|
|
|
|
- logging.debug("Setting ERRORFILE to %s"%self.config.get("MapServer","errorfile"))
|
|
|
|
|
- if not os.path.exists(self.config.get("MapServer","errorfile")):
|
|
|
|
|
- tmp = open(self.config.get("MapServer","errorfile"),"w")
|
|
|
|
|
|
|
+ errfile = self.config.get("MapServer","errorfile")
|
|
|
|
|
+ logging.debug("Setting ERRORFILE to %s"%errfile)
|
|
|
|
|
+ if not os.path.exists(errfile) and errfile != "stderr":
|
|
|
|
|
+ tmp = open(errfile,"w")
|
|
|
tmp.close()
|
|
tmp.close()
|
|
|
- if os.access(self.config.get("MapServer","errorfile"), os.W_OK):
|
|
|
|
|
- mapobj.setConfigOption("MS_ERRORFILE",self.config.get("MapServer","errorfile"))
|
|
|
|
|
|
|
+
|
|
|
|
|
+ # file
|
|
|
|
|
+ if os.access(errfile, os.W_OK):
|
|
|
|
|
+ mapobj.setConfigOption("MS_ERRORFILE",errfile)
|
|
|
|
|
+ # stderr
|
|
|
|
|
+ elif errfile == "stderr":
|
|
|
|
|
+ mapobj.setConfigOption("MS_ERRORFILE",errfile)
|
|
|
|
|
+ # no error file set
|
|
|
else:
|
|
else:
|
|
|
- logging.warning("Cannot set ERRORFILE to %s: %s "%\
|
|
|
|
|
- (self.config.get("MapServer","errorfile"),"Write access denided"))
|
|
|
|
|
|
|
+ logging.warning("Cannot set ERRORFILE to %s: %s " % (errfile,"Write access denided"))
|
|
|
|
|
|
|
|
logging.debug("Setting IMAGEPATH to %s"%self.config.get("MapServer","imagepath"))
|
|
logging.debug("Setting IMAGEPATH to %s"%self.config.get("MapServer","imagepath"))
|
|
|
mapobj.web.imagepath=self.config.get("MapServer","imagepath")
|
|
mapobj.web.imagepath=self.config.get("MapServer","imagepath")
|