[GRASS-SVN] r65931 - in grass-addons/grass7/gui/wxpython/wx.metadata: config db.csw.admin db.csw.harvest db.csw.run g.gui.cswbrowser mdlib profiles
svn_grass at osgeo.org
svn_grass at osgeo.org
Fri Aug 14 07:01:58 PDT 2015
Author: krejcmat
Date: 2015-08-14 07:01:58 -0700 (Fri, 14 Aug 2015)
New Revision: 65931
Modified:
grass-addons/grass7/gui/wxpython/wx.metadata/config/Makefile
grass-addons/grass7/gui/wxpython/wx.metadata/db.csw.admin/db.csw.admin.py
grass-addons/grass7/gui/wxpython/wx.metadata/db.csw.harvest/db.csw.harvest.py
grass-addons/grass7/gui/wxpython/wx.metadata/db.csw.run/db.csw.run.py
grass-addons/grass7/gui/wxpython/wx.metadata/g.gui.cswbrowser/g.gui.cswbrowser.html
grass-addons/grass7/gui/wxpython/wx.metadata/g.gui.cswbrowser/g.gui.cswbrowser.py
grass-addons/grass7/gui/wxpython/wx.metadata/mdlib/Makefile
grass-addons/grass7/gui/wxpython/wx.metadata/mdlib/cswlib.py
grass-addons/grass7/gui/wxpython/wx.metadata/mdlib/cswutil.py
grass-addons/grass7/gui/wxpython/wx.metadata/mdlib/mdeditorfactory.py
grass-addons/grass7/gui/wxpython/wx.metadata/mdlib/mdgrass.py
grass-addons/grass7/gui/wxpython/wx.metadata/mdlib/mdpdffactory.py
grass-addons/grass7/gui/wxpython/wx.metadata/mdlib/mdutil.py
grass-addons/grass7/gui/wxpython/wx.metadata/profiles/Makefile
Log:
wx.metadata addons: fix Makefile,debug cswbrowser,fix typos
Modified: grass-addons/grass7/gui/wxpython/wx.metadata/config/Makefile
===================================================================
--- grass-addons/grass7/gui/wxpython/wx.metadata/config/Makefile 2015-08-14 13:55:30 UTC (rev 65930)
+++ grass-addons/grass7/gui/wxpython/wx.metadata/config/Makefile 2015-08-14 14:01:58 UTC (rev 65931)
@@ -2,5 +2,12 @@
include $(MODULE_TOPDIR)/include/Make/Dir.make
+DSTDIR = $(ETC)/wx.metadata/config
+
+$(DSTDIR):
+ $(MKDIR) -p $@
+
default:
- $(INSTALL_DATA) *.??? *.html $(ETC)
+
+install: $(DSTDIR)
+ $(INSTALL_DATA) *.??? *.html $(DSTDIR)
\ No newline at end of file
Modified: grass-addons/grass7/gui/wxpython/wx.metadata/db.csw.admin/db.csw.admin.py
===================================================================
--- grass-addons/grass7/gui/wxpython/wx.metadata/db.csw.admin/db.csw.admin.py 2015-08-14 13:55:30 UTC (rev 65930)
+++ grass-addons/grass7/gui/wxpython/wx.metadata/db.csw.admin/db.csw.admin.py 2015-08-14 14:01:58 UTC (rev 65931)
@@ -129,8 +129,9 @@
import shutil
try:
from pycsw.core import admin, config
+
except:
- sys.exit('pycsw library is missing. Check dependency on the manual page < https://grasswiki.osgeo.org/wiki/ISO/INSPIRE_Metadata_Support >')
+ sys.exit('pycsw library is missing. Check requirements on the manual page < https://grasswiki.osgeo.org/wiki/ISO/INSPIRE_Metadata_Support >')
Modified: grass-addons/grass7/gui/wxpython/wx.metadata/db.csw.harvest/db.csw.harvest.py
===================================================================
--- grass-addons/grass7/gui/wxpython/wx.metadata/db.csw.harvest/db.csw.harvest.py 2015-08-14 13:55:30 UTC (rev 65930)
+++ grass-addons/grass7/gui/wxpython/wx.metadata/db.csw.harvest/db.csw.harvest.py 2015-08-14 14:01:58 UTC (rev 65931)
@@ -53,7 +53,7 @@
from owslib.csw import CatalogueServiceWeb
from owslib.ows import ExceptionReport
except:
- sys.exit('owslib python library is missing. Check dependency on the manual page < https://grasswiki.osgeo.org/wiki/ISO/INSPIRE_Metadata_Support >')
+ sys.exit('owslib python library is missing. Check requirements on the manual page < https://grasswiki.osgeo.org/wiki/ISO/INSPIRE_Metadata_Support >')
#from __future__ import absolute_import
#from __future__ import print_function
Modified: grass-addons/grass7/gui/wxpython/wx.metadata/db.csw.run/db.csw.run.py
===================================================================
--- grass-addons/grass7/gui/wxpython/wx.metadata/db.csw.run/db.csw.run.py 2015-08-14 13:55:30 UTC (rev 65930)
+++ grass-addons/grass7/gui/wxpython/wx.metadata/db.csw.run/db.csw.run.py 2015-08-14 14:01:58 UTC (rev 65931)
@@ -84,7 +84,7 @@
try:
from pycsw import server
except:
- sys.exit('pycsw library is missing. Check dependency on the manual page < https://grasswiki.osgeo.org/wiki/ISO/INSPIRE_Metadata_Support >')
+ sys.exit('pycsw library is missing. Check requirements on the manual page < https://grasswiki.osgeo.org/wiki/ISO/INSPIRE_Metadata_Support >')
app_path=None
@contextlib.contextmanager
Modified: grass-addons/grass7/gui/wxpython/wx.metadata/g.gui.cswbrowser/g.gui.cswbrowser.html
===================================================================
--- grass-addons/grass7/gui/wxpython/wx.metadata/g.gui.cswbrowser/g.gui.cswbrowser.html 2015-08-14 13:55:30 UTC (rev 65930)
+++ grass-addons/grass7/gui/wxpython/wx.metadata/g.gui.cswbrowser/g.gui.cswbrowser.html 2015-08-14 14:01:58 UTC (rev 65931)
@@ -13,7 +13,8 @@
<h3>Setting up connection</h3>
-After start g.gui.cswbrowser the connection manager is initialized by default connection file which includes some well
+After start g.gui.cswbrowser the connection manager is initialized by default connection file which
+includes some well
known catalogs. Connection manager allows to add, to delete and to load connection from xml file.
<h3>Search and browse catalog</h3>
@@ -23,34 +24,38 @@
<h2>EXAMPLES</h2>
<h3>Query filter</h3>
-The filter can be defined by limitation of area by bounding box which can be set by GRASS region or manualy.
+The filter can be defined by limitation of area by bounding box which can be set by GRASS region or
+manualy.
<h3>Bounding box</h3>
<ul>
<li>Bounding box<br>
- Bounding box defined spatial extent for limitation of area. Button "Map extends" allows to set up values from current GRASS region.</li>
+ Bounding box defined spatial extent for limitation of area. Button "Map extends" allows to set
+ up values from current GRASS region.</li>
<li>Keywords<br>
- This filter allows to use basic or advance keyword filtering. In the simple case user can define single keywords or
- multiple keywords with button "+". Logic operator between keywords is AND(&&).
- Second, advanced is based on OGC list of expressions which means that can be set filtr with logic relations between
- keywords or sets of keywords. Dialog for settings kewords text string is under "Advanced" checkbox. Syntax of
- constraints is based on python list syntax. Each keywords must be in braces<'>or<">.</li>
+ This filter allows to use basic or advance keyword filtering. In the simple case user can define
+ single keywords or multiple keywords with button "+". Logic operator between keywords is AND(&&).
+ Second, advanced is based on OGC list of expressions which means that can be set filtr with logic
+ relations between keywords or sets of keywords. Dialog for settings kewords text string is under
+ "Advanced" checkbox. Syntax of constraints is based on python list syntax. Each keywords must be
+ in braces<'>or<">.</li>
<li><ul>
<li>OR condition<br>
a || b || c
["a","b","c"]</li>
<li>AND condition<br>
a && b && c
- [[a,b,c]]</li>
- <li>MORE condition<br>
+ [["a","b","c"]]</li>
+ <li>composition<br>
(a && b) || c || d || e
- [[a,b],[c],[d],[e]] or [[a,b],c,d,e]</li>
+ [["a","b"],["c"],["d"],["e"]] or [["a","b"],"c","d","e"]</li>
</ul></li>
</ul>
<h3>Browsing of metadata</h3>
-In case of successful request, user can browse through results and show request and response in xml format. If services
+In case of successful request, user can browse through results and show request and response in xml format.
+If services
contains uri of WMS, WFS or WMS, module allows to add them directly with using upper toolbar.
Modified: grass-addons/grass7/gui/wxpython/wx.metadata/g.gui.cswbrowser/g.gui.cswbrowser.py
===================================================================
--- grass-addons/grass7/gui/wxpython/wx.metadata/g.gui.cswbrowser/g.gui.cswbrowser.py 2015-08-14 13:55:30 UTC (rev 65930)
+++ grass-addons/grass7/gui/wxpython/wx.metadata/g.gui.cswbrowser/g.gui.cswbrowser.py 2015-08-14 14:01:58 UTC (rev 65931)
@@ -1,9 +1,22 @@
#!/usr/bin/env python
+"""
+ at module g.gui.cswbrowser
+ at brief GUI csw browser
+
+(C) 2015 by the GRASS Development Team
+This program is free software under the GNU General Public License
+(>=v2). Read the file COPYING that comes with GRASS for details.
+
+ at author Matej Krejci <matejkrejci gmail.com> (GSoC 2015)
+"""
+
import sys, os
+
+sys.path.insert(1, os.path.join(os.path.dirname(sys.path[0]),'etc','wx.metadata','mdlib'))
+import wx
+from cswlib import CSWBrowserPanel,CSWConnectionPanel
import grass.script as grass
-sys.path.insert(1, os.path.join(os.path.dirname(sys.path[0]), 'etc', 'mdlib'))
-from cswlib import *
-import wx
+
class CswBrowserMainDialog(wx.Frame):
def __init__(self):
wx.Frame.__init__(self, None, title="Metadata browser", size=(1024, 760))
@@ -13,7 +26,6 @@
self.BrowserPanel = CSWBrowserPanel(self.mainNotebook, self)
self.connectionPanel = CSWConnectionPanel(self.mainNotebook, self)
- # self.dirpath = os.path.join(os.getenv('GRASS_ADDON_BASE'), 'g.gui.cswbrowser')
self.mainNotebook.AddPage(self.BrowserPanel, text='Find')
self.mainNotebook.AddPage(self.connectionPanel, text='Configure')
self._layout()
@@ -31,5 +43,4 @@
if __name__ == '__main__':
grass.parser()
- main()
-
+ main()
\ No newline at end of file
Modified: grass-addons/grass7/gui/wxpython/wx.metadata/mdlib/Makefile
===================================================================
--- grass-addons/grass7/gui/wxpython/wx.metadata/mdlib/Makefile 2015-08-14 13:55:30 UTC (rev 65930)
+++ grass-addons/grass7/gui/wxpython/wx.metadata/mdlib/Makefile 2015-08-14 14:01:58 UTC (rev 65931)
@@ -3,7 +3,7 @@
include $(MODULE_TOPDIR)/include/Make/Other.make
include $(MODULE_TOPDIR)/include/Make/Python.make
-DSTDIR = $(ETC)/mdlib
+DSTDIR = $(ETC)/wx.metadata/mdlib
MODULES = $(wildcard *.py)
Modified: grass-addons/grass7/gui/wxpython/wx.metadata/mdlib/cswlib.py
===================================================================
--- grass-addons/grass7/gui/wxpython/wx.metadata/mdlib/cswlib.py 2015-08-14 13:55:30 UTC (rev 65930)
+++ grass-addons/grass7/gui/wxpython/wx.metadata/mdlib/cswlib.py 2015-08-14 14:01:58 UTC (rev 65931)
@@ -1,41 +1,51 @@
#!/usr/bin/env python
+"""
+ at module library for g.gui.cswbrowser
+ at brief GUI csw browser
+
+(C) 2015 by the GRASS Development Team
+This program is free software under the GNU General Public License
+(>=v2). Read the file COPYING that comes with GRASS for details.
+
+ at author Matej Krejci <matejkrejci gmail.com> (GSoC 2015)
+"""
import sys,os
-import grass.script as grass
-from modules.import_export import GdalImportDialog, GdalOutputDialog, ImportDialog
try:
from owslib.csw import CatalogueServiceWeb
except:
- sys.exit('owslib python library is missing. Check dependency on the manual page < https://grasswiki.osgeo.org/wiki/ISO/INSPIRE_Metadata_Support >')
+ sys.exit('owslib python library is missing. Check requirements on the manual page < https://grasswiki.osgeo.org/wiki/ISO/INSPIRE_Metadata_Support >')
-import webbrowser
from cswutil import *
+from mdutil import yesNo
+import tempfile
+import json
+
+import webbrowser
import wx
from wx import SplitterWindow
import wx.html as html
+from wx.lib.buttons import ThemedGenBitmapTextButton as BitmapBtnTxt
+from wx.lib.mixins.listctrl import ListCtrlAutoWidthMixin
import webbrowser
from threading import Thread
import xml.etree.ElementTree as ET
+from wx.html import HTML_URL_IMAGE, HTML_OPEN, EVT_HTML_LINK_CLICKED, HW_DEFAULT_STYLE, HW_SCROLLBAR_NEVER, \
+ HW_SCROLLBAR_AUTO
-from wx.lib.buttons import ThemedGenBitmapTextButton as BitmapBtnTxt
-from wx.lib.mixins.listctrl import ListCtrlAutoWidthMixin
# import wx.html2 not supported in 2.8.12.1 (need for CSS support)
from owslib.csw import CatalogueServiceWeb
from owslib.fes import BBox, PropertyIsLike
from owslib.ows import ExceptionReport
-import json
+
+import grass.script as grass
from core.utils import GetFormats
from gui_core.forms import GUI
from core.gcmd import RunCommand, GError, GMessage, GWarning
-from wx.html import HTML_URL_IMAGE, HTML_OPEN, EVT_HTML_LINK_CLICKED, HW_DEFAULT_STYLE, HW_SCROLLBAR_NEVER, \
- HW_SCROLLBAR_AUTO
-import tempfile
-
+from modules.import_export import GdalImportDialog, GdalOutputDialog, ImportDialog
from subprocess import PIPE
from grass.pygrass.modules import Module
from grass.script import parse_key_val
-from cswutil import *
-#sys.path.insert(1, os.path.join(os.path.dirname(sys.path[0]), 'etc', 'config'))
class ConstraintsBulder(wx.Panel):
def __init__(self, parent, settings=''):
@@ -93,7 +103,6 @@
# self.connectionFilePath = os.path.join('config', 'connections_resources.xml')
self.context=StaticContext()
self.connectionFilePath = os.path.join(self.context.addonsPath, 'connections_resources.xml')
-
self.pnlLeft = wx.Panel(self.splitterBrowser, id=wx.ID_ANY)
self.pnlRight = wx.Panel(self.splitterBrowser, -1)
@@ -111,21 +120,22 @@
# self.abstractCtrl = wx.TextCtrl(self.pnlRight, style=wx.TE_MULTILINE | wx.HSCROLL)
self.catalogCmb = wx.ComboBox(self.pnlLeft, id=-1, pos=wx.DefaultPosition)
+ self.keywordCtr = wx.TextCtrl(self.pnlLeft)
self.catalogCmb.Bind(wx.EVT_COMBOBOX, self.OnSetCatalog)
- w, self.h = self.catalogCmb.GetSize()
+ w, self.h = self.keywordCtr.GetSize()
self.numResultsSpin = wx.SpinCtrl(self.pnlLeft, min=1, max=100, initial=20, size=(sizeConst, self.h),
style=wx.ALIGN_RIGHT | wx.SP_ARROW_KEYS)
- self.keywordCtr = wx.TextCtrl(self.pnlLeft)
+
self.addKeywordCtr = wx.Button(self.pnlLeft, -1, '+', size=(self.h, self.h))
self.addKeywordCtr.Bind(wx.EVT_BUTTON, self.addKeyWidget)
self.findBtt = wx.Button(self.pnlLeft, size=(sizeConst, self.h), label='Find')
self.findBtt.SetBackgroundColour((255, 127, 80))
- self.qtypeRb = wx.RadioButton(self.pnlLeft, label='All', style=wx.RB_GROUP)
- self.qtypeRb1 = wx.RadioButton(self.pnlLeft, label='Dataset')
- self.qtypeRb2 = wx.RadioButton(self.pnlLeft, label='Service')
- self.qtypeRb.SetValue(True)
+ qtyp=['All','Collection','Dataset','Event','Image','InteractiveResource',
+ 'MovingImage','PhysicalObject','Service','Software','Sound','StillImage','Text']
+ self.qtypeCb = wx.ComboBox(self.pnlLeft, id=-1, pos=wx.DefaultPosition,choices=qtyp)
+ self.qtypeCb.SetValue("All")
# -----Results---
self.resultList = AutoWidthListCtrl(self.pnlLeft)
self.resultList.Bind(wx.EVT_LIST_ITEM_FOCUSED, self.setTooltip)
@@ -267,7 +277,7 @@
f = open(path, 'w')
f.write(request_html)
f.close()
- if YesNo(self, 'Do you want to open <request> in default browser', 'Open file'):
+ if yesNo(self, 'Do you want to open <request> in default browser', 'Open file'):
open_url(path)
self.htmlView.SetPage((renderXML(self.context, self.catalog.request)))
@@ -279,7 +289,7 @@
f = open(path, 'w')
f.write(response_html)
f.close()
- if YesNo(self, 'Do you want to open <response> in default browser', 'Open file'):
+ if yesNo(self, 'Do you want to open <response> in default browser', 'Open file'):
open_url(path)
self.htmlView.SetPage((renderXML(self.context, self.catalog.response)))
@@ -423,7 +433,7 @@
self.startfrom += self.maxrecords
if self.startfrom >= self.catalog.results["matches"]:
msg = 'End of results. Go to start?'
- if YesNo(self, msg, 'End of results'):
+ if yesNo(self, msg, 'End of results'):
self.startfrom = 0
else:
return
@@ -431,7 +441,7 @@
self.startfrom -= self.maxrecords
if self.startfrom < 0:
msg = 'Start of results. Go to end?'
- if YesNo(self, msg, 'Navigation'):
+ if yesNo(self, msg, 'Navigation'):
self.startfrom = (self.catalog.results['matches'] - self.maxrecords)
else:
return
@@ -593,12 +603,11 @@
def GetQtype(self): # TODO need to implement
- if self.qtypeRb.GetValue():
+ val=self.qtypeCb.GetValue()
+ if val== 'All':
return None
- elif self.qtypeRb1.GetValue():
- return 'dataset'
else:
- return 'service'
+ return val
def OnSearch(self, evt):
"""execute search"""
@@ -621,7 +630,7 @@
self.maxrecords = self.numResultsSpin.GetValue()
# set timeout
- self.timeout = self.parent.CSWConnectionPanel.timeout
+ self.timeout = self.parent.connectionPanel.timeoutSpin.GetValue()
# bbox
minx = self.bbWest.GetValue() # TODO add grass number validator
@@ -641,6 +650,7 @@
# TODO: allow users to select resources types
# to find ('service', 'dataset', etc.)
# print self.constraints
+
try:
self.catalog.getrecords2(constraints=self.constraints,
maxrecords=self.maxrecords, esn='full')
@@ -752,19 +762,17 @@
self.leftSearchSizer = wx.BoxSizer(wx.VERTICAL)
upSearchSizer = wx.BoxSizer(wx.HORIZONTAL)
- upSearchSizer.Add(self.qtypeRb, 0)
- upSearchSizer.Add(self.qtypeRb1, 0)
- upSearchSizer.Add(self.qtypeRb2, 0)
+ upSearchSizer.Add(self.qtypeCb, 1, wx.EXPAND)
- self.leftSearchSizer.Add(upSearchSizer, 1, )
+
+ self.leftSearchSizer.Add(upSearchSizer, 1 ,wx.EXPAND )
self.rightSearchSizer.Add(wx.StaticText(self), 0)
mainSearchSizer.Add(self.leftSearchSizer, wx.EXPAND)
mainSearchSizer.Add(self.rightSearchSizer)
self.leftSearchSizer.Add(self.keywordLbl, 0)
- self.leftSearchSizer.AddSpacer(7, 0, 1, wx.EXPAND)
- # self.rightSearchSizer.Add(self.advancedFilter, 0)
+ self.rightSearchSizer.AddSpacer(4, 0, 1, wx.EXPAND)
self.rightSearchSizer.Add(self.advanceChck, 0)
self.leftSearchSizer.Add(self.keywordCtr, 0, wx.EXPAND)
@@ -878,17 +886,13 @@
style=HW_DEFAULT_STYLE | HW_SCROLLBAR_AUTO,
name="metadata")
- # self.connectionLBox.Bind(wx.EVT_LISTBOX, self.addDefaultConnections())
self.addDefaultConnections()
self.connectionLBox.Bind(wx.EVT_LISTBOX_DCLICK, self.onServiceInfo)
- # self.connectionLBox.Bind(wx.EVT_LISTBOX, self.OnSetCatalog)
self.newBtt.Bind(wx.EVT_BUTTON, self.onNewconnection)
self.removeBtt.Bind(wx.EVT_BUTTON, self.onRemoveConnection)
self.serviceInfoBtt.Bind(wx.EVT_BUTTON, self.onServiceInfo)
self.textMetadata.Bind(EVT_HTML_LINK_CLICKED, self.onHtmlLinkClicked)
- # self.loadSettings()
- # self.connectionLabel=wx.StaticText(self.panelLeft,label='Catalog service:')
self._layout()
def GetUrl(self):
@@ -972,10 +976,10 @@
GMessage('Please select catalog')
return
name = self.connectionLBox.GetString(self.connectionLBox.GetSelection())
- if YesNo(self, "Do you want to remove < %s > from list " % name, "Remove connection"):
+ if yesNo(self, "Do you want to remove < %s > from list " % name, "Remove connection"):
key = '/connections/%s' % name
self.config.DeleteGroup(key)
- if YesNo(self, "Do you want to remove < %s > from default connection file " % name, "Remove connection"):
+ if yesNo(self, "Do you want to remove < %s > from default connection file " % name, "Remove connection"):
tree = ET.parse(self.connectionFilePath)
root = tree.getroot()
for bad in root.findall('csw'):
@@ -1045,10 +1049,8 @@
metadata = render_template('en', self.context,
self.catalog,
self.servicePath)
-
self.textMetadata.SetPage(metadata)
-
def _get_csw(self):
"""function to init owslib.csw.CatalogueServiceWeb"""
# connect to the server
@@ -1071,7 +1073,7 @@
# print path
if path is not None:
self.connectionFilePath = path
- if YesNo(self, "Do you want to remove temporary connections?", "Remove tmp connections"):
+ if yesNo(self, "Do you want to remove temporary connections?", "Remove tmp connections"):
self.config.DeleteGroup('/connections')
noerr, doc =get_connections_from_file( self.connectionFilePath)
@@ -1101,7 +1103,7 @@
key = '/connections/%s' % name
self.config.Write('%s/url' % key, url)
self.updateConnectionList()
- if YesNo(self, "Do you want to add connection to default configuration file", "Default connection"):
+ if yesNo(self, "Do you want to add connection to default configuration file", "Default connection"):
tree = ET.parse(self.connectionFilePath)
root = tree.getroot()
@@ -1135,32 +1137,14 @@
self.parent.BrowserPanel.loadSettings()
-
- '''
- def OnSetCatalog(self, evt):
- val = evt.GetSelection()
- print val
- print self.config.WriteInt('/guiConn1/catalog', val)
-
- def loadSettings(self):
- n = self.config.ReadInt('/guiConn1/catalog',0)
- print type(n)
- print n
- self.connectionLBox.SetSelection(n)
- '''
-
def onOpenConnFile(self, event):
-
openFileDialog = wx.FileDialog(self, "Open catalog file", "", "",
"XML files (*.xml)|*.xml", wx.FD_OPEN | wx.FD_FILE_MUST_EXIST)
-
if openFileDialog.ShowModal() == wx.ID_CANCEL:
return
-
input_stream = openFileDialog.GetPath()
self.addDefaultConnections(input_stream)
-
def _layout(self):
self.mainsizer = wx.BoxSizer(wx.HORIZONTAL)
@@ -1197,20 +1181,4 @@
class AutoWidthListCtrl(wx.ListCtrl, ListCtrlAutoWidthMixin):
def __init__(self, parent):
wx.ListCtrl.__init__(self, parent, -1, style=wx.LC_REPORT | wx.BORDER_SUNKEN)
- ListCtrlAutoWidthMixin.__init__(self)
-
-
-
-
-
-def YesNo(parent, question, caption='Yes or no?'):
- dlg = wx.MessageDialog(parent, question, caption, wx.YES_NO | wx.ICON_QUESTION)
- result = dlg.ShowModal() == wx.ID_YES
- dlg.Destroy()
- return result
-
-
-
-class CswPublisher():
- def __init__(self):
- CSWConnectionPanel(self)
+ ListCtrlAutoWidthMixin.__init__(self)
\ No newline at end of file
Modified: grass-addons/grass7/gui/wxpython/wx.metadata/mdlib/cswutil.py
===================================================================
--- grass-addons/grass7/gui/wxpython/wx.metadata/mdlib/cswutil.py 2015-08-14 13:55:30 UTC (rev 65930)
+++ grass-addons/grass7/gui/wxpython/wx.metadata/mdlib/cswutil.py 2015-08-14 14:01:58 UTC (rev 65931)
@@ -1,5 +1,15 @@
#!/usr/bin/env python
+"""
+ at module utility for g.gui.cswbrowser
+ at brief GUI csw browser
+
+(C) 2015 by the GRASS Development Team
+This program is free software under the GNU General Public License
+(>=v2). Read the file COPYING that comes with GRASS for details.
+
+ at author Matej Krejci <matejkrejci gmail.com> (GSoC 2015)
+"""
from gettext import gettext, ngettext
import os
import webbrowser
@@ -15,7 +25,7 @@
class StaticContext(object):
def __init__(self):
self.ppath = os.path.dirname(os.path.abspath(__file__))
- self.addonsPath=os.path.join(os.getenv('GRASS_ADDON_BASE') ,'etc','config')
+ self.addonsPath=os.path.join(os.getenv('GRASS_ADDON_BASE'), 'etc','wx.metadata','config')
def get_connections_from_file( filename):
Modified: grass-addons/grass7/gui/wxpython/wx.metadata/mdlib/mdeditorfactory.py
===================================================================
--- grass-addons/grass7/gui/wxpython/wx.metadata/mdlib/mdeditorfactory.py 2015-08-14 13:55:30 UTC (rev 65930)
+++ grass-addons/grass7/gui/wxpython/wx.metadata/mdlib/mdeditorfactory.py 2015-08-14 14:01:58 UTC (rev 65931)
@@ -34,12 +34,12 @@
try:
from owslib.iso import *
except:
- sys.exit('owslib library is missing. Check dependency on the manual page < https://grasswiki.osgeo.org/wiki/ISO/INSPIRE_Metadata_Support >')
+ sys.exit('owslib library is missing. Check requirements on the manual page < https://grasswiki.osgeo.org/wiki/ISO/INSPIRE_Metadata_Support >')
from mdjinjaparser import JinjaTemplateParser
try:
from jinja2 import Environment, FileSystemLoader
except:
- sys.exit('jinja2 library is missing. Check dependency on the manual page < https://grasswiki.osgeo.org/wiki/ISO/INSPIRE_Metadata_Support >')
+ sys.exit('jinja2 library is missing. Check requirements on the manual page < https://grasswiki.osgeo.org/wiki/ISO/INSPIRE_Metadata_Support >')
from core.gcmd import RunCommand, GError, GMessage
@@ -1579,7 +1579,7 @@
self.md = self.mdo.initMD()
# most of objects from OWSLib is initialized in configure file
#dirpath = os.path.dirname(os.path.realpath(__file__))
- path = os.path.join(os.path.join(sys.path[0],'..'), 'config', 'init_md.txt')
+ path = os.path.join(os.path.join(sys.path[0],'..'), 'config','wx.metadata','init_md.txt')
mdInitData = open(path, 'r')
mdExec = mdInitData.read()
Modified: grass-addons/grass7/gui/wxpython/wx.metadata/mdlib/mdgrass.py
===================================================================
--- grass-addons/grass7/gui/wxpython/wx.metadata/mdlib/mdgrass.py 2015-08-14 13:55:30 UTC (rev 65930)
+++ grass-addons/grass7/gui/wxpython/wx.metadata/mdlib/mdgrass.py 2015-08-14 14:01:58 UTC (rev 65931)
@@ -19,11 +19,11 @@
try:
from owslib.iso import *
except:
- sys.exit('owslib library is missing. Check dependency on the manual page < https://grasswiki.osgeo.org/wiki/ISO/INSPIRE_Metadata_Support >')
+ sys.exit('owslib library is missing. Check requirements on the manual page < https://grasswiki.osgeo.org/wiki/ISO/INSPIRE_Metadata_Support >')
try:
from jinja2 import Environment, FileSystemLoader
except:
- sys.exit('jinja2 library is missing. Check dependency on the manual page < https://grasswiki.osgeo.org/wiki/ISO/INSPIRE_Metadata_Support >')
+ sys.exit('jinja2 library is missing. Check requirements on the manual page < https://grasswiki.osgeo.org/wiki/ISO/INSPIRE_Metadata_Support >')
from lxml import etree
Modified: grass-addons/grass7/gui/wxpython/wx.metadata/mdlib/mdpdffactory.py
===================================================================
--- grass-addons/grass7/gui/wxpython/wx.metadata/mdlib/mdpdffactory.py 2015-08-14 13:55:30 UTC (rev 65930)
+++ grass-addons/grass7/gui/wxpython/wx.metadata/mdlib/mdpdffactory.py 2015-08-14 14:01:58 UTC (rev 65931)
@@ -1,7 +1,7 @@
try:
from owslib.iso import *
except:
- sys.exit('owslib library is missing. Check dependency on the manual page < https://grasswiki.osgeo.org/wiki/ISO/INSPIRE_Metadata_Support >')
+ sys.exit('owslib library is missing. Check requirements on the manual page < https://grasswiki.osgeo.org/wiki/ISO/INSPIRE_Metadata_Support >')
from reportlab.platypus import PageBreak
import tempfile, sys, os
import math
Modified: grass-addons/grass7/gui/wxpython/wx.metadata/mdlib/mdutil.py
===================================================================
--- grass-addons/grass7/gui/wxpython/wx.metadata/mdlib/mdutil.py 2015-08-14 13:55:30 UTC (rev 65930)
+++ grass-addons/grass7/gui/wxpython/wx.metadata/mdlib/mdutil.py 2015-08-14 14:01:58 UTC (rev 65931)
@@ -25,7 +25,7 @@
try:
from owslib.iso import *
except:
- sys.exit('owslib library is missing. Check dependency on the manual page < https://grasswiki.osgeo.org/wiki/ISO/INSPIRE_Metadata_Support >')
+ sys.exit('owslib library is missing. Check requirements on the manual page < https://grasswiki.osgeo.org/wiki/ISO/INSPIRE_Metadata_Support >')
from owslib.namespaces import Namespaces
from owslib.etree import etree
@@ -37,6 +37,10 @@
from subprocess import PIPE
import wx
+class StaticContext(object):
+ def __init__(self):
+ self.ppath = os.path.dirname(os.path.abspath(__file__))
+ self.addonsPath=os.path.join(os.getenv('GRASS_ADDON_BASE'),'etc' 'wx.metadata')
def isTableExists(name):
res = Module('db.tables',flags='p',stdout_=PIPE)
Modified: grass-addons/grass7/gui/wxpython/wx.metadata/profiles/Makefile
===================================================================
--- grass-addons/grass7/gui/wxpython/wx.metadata/profiles/Makefile 2015-08-14 13:55:30 UTC (rev 65930)
+++ grass-addons/grass7/gui/wxpython/wx.metadata/profiles/Makefile 2015-08-14 14:01:58 UTC (rev 65931)
@@ -2,5 +2,12 @@
include $(MODULE_TOPDIR)/include/Make/Dir.make
+DSTDIR = $(ETC)/wx.metadata/profiles
+
+$(DSTDIR):
+ $(MKDIR) -p $@
+
default:
- $(INSTALL_DATA) *.xml $(ETC)
\ No newline at end of file
+
+install: $(DSTDIR)
+ $(INSTALL_DATA) *.xml $(DSTDIR)
\ No newline at end of file
More information about the grass-commit
mailing list