joey: thuban/Extensions/wms capabilities.py,1.2,1.3
cvs@intevation.de
cvs at intevation.de
Wed Mar 24 21:07:36 CET 2004
Author: joey
Update of /thubanrepository/thuban/Extensions/wms
In directory doto:/tmp/cvs-serv15141
Modified Files:
capabilities.py
Log Message:
Removed a space before an opening parenthesis, added a few spaces
after a comma in argument lists
Index: capabilities.py
===================================================================
RCS file: /thubanrepository/thuban/Extensions/wms/capabilities.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- capabilities.py 24 Mar 2004 20:05:33 -0000 1.2
+++ capabilities.py 24 Mar 2004 20:07:34 -0000 1.3
@@ -24,10 +24,10 @@
getErrorMsg()
- fetchCapabilities (*resource)
- saveCapabilities (filename)
- loadCapabilities (filename)
- printCapabilities ()
+ fetchCapabilities(*resource)
+ saveCapabilities(filename)
+ loadCapabilities(filename)
+ printCapabilities()
Requirements:
- PyOGCLib <http://www.sourceforge.net/projects/pyogclib>
@@ -54,13 +54,13 @@
# Assume the PyOGCLib to be checked out next to the thuban main directory
pyogclib = "../../../PyOGCLib"
-if os.path.isdir (pyogclib) and os.path.isdir (pyogclib + "/ogclib"):
- path.insert (0, pyogclib)
+if os.path.isdir(pyogclib) and os.path.isdir(pyogclib + "/ogclib"):
+ path.insert(0, pyogclib)
# We use gettext, so we need to import it and hence need to adjust the
# path again
if __name__ == "__main__":
- path.insert (0, "../../")
+ path.insert(0, "../../")
# ----------------------------------------------------------------------
@@ -68,7 +68,7 @@
from ogclib.WMSClient import WMSClient
-class WMSCapabilities (WMSClient):
+class WMSCapabilities(WMSClient):
"""
Thuban class to maintain capabilities. This class provides
methods to fetch, save and load capabilities as well as methods to
@@ -85,7 +85,7 @@
errorMsg = None
wmsVersion = None
- def __init__ (self, *parm):
+ def __init__(self, *parm):
"""
Initialises Capabilities with one optional parameter
@@ -94,22 +94,22 @@
"""
if parm and parm[0]:
- if os.path.isfile (parm[0]):
- self.loadCapabilities (parm[0])
+ if os.path.isfile(parm[0]):
+ self.loadCapabilities(parm[0])
else:
- if parm[0].find ("http://",0) == 0:
- self.fetchCapabilities (parm[0])
+ if parm[0].find("http://", 0) == 0:
+ self.fetchCapabilities(parm[0])
else:
self.errorMsg \
= _("Resource '%s' is neither local file nor URL")
% parm[0]
- def getErrorMsg (self):
+ def getErrorMsg(self):
return self.errorMsg
- def fetchCapabilities (self, resource):
+ def fetchCapabilities(self, resource):
"""Fetches the WMS capabilities from an Internet resource"""
self.wmsVersion = "1.1"
@@ -119,32 +119,32 @@
self.capabilities = self.getCapabilities(resource, self.wmsVersion)
- def saveCapabilities (self, fname):
+ def saveCapabilities(self, fname):
"""Save capabilities to local file"""
if self.capabilities is None:
self.errorMsg = _("No capabilities available")
else:
try:
- out = open (fname, "w")
- out.write (self.capabilities)
+ out = open(fname, "w")
+ out.write(self.capabilities)
out.close()
except:
self.errorMsg = _("Can't open file '%s' for writing") % fname
- def loadCapabilities (self, fname):
+ def loadCapabilities(self, fname):
"""Load capabilities from a local file"""
try:
- input = open (fname, "r")
- self.capabilities = input.read ()
+ input = open(fname, "r")
+ self.capabilities = input.read()
input.close()
except:
self.errorMsg = _("Can't open file '%s' for reading") % fname
- def printCapabilities (self):
+ def printCapabilities(self):
"""Prints capabilities to stdout"""
print self.capabilities
More information about the Thuban-devel
mailing list
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)