[GRASS-SVN] r47636 - grass-addons/grass7/gui/wxpython/wx.wms
svn_grass at osgeo.org
svn_grass at osgeo.org
Sun Aug 14 13:47:37 EDT 2011
Author: sudeepsingh
Date: 2011-08-14 10:47:37 -0700 (Sun, 14 Aug 2011)
New Revision: 47636
Added:
grass-addons/grass7/gui/wxpython/wx.wms/Makefile.diff
Removed:
grass-addons/grass7/gui/wxpython/wx.wms/__init__.py
Modified:
grass-addons/grass7/gui/wxpython/wx.wms/LoadConfig.py
grass-addons/grass7/gui/wxpython/wx.wms/ServerInfoAPIs.py
grass-addons/grass7/gui/wxpython/wx.wms/TODO
grass-addons/grass7/gui/wxpython/wx.wms/addserver.py
grass-addons/grass7/gui/wxpython/wx.wms/readme.txt
grass-addons/grass7/gui/wxpython/wx.wms/wmsmenu.py
Log:
Integerate wmsmenu with wxgui
Modified: grass-addons/grass7/gui/wxpython/wx.wms/LoadConfig.py
===================================================================
--- grass-addons/grass7/gui/wxpython/wx.wms/LoadConfig.py 2011-08-14 13:27:44 UTC (rev 47635)
+++ grass-addons/grass7/gui/wxpython/wx.wms/LoadConfig.py 2011-08-14 17:47:37 UTC (rev 47636)
@@ -1,6 +1,7 @@
+import os
def loadConfigFile(self):
try:
- f=open('config','r')
+ f=open('./config','r')
lines = f.readlines()
f.close()
self.name_url_delimiter = lines[0].split()[1]
@@ -8,4 +9,6 @@
print self.name_url_delimiter
return True
except:
+ os.system("find ./ -name config")
+ print "Unable to load config file"
return False
Added: grass-addons/grass7/gui/wxpython/wx.wms/Makefile.diff
===================================================================
--- grass-addons/grass7/gui/wxpython/wx.wms/Makefile.diff (rev 0)
+++ grass-addons/grass7/gui/wxpython/wx.wms/Makefile.diff 2011-08-14 17:47:37 UTC (rev 47636)
@@ -0,0 +1,17 @@
+Index: Makefile
+===================================================================
+--- Makefile (revision 47502)
++++ Makefile (working copy)
+@@ -9,10 +9,10 @@
+
+ ETCDIR = $(ETC)/gui/wxpython
+
+-SRCFILES := $(wildcard scripts/* compat/* gui_modules/* icons/*.* xml/*) gis_set.py gis_set_error.py wxgui.py README
++SRCFILES := $(wildcard scripts/* compat/* gui_modules/* gui_modules/wms/* icons/*.* xml/*) gis_set.py gis_set_error.py wxgui.py README
+ DSTFILES := $(patsubst %,$(ETCDIR)/%,$(SRCFILES)) $(patsubst %.py,$(ETCDIR)/%.pyc,$(filter %.py,$(SRCFILES)))
+
+-DSTDIRS := $(patsubst %,$(ETCDIR)/%,compat gui_modules icons scripts xml)
++DSTDIRS := $(patsubst %,$(ETCDIR)/%,compat gui_modules gui_modules/wms icons scripts xml)
+
+ default: $(DSTFILES) menustrings.py
+ $(MAKE) parsubdirs
Modified: grass-addons/grass7/gui/wxpython/wx.wms/ServerInfoAPIs.py
===================================================================
--- grass-addons/grass7/gui/wxpython/wx.wms/ServerInfoAPIs.py 2011-08-14 13:27:44 UTC (rev 47635)
+++ grass-addons/grass7/gui/wxpython/wx.wms/ServerInfoAPIs.py 2011-08-14 17:47:37 UTC (rev 47636)
@@ -8,6 +8,7 @@
if(os.path.exists(fileName)):
try:
f = open(fileName,'r')
+ print 'ServersList.xml found, loading ... '
except:
print 'Unable to open File '+fileName
print 'exiting application...'
@@ -20,6 +21,7 @@
#print serverinfolist
#print len(serverinfolist)
else:
+ print 'ServersList.xml not found, creating a new file'
serverinfolist = []
soup = BeautifulSoup()
xml = "null"
@@ -109,4 +111,4 @@
serverdata.password = password.contents[0].strip()
servers[uid] = serverdata
map_servernameTouid[serverdata.servername] = uid
- return servers, map_servernameTouid
\ No newline at end of file
+ return servers, map_servernameTouid
Modified: grass-addons/grass7/gui/wxpython/wx.wms/TODO
===================================================================
--- grass-addons/grass7/gui/wxpython/wx.wms/TODO 2011-08-14 13:27:44 UTC (rev 47635)
+++ grass-addons/grass7/gui/wxpython/wx.wms/TODO 2011-08-14 17:47:37 UTC (rev 47636)
@@ -22,6 +22,13 @@
9.On quiting the application it leads to segmentation error or even after quiting application the console doesnot quits. Need to use ctrl-c right now.
+10.If a single server is present, unable to select a server because selection depends on the change of selection. need to modify this.
+
+11.Tab doessnot work to switch between different fields while filling server info.
+
+12.If ServersList.xml doesnot exist, then when new servers are added in manager servers window, then on selecting getcapabities, somehow the self.map_servernameTouid doesnot gets updated and is shows a key error.
+
+13.when a server requires username and password, this is not figured out yet.
More to be added...
Deleted: grass-addons/grass7/gui/wxpython/wx.wms/__init__.py
===================================================================
--- grass-addons/grass7/gui/wxpython/wx.wms/__init__.py 2011-08-14 13:27:44 UTC (rev 47635)
+++ grass-addons/grass7/gui/wxpython/wx.wms/__init__.py 2011-08-14 17:47:37 UTC (rev 47636)
@@ -1,8 +0,0 @@
-all = [
- "addserver",
- "parse",
- "passwordPopUp",
- "ServerInfoAPIs",
- "WMSMapDisplay",
- "wmsmenu",
-]
Modified: grass-addons/grass7/gui/wxpython/wx.wms/addserver.py
===================================================================
--- grass-addons/grass7/gui/wxpython/wx.wms/addserver.py 2011-08-14 13:27:44 UTC (rev 47635)
+++ grass-addons/grass7/gui/wxpython/wx.wms/addserver.py 2011-08-14 17:47:37 UTC (rev 47636)
@@ -243,6 +243,9 @@
self.servers[self.selectedUid] = serverData
self.selectedServer = serverData
self.map_servernameTouid[newServerName] = uid
+ print 'Onsave(): printing the self.map_servernameTouid'
+ print self.map_servernameTouid
+ print '--------------------------'
self.saveXMLData()
msg = self.servers
StatusBar_fields = ["Server Info Saved Successfully"]
@@ -295,6 +298,8 @@
del self.map_servernameTouid[self.selectedServer.servername]
if(len(self.servers) > 0):
self.ServerList.SetSelection(0)
+ if(len(self.servers) == 0):
+ self.ServerList.Clear()
else:
message = "Remove Unsuccessful"
self.ShowMessage(message, 'Warning')
Modified: grass-addons/grass7/gui/wxpython/wx.wms/readme.txt
===================================================================
--- grass-addons/grass7/gui/wxpython/wx.wms/readme.txt 2011-08-14 13:27:44 UTC (rev 47635)
+++ grass-addons/grass7/gui/wxpython/wx.wms/readme.txt 2011-08-14 17:47:37 UTC (rev 47636)
@@ -14,15 +14,18 @@
How to run the add-on
-1) Copy files wmsmenu.py , parse.py to gui/wxpython/gui_modules/
-2) Patch wxgui.py and toolbars.py with command "cd path/to/sourceroot && cat core.diff | patch -p0"
-3) make the source code
-3) Now run it , when launched , a new button shall appear in Main GUI window beside 'New Display button'
-4) Click on it, and a new wms window shall be launched.
-5) Enter url of WMS
-6) Click on Get Capabilites.
+1) Create a directory wms in as grass_trunk/gui/wxpython/gui_modules/wms. Place all the files in the svn root/grass-addons/grass7/gui/wxpython/wx.wmswms directory in the created wms directory.
+2) Change the path for config file in the file LoadConfig.py as per the where config file is placed. (This need is temporary, will be resolved soon)
+3) Patch wxgui.py and toolbars.py with command "cd path/to/sourceroot && cat core.diff | patch -p0"
+4) make the source code
+5) Now run it , when launched , a new button shall appear in Main GUI window beside 'Start New Map Display'
+6) Click on it, and a new wms window shall be launched.
+Bugs:
+
+Known bugs are in TODO file
+
Author -
Sudeep Singh Walia
Modified: grass-addons/grass7/gui/wxpython/wx.wms/wmsmenu.py
===================================================================
--- grass-addons/grass7/gui/wxpython/wx.wms/wmsmenu.py 2011-08-14 13:27:44 UTC (rev 47635)
+++ grass-addons/grass7/gui/wxpython/wx.wms/wmsmenu.py 2011-08-14 17:47:37 UTC (rev 47636)
@@ -355,9 +355,13 @@
#self.printDict(self.servers)
print "OnServerList: done"
if(len(urlarr)==2):
- uid = self.map_servernameTouid[urlarr[0]]
- self.selectedURL = self.servers[uid].url
- print self.selectedURL
+ try:
+ uid = self.map_servernameTouid[urlarr[0]]
+ self.selectedURL = self.servers[uid].url
+ print self.selectedURL
+ except KeyError:
+ print 'key error reported'
+ print self.map_servernameTouid
else:
print "Wrong format of URL selected"
#Sudeep's Code Ends
More information about the grass-commit
mailing list