[GRASS-SVN] r61614 - in grass-addons/grass7/gui/wxpython/wx.metadata: g.gui.metadata mdlib r.info.iso v.info.iso
svn_grass at osgeo.org
svn_grass at osgeo.org
Thu Aug 14 03:10:06 PDT 2014
Author: neteler
Date: 2014-08-14 03:10:06 -0700 (Thu, 14 Aug 2014)
New Revision: 61614
Modified:
grass-addons/grass7/gui/wxpython/wx.metadata/g.gui.metadata/editor.py
grass-addons/grass7/gui/wxpython/wx.metadata/g.gui.metadata/g.gui.metadata.html
grass-addons/grass7/gui/wxpython/wx.metadata/g.gui.metadata/g.gui.metadata.py
grass-addons/grass7/gui/wxpython/wx.metadata/mdlib/jinjainfo.py
grass-addons/grass7/gui/wxpython/wx.metadata/mdlib/mdgrass.py
grass-addons/grass7/gui/wxpython/wx.metadata/mdlib/mdutil.py
grass-addons/grass7/gui/wxpython/wx.metadata/r.info.iso/r.info.iso.html
grass-addons/grass7/gui/wxpython/wx.metadata/r.info.iso/r.info.iso.py
grass-addons/grass7/gui/wxpython/wx.metadata/v.info.iso/v.info.iso.html
grass-addons/grass7/gui/wxpython/wx.metadata/v.info.iso/v.info.iso.py
Log:
wx.metadata: fix typos; potential bug in mdlib/mdgrass.py, line 202
Modified: grass-addons/grass7/gui/wxpython/wx.metadata/g.gui.metadata/editor.py
===================================================================
--- grass-addons/grass7/gui/wxpython/wx.metadata/g.gui.metadata/editor.py 2014-08-14 03:51:17 UTC (rev 61613)
+++ grass-addons/grass7/gui/wxpython/wx.metadata/g.gui.metadata/editor.py 2014-08-14 10:10:06 UTC (rev 61614)
@@ -46,7 +46,7 @@
class MdFileWork():
- ''' initializer of metadata in OWSLib and export OWSLib object to xml by jinja templating system
+ ''' initializer of metadata in OWSLib and export OWSLib object to xml by jinja template system
'''
def __init__(self, pathToXml=None):
@@ -86,7 +86,7 @@
'''
@note creator of xml with using OWSLib md object and jinja template
@param md: owslib.iso.MD_Metadata
- @param owsTagList: in case if user definig template
+ @param owsTagList: in case if user is defining template
@param jinjaPath: path to jinja template
@param outPath: path of exported xml
@param xmlOutName: name of exported xml
@@ -120,7 +120,7 @@
io.write(str1)
io.close()
- # generating xml using jinja tempaltes
+ # generating xml using jinja templates
head, tail = os.path.split(jinjaPath)
env = Environment(loader=FileSystemLoader(head))
env.globals.update(zip=zip)
@@ -172,9 +172,9 @@
@param multi: true in case when box has button for duplicating box and included items
@param rmMulti: true in case when box has button for removing box and included items
@param isFirstNum: handling with 'add' and 'remove' button of box.
- this param is necessary for generating editor in editor::MdEditor.generateGUI.inBlock()
- note: just firs generated box has 'add' buton (because is mandatory) and nex others has
- 'remove butt'
+ this param is necessary for generating editor in editor::MdEditor.generateGUI.inBlock()
+ note: just first generated box has 'add' button (because being mandatory) and next others has
+ 'remove' button
'''
if isFirstNum != 1:
multi = False
@@ -256,10 +256,10 @@
def __init__(self, mdItems, parent, boxlabel=None, mdItemOld=None, template=None):
'''
@param mdItems: list of editor::MdItem
- @param parent: parent of new duplicated box
+ @param parent: parent of new duplicated box
@param boxlabel: label of static box
@param mdItemOld: object which will be duplicated
- @param template: in case if 'template mode' is on in editor
+ @param template: in case if 'template mode' is on in editor
'''
# duplicate box of items
if boxlabel:
@@ -304,14 +304,14 @@
mdItems.addMdItem(self.mdItem)
except:
mdItems.addMdItem(self.mdItem)
+
#=========================================================================
# METADATA ITEM (label+ctrlText+button(optional)+chckbox(template)
#=========================================================================
-
class MdItem(wx.BoxSizer):
- '''main building blocks of generated gui of editor
+ '''main building blocks of generated GUI of editor
'''
def __init__(self, parent, item, multiplicity=None, rmMulti=False, isFirstNum=-1, chckBox=False):
@@ -320,10 +320,10 @@
@param multiplicity: if true- widget has button for duplicate self
@param rmMulti: if true- widget has button for remove self
@param isFirstNum: handling with 'add' and 'remove' button of box.
- this param is necessary for generating editor in editor::MdEditor.generateGUI.inBlock()
- note: just firs generated box has 'add' buton (because is mandatory) and nex others has
- 'remove butt'
- @param chckBox: in case-True 'template editor' is on and widget has checkobox.
+ this param is necessary for generating editor in editor::MdEditor.generateGUI.inBlock()
+ note: just first generated box has 'add' button (because being mandatory) and next others has
+ 'remove' button
+ @param chckBox: in case-True 'template editor' is on and widget has checkbox
'''
wx.BoxSizer.__init__(self, wx.VERTICAL)
self.isValid = False
@@ -504,7 +504,7 @@
yellow: in case if value is marked by $NULL(by mdgrass::GrassMD)
red: if value is '' or object is not initialized. e.g. if user
read non fully valid INSPIRE xml with INSPIRE jinja template,
- the gui generating mechanism will create GUI according to template
+ the GUI generating mechanism will create GUI according to template
and all missing tags(xml)-gui(TextCtrls) will be marked by red
'''
if value is None or value is '':
@@ -576,7 +576,6 @@
# ADD NOTEBOOK PAGE
#=========================================================================
-
class MdNotebookPage(scrolled.ScrolledPanel):
"""
@@ -621,7 +620,7 @@
self.mainSizer.Add(item, proportion=0, flag=wx.EXPAND)
def addDuplicatedItem(self, item, mId):
- '''adding duplicated object to sizer to position after parent
+ '''adding duplicated object to sizer to position after parent
'''
self.items.append(item)
posIndex = self.sizerIndexDict[mId]
@@ -652,13 +651,13 @@
'''
main functions : self.generateGUI(): generating GUI from: editor:MdItem,MdBox,MdNotebookPage
- self.createNewMD(): filling OWSLib.iso.MD_Metadata by values from generated gui
+ self.createNewMD(): filling OWSLib.iso.MD_Metadata by values from generated GUI
self.defineTemplate(): creator of predefined templates in template editor mode
'''
def __init__(self, parent, templatePath, xmlMdPath, templateEditor=False):
'''
- @param templatePath: path to jinja template for generating gui of editor
+ @param templatePath: path to jinja template for generating GUI of editor
@param xmlMdPath: path of xml for init Editor
@param templateEditor: mode-creator of template
'''
@@ -694,11 +693,11 @@
num = 1
self.c += num
if self.c >= self.max:
- self.c -= 1 # ensure to'list out of bounds'
+ self.c -= 1 # ensure to 'list out of bounds'
self.stop = True
def minusC(self, num=None):
- '''iterator for handling jinja teplate items in self.generateGUI and self.createNewMD
+ '''iterator for handling jinja template items in self.generateGUI and self.createNewMD
'''
if num is None:
num = 1
@@ -710,7 +709,7 @@
'''
@var tagStringLst: tagStringLst is self.mdOWSTagStr in list.
Item=line from jinja template(only lines with owslib objects and loops)
- @var mdDescrObj: list of MdDescription() objects inicialized\
+ @var mdDescrObj: list of MdDescription() objects initialized\
by information from jinja t.
@var self.c: index of var: tagStringLst and var: self.mdDescription
@var markgroup: markers of created list in GUI notebook
@@ -720,7 +719,7 @@
HINT: print param stri in self.executeStr()
'''
def prepareStatements():
- '''in jinja template are difining some py-function specificaly:
+ '''in jinja template are defining some py-function specifically:
e.g. |length=len
also statements with pythonic 'zip' must be prepare specifically for generator of GUI
'''
@@ -806,7 +805,7 @@
str1 += '\t' + \
'it=MdItem(parent=self.nbPage,item=mdDescrObj[' + str(self.c) + '],isFirstNum=numOfSameBox,chckBox=self.templateEditor)\n'
- if self.isValidS: # if metatdata are loaded to owslib
+ if self.isValidS: # if metadata are loaded to owslib
if IFStatements:
str1 += '\t' + 'it.setValue(self.' + str(value) + ')\n'
else:
@@ -876,7 +875,7 @@
#--------------------------------------------------------------------- INIT VARS
self.notebook = wx.Notebook(self)
- markgroup = [] # notebok panel marker
+ markgroup = [] # notebook panel marker
tagStringLst = self.mdOWSTagStrList
mdDescrObj = self.mdDescription # from jinja
self.c = 0
@@ -884,8 +883,8 @@
self.max = len(mdDescrObj)
prepareStatements()
self.notebokDict = {}
-# --------------------------------------------- #START of the loop of genereator
- while self.stop is False: # self.stop is managed by def plusC(self):
+# --------------------------------------------- #START of the loop of generator
+ while self.stop is False: # self.stop is managed by def plusC(self):
group = mdDescrObj[self.c].group
if group not in markgroup: # if group is not created
@@ -899,7 +898,7 @@
# if statements started
if '\t' in tagStringLst[self.c] and self.stop is False:
inBlock()
- # if is just singe item without statements
+ # if is just single item without statements
elif 'for' not in str(tagStringLst[self.c]).split() and 'if' not in str(tagStringLst[self.c]).split():
it = MdItem(parent=self.nbPage, item=mdDescrObj[self.c], chckBox=self.templateEditor)
value = 'self.' + str(self.mdOWSTagStrList[self.c]).replace('\n', '')
@@ -917,7 +916,7 @@
self.refreshChkboxes()
def refreshChkboxes(self):
- '''In case if template editor is on, after generateing gui si
+ '''In case if template editor is on, after generating GUI it is
obligatory to refresh checkboxes
'''
for item in self.mdDescription:
@@ -931,9 +930,9 @@
def defineTemplate(self):
'''Main function for generating jinja template in mode "template editor"
- Every widget MdItem are represented by 'jinja tag'. Not checked widget= tag in jinja template will be replaced by
- listo of string with string of replaced tag. In rendering template this produce holding(non removing) jinja-tag from template.
- In case if widget is checked= rendering will replace OWSLib obect by filled values( like in normal editing mode)
+ Every widget MdItem is represented by 'jinja tag'. Not checked widget= tag in jinja template will be replaced by
+ list of string with string of replaced tag. In rendering template this produces holding(non removing) jinja-tag from template.
+ In case if widget is checked= rendering will replace OWSLib object by filled values( like in normal editing mode)
@var finalTemplate: string included final jinja template
'''
try:
@@ -1039,7 +1038,7 @@
exec stri
def createNewMD(self, evt=None):
- '''Main function for exporting metadata from filled widgets .
+ '''Main function for exporting metadata from filled widgets.
Initializing owslib object by metadata from gui(export of metadata)
'''
def prepareStatements():
@@ -1071,7 +1070,7 @@
return False
def chckIf2xStatements():
- '''Return true if next two items in jinjainfo::MdDescription are reprsenting statements
+ '''Return true if next two items in jinjainfo::MdDescription are representing statements
'''
if 'if'in mdDes[self.c].tag.split() or 'for' in mdDes[self.c].tag.split():
try:
@@ -1137,7 +1136,7 @@
self.minusC(numOfItems)
self.plusC(numOfItems)
- # (2.2)no init and py ZIP'
+ # (2.2) no init and py ZIP'
elif 'for' in mdDes[cTmp].tag.split() and mdDes[cTmp].object is None and ' zip(' in mdDes[cTmp].tag:
leng = len(mdDes[self.c].mdItem)
tag1 = mdutil.findBetween(mdDes[cTmp].tag, 'zip(', ')').split(',')
@@ -1170,7 +1169,7 @@
self.minusC(numOfItems)
self.plusC(numOfItems)
- # (1)'no init IF'
+ # (1) 'no init IF'
elif 'if' in mdDes[cTmp].tag.split():
objStr = mdDes[cTmp].tag.replace(' md.', ' self.md.') + ':\n'
@@ -1262,7 +1261,7 @@
self.plusC(numOfItems)
# (2) only keywords (dict)
elif 'for' in tag and 'for' in tag1: #
- self.plusC() # skip staementes 2x
+ self.plusC() # skip statementes 2x
self.plusC()
numOfkwGroup = len(mdDes[self.c + 1].mdItem)
for n in range(numOfkwGroup):
@@ -1289,7 +1288,7 @@
#------------------------------------------------------------------------------ next function
self.mdo = MdFileWork()
self.md = self.mdo.initMD()
- # most of object from OWSLib is initialized in configure file
+ # most of objects from OWSLib is initialized in configure file
dirpath = os.path.dirname(os.path.realpath(__file__))
path = os.path.join(dirpath, 'config', 'init_md')
mdInitData = open(path, 'r')
Modified: grass-addons/grass7/gui/wxpython/wx.metadata/g.gui.metadata/g.gui.metadata.html
===================================================================
--- grass-addons/grass7/gui/wxpython/wx.metadata/g.gui.metadata/g.gui.metadata.html 2014-08-14 03:51:17 UTC (rev 61613)
+++ grass-addons/grass7/gui/wxpython/wx.metadata/g.gui.metadata/g.gui.metadata.html 2014-08-14 10:10:06 UTC (rev 61614)
@@ -1,5 +1,9 @@
<h2>DESCRIPTION</h2>
-Metadata editor according to EN ISO 19115 and EN ISO 19119
+
+Metadata editor according to EN ISO 19115 and EN ISO 19119.
+
<h2>AUTHOR</h2>
Matej Krejci, Czech Technical University in Prague, Czech Republic
+
+<p><i>Last changed: $Date$</i>
Modified: grass-addons/grass7/gui/wxpython/wx.metadata/g.gui.metadata/g.gui.metadata.py
===================================================================
--- grass-addons/grass7/gui/wxpython/wx.metadata/g.gui.metadata/g.gui.metadata.py 2014-08-14 03:51:17 UTC (rev 61613)
+++ grass-addons/grass7/gui/wxpython/wx.metadata/g.gui.metadata/g.gui.metadata.py 2014-08-14 10:10:06 UTC (rev 61614)
@@ -117,7 +117,7 @@
'''
md = self.editor.createNewMD()
self.mdCreator.updateGrassMd(md)
- GMessage('Grass metadata has been updated')
+ GMessage('GRASS GIS metadata haved been updated')
def onChangeEditMapProfile(self):
'''Update vars
@@ -191,7 +191,7 @@
self.SetSize((x + x1, y + y1))
def onHideLeftPanel(self):
- '''in editing mode is config panel hidden
+ '''In editing mode config panel is hidden
'''
self.toolbar.bttNew.Enable()
self.Hsizer.Remove(self.leftPanel)
@@ -216,10 +216,10 @@
self.MdDataCatalogPanelLeft.UnselectAll()
def onEditMapMetadata(self, multipleEditing=False):
- '''Initialize editor by selection of grass map in data catalog
- @param multipleEditing: if user select more than one map mutlipleEditing=True
- @param numOfMap: hold information about number of selected maps for editing
- @param ListOfMapTypeDict: list of dict sttored names of selected maps in dict. dict['cell/vector']=nameofmaps
+ '''Initialize editor by selection of GRASS map in data catalog
+ @param multipleEditing: if user selects more than one map mutlipleEditing=True
+ @param numOfMap: holds information about number of selected maps for editing
+ @param ListOfMapTypeDict: list of dict stored names of selected maps in dict. dict['cell/vector']=nameofmaps
'''
if not multipleEditing:
self.ListOfMapTypeDict = self.MdDataCatalogPanelLeft.ListOfMapTypeDict
@@ -335,7 +335,7 @@
@var first: True= First initialize main frame
@var firstAfterChoice: True=Init editor editor after set configuration and click onEdit in toolbar
@var second: init editor after first initialize
- @var secondAfterChoice: init edito onemore time
+ @var secondAfterChoice: init editor one more time
'''
if self.first:
self.first = False
@@ -454,7 +454,7 @@
self.mapType = None
def InitTreeItems(self):
- """Add locations and layers to the tree."""
+ """Add locations and layers to the tree"""
gisenv = grass.gisenv()
location = gisenv['LOCATION_NAME']
self.mapset = gisenv['MAPSET']
@@ -491,7 +491,7 @@
else:
self.Unselect()
- GMessage('Please select map.')
+ GMessage('Please select map')
if len(maps) == 0:
pub.sendMessage('bttEdit.disable')
@@ -617,7 +617,7 @@
class TreeBrowser(wx.TreeCtrl):
'''Filling text tree by xml file.
- @note: to enable editing mode of init xml uncoment blocks below
+ @note: to enable editing mode of init xml uncomment blocks below
'''
def __init__(self, parent, xmlPath=False, xmlEtree=False):
@@ -697,7 +697,7 @@
class MdValidator(wx.Panel):
- '''wx panel of notebook which support validating two natively implemented profiles
+ '''wx panel of notebook which supports validating two natively implemented profiles
'''
def __init__(self, parent):
@@ -714,7 +714,7 @@
self.mainSizer.Add(self.text, proportion=1, flag=wx.EXPAND)
def validate(self, md, profile):
- '''For externaly load xml file is by default inspire validator
+ '''For externally loaded xml file is by default inspire validator
'''
if profile == 'INSPIRE' or profile == 'Load Custom':
result = mdutil.isnpireValidator(md)
@@ -976,7 +976,7 @@
pub.sendMessage('MD_DESTINATION.update', value=self.mdDestination)
dlg.Destroy()
- GMessage('Metadata destinatnion: %s' % self.mdDestination)
+ GMessage('Metadata destination: %s' % self.mdDestination)
def hideMultipleEdit(self):
'''Multiple editor is off
@@ -1040,7 +1040,7 @@
def onNewSession(self, evt):
pub.sendMessage('INIT_EDITOR.create')
pub.sendMessage('TEMPLATE_EDITOR_STATUS.update', value=False, template=False)
- # chck current editing mode(grass or external xml editor)
+ # check current editing mode(grass or external xml editor)
if self.GetParent().configPanelLeft.rbGrass is False:
self.bttLoad.Enable()
self.bttLoadXml.Enable()
@@ -1055,7 +1055,7 @@
self.bttSaveTemplate.Disable()
def onChangeXmlorTemplate(self, evt=None):
- '''in case if path of template and xml path are initialized-> enable buttons for next step
+ '''in case if path of template and xml path are initialized -> enable buttons for next step
'''
if self.jinjaPath is not None and self.xmlPath is not None:
pub.sendMessage('HIDE_LEFT_PANEL.update')
@@ -1067,7 +1067,7 @@
def onLoadXml(self, evt=None):
dlg = wx.FileDialog(self,
- "Select xml metadata file",
+ "Select XML metadata file",
self.mdDestination,
"",
"*.xml",
@@ -1136,7 +1136,7 @@
pub.sendMessage('EDIT_MAP_METADATA.create', multipleEditing=True)
else:
- GMessage('File not save.')
+ GMessage('File not saved')
dlg.Destroy()
else:
Modified: grass-addons/grass7/gui/wxpython/wx.metadata/mdlib/jinjainfo.py
===================================================================
--- grass-addons/grass7/gui/wxpython/wx.metadata/mdlib/jinjainfo.py 2014-08-14 03:51:17 UTC (rev 61613)
+++ grass-addons/grass7/gui/wxpython/wx.metadata/mdlib/jinjainfo.py 2014-08-14 10:10:06 UTC (rev 61614)
@@ -3,7 +3,7 @@
"""
@package jinjainfo
@module g.gui.metadata
- at brief Library for parsing informations from jinja template
+ at brief Library for parsing information from jinja template
Classes:
- jinjainfo::MdDescription
@@ -29,26 +29,26 @@
group=None, inbox=None, multiline=None, validator=None,
num=None, ref=None, selfInfoString=None):
'''
- @param tag: OWSLib object which will be replaced by value of object after jinja template system render new file
- @param object: some object in OWSLib is neecesarry to initialize temporaly in gui generator. Others are initialize by configure file
+ @param tag: OWSLib object which will be replaced by value of object after jinja template system renders new file
+ @param object: some objects in OWSLib need to be initialized temporally in gui generator. Others are initialized by configure file
@param name: label and tooltip name
@param desc: description/definition of metadata item
@param example: example of md item (tooltip)
- @param type: data type is neccesary to validet widgets
- @param multi: 0=only one instance of editor::MdItem widget can be, 1= multiple insctances of widgets can be
+ @param type: data type, necessary to validate widgets
+ @param multi: 0=only one instance of editor::MdItem widget can be, 1= multiple instances of widgets can be
@param inboxmulti: 0=static box of items has not button for duplicating self 1=has button
- @param group: this param initialize page in notebook in mani editor
- @param inbox: Every items in block of code in jinja template must have same value of inbox.
+ @param group: this param initializes page in notebook in mani editor
+ @param inbox: Every item in block of code in jinja template must have same value of inbox.
The value of inbox representing label of static box in gui.
- @param multiline: If true- textCtrl widget will be init with multiline control
- @param validator: Not use currently
+ @param multiline: If true- textCtrl widget will be initalized with multiline control
+ @param validator: Currently not used
@param ref: additional information about reference of metadata item (ISO reference)
- @param selfInfoString: string value representing all these information. (parsed from jinja template)
- @var mdItem: very important parametr which holds instances of widgets(editor::MdItem)
+ @param selfInfoString: string value representing all these information (parsed from jinja template)
+ @var mdItem: very important parameter which holds instances of widgets(editor::MdItem)
on every index of list is one instance of widget. In case, if is in static box MdItem with duplicating button:
index of list is represented by list of these items
@var statements: hold information about first statement in block
- @var statements1: hold info about secont stetement in block of var: statement
+ @var statements1: hold info about second statement in block of var: statement
'''
self.tag = tag
self.object = object
@@ -75,7 +75,7 @@
'''care about integrity of var: self.mdItem
'''
# if new mditem is from box- need to hold information
- # about it.(list on the same index in self.mdItem)
+ # about it (list on the same index in self.mdItem)
if oldMdItem is not None:
for n, item in enumerate(self.mdItem):
for i in item:
@@ -113,8 +113,8 @@
'''
@var mdDescription: list of jinjainfo::mdDescription
@var mdOWSTag: list of tags in jinja templates
- @var mdOWSTagStr: string representing OWSLib tags from template(per line)
- @var mdOWSTagStrList: on each index of list is one line with parsed OWSLib tag
+ @var mdOWSTagStr: string representing OWSLib tags from template (per line)
+ @var mdOWSTagStrList: on each index of list is one line with parsed OWSLib tag
'''
self.mdDescription = []
self.mdOWSTag = []
@@ -172,7 +172,7 @@
# print "I/O error({0}): {1}".format(e.errno, e.strerror)
def _formatMdOWSTagStrToPythonBlocks(self):
- '''Formating of parsed tags to pythonic blocks
+ '''Formatting of parsed tags to pythonic blocks
'''
self.mdOWSTagStr = ""
tab = 0
Modified: grass-addons/grass7/gui/wxpython/wx.metadata/mdlib/mdgrass.py
===================================================================
--- grass-addons/grass7/gui/wxpython/wx.metadata/mdlib/mdgrass.py 2014-08-14 03:51:17 UTC (rev 61613)
+++ grass-addons/grass7/gui/wxpython/wx.metadata/mdlib/mdgrass.py 2014-08-14 10:10:06 UTC (rev 61614)
@@ -44,7 +44,7 @@
'''
@var self.map: name of choosen map by user
@var self.type: typ of map representation(cell, vector, r3)
- @var md_grass: dict with metadata from r.info v.info except "r.info flag=h"
+ @var md_grass: dict with metadata from r.info v.info except for "r.info flag=h"
'''
@@ -57,7 +57,7 @@
self.md_abstract = ''
self.md_vinfo_h = '' # v.info flag=h" - parse
self.gisenv_grass = grass.gisenv() # dict with gisenv information
- # postfix of output xml file (variables)
+ # suffix of output xml file (variables)
self.schema_type = '_basic.xml' # currently
self.dirpath = os.path.dirname(os.path.realpath(__file__))
# metadata object from OWSLIB ( for define md values)
@@ -73,10 +73,10 @@
self.parseRast3D()
def isMapExist(self):
- '''Check if is the map in working mapset'''
+ '''Check if the map is in current mapset'''
self.mapset = grass.find_file(self.map, self.type)['mapset']
if not self.mapset:
- grass.fatal(_("Map <%s> doesn't exist") % self.map)
+ grass.fatal(_("Map <%s> does not exist in current mapset") % self.map)
def parseRast3D(self):
pass
@@ -96,7 +96,7 @@
self.md_grass = parse_key_val(vinfo.outputs.stdout)
- # parse md from v.info flag h (history of map in grass)
+ # parse md from v.info flag=h (history of map in grass)
rinfo_h = Module(
'v.info',
self.map,
@@ -113,13 +113,13 @@
line = buf.readline().splitlines()
buf.close()
- # convert grass parsed date format to iso format
+ # convert GRASS parsed date format to iso format
# if date format is diverse from standard, use them
self._createISODate('source_date')
def _createISODate(self, key):
- '''Function for converting grass-generated date to iso format
- if the format of date is different to grass-generated format - use them and print warning
+ '''Function for converting GRASS-generated date to ISO format
+ if the format of date is different from GRASS-generated format - use it and print warning
'''
try:
date = datetime.strptime(self.md_grass[key], '%a %b %d %H:%M:%S %Y')
@@ -141,7 +141,7 @@
self.md_grass = parse_key_val(rinfo.outputs.stdout)
- # convert date to iso format
+ # convert date to ISO format
self._createISODate('date')
# create abstract
@@ -199,6 +199,7 @@
self.md.identification.uricodespace.append(n)
# Geographic/BB
+ # TODO BUG?: minx=n/s and miny=w/e ?? reverted?
self.md.identification.extent.boundingBox.minx = mdutil.replaceXMLReservedChar(self.md_grass['south'])
self.md.identification.extent.boundingBox.maxx = mdutil.replaceXMLReservedChar(self.md_grass['north'])
self.md.identification.extent.boundingBox.miny = mdutil.replaceXMLReservedChar(self.md_grass['west'])
@@ -206,7 +207,7 @@
# Conformity/Title
self.md.dataquality.conformancetitle.append(
- 'GRASS basic metadata profile based on ISO 19115, 19139')
+ 'GRASS GIS basic metadata profile based on ISO 19115, 19139')
# Conformity/Date:
self.md.dataquality.conformancedate.append(mdutil.replaceXMLReservedChar(date.today().isoformat()))
@@ -245,7 +246,7 @@
if self.type == 'vector':
# Identification/Resource Abstract
- # TODO not enough sources for crate abstarce
+ # TODO not enough sources for create abstarce
self.md.identification.abstract = mdutil.replaceXMLReservedChar(self.md_grass['name'])
self.md.dataquality.lineage = mdutil.replaceXMLReservedChar(self.md_vinfo_h).replace('\n', '\\n')
@@ -332,7 +333,7 @@
def saveXML(self, path=None, xml_out_name=None, wxparent=None, overwrite=False):
''' Save init. record of OWSLib objects to ISO XML file'''
- # if output file name is None, use map name and add postfix
+ # if output file name is None, use map name and add suffix
if xml_out_name is None:
xml_out_name = self.type + '_' + str(self.map).partition('@')[0] # + self.schema_type
if not xml_out_name.lower().endswith('.xml'):
@@ -344,7 +345,7 @@
print os.makedirs(path)
path = os.path.join(path, xml_out_name)
- # generate xml using jinja tempaltes
+ # generate xml using jinja templates
env = Environment(loader=FileSystemLoader(self.dirpath))
env.globals.update(zip=zip)
template = env.get_template(self.template)
@@ -353,7 +354,7 @@
# write xml to flat file
if wxparent != None:
if os.path.isfile(path):
- if mdutil.yesNo(wxparent, 'Metadata file is exist. Do you want to overwrite file: %s?' % path, 'Overwrite dialog'):
+ if mdutil.yesNo(wxparent, 'Metadata file exists. Do you want to overwrite file: %s?' % path, 'Overwrite dialog'):
try:
xml_file = open(path, "w")
xml_file.write(iso_xml)
@@ -362,7 +363,7 @@
%s' % (str(path)))
except IOError as e:
print "I/O error({0}): {1}".format(e.errno, e.strerror)
- grass.fatal('error: cannot write xml to file')
+ grass.fatal('ERROR: cannot write xml to file')
return path
else:
try:
@@ -373,12 +374,12 @@
%s' % (str(path)))
except IOError as e:
print "I/O error({0}): {1}".format(e.errno, e.strerror)
- grass.fatal('error: cannot write xml to file')
+ grass.fatal('ERROR: cannot write xml to file')
# sys.exit()
return path
else:
if os.path.isfile(path):
- Module('g.message', message='Metadata file is exist: %s' % path)
+ Module('g.message', message='Metadata file exists: %s' % path)
if overwrite:
try:
xml_file = open(path, "w")
@@ -391,6 +392,7 @@
# sys.exit()
return path
else:
+ # TODO --o??
Module('g.message', message='For overwriting use flag -o')
return False
@@ -402,7 +404,7 @@
def updateGrassMd(self, md):
'''
- Update some parameters in r/v.support. This part need revision#TODO
+ Update some parameters in r/v.support. This part need revision #TODO
'''
if self.type == "vector":
Modified: grass-addons/grass7/gui/wxpython/wx.metadata/mdlib/mdutil.py
===================================================================
--- grass-addons/grass7/gui/wxpython/wx.metadata/mdlib/mdutil.py 2014-08-14 03:51:17 UTC (rev 61613)
+++ grass-addons/grass7/gui/wxpython/wx.metadata/mdlib/mdutil.py 2014-08-14 10:10:06 UTC (rev 61614)
@@ -28,7 +28,7 @@
def removeNonAscii(s):
- '''Removed non ascii char
+ '''Removed non ASCII chars
'''
s = filter(lambda x: x in string.printable, s)
return s
@@ -68,7 +68,7 @@
def grassProfileValidator(md):
- '''function for validation GRASS BASIC XML-OWSLib file-object'''
+ '''function for validation of GRASS BASIC XML-OWSLib file-object'''
result = {}
result["status"] = "succeded"
@@ -77,35 +77,35 @@
errors = 0
if md.identification is None:
- result["errors"].append("gmd:CI_ResponsibleParty: Organization missing")
- result["errors"].append("gmd:CI_ResponsibleParty: E-mail missing")
- result["errors"].append("gmd:CI_ResponsibleParty: Role missing")
+ result["errors"].append("gmd:CI_ResponsibleParty: Organization name is missing")
+ result["errors"].append("gmd:CI_ResponsibleParty: E-mail is missing")
+ result["errors"].append("gmd:CI_ResponsibleParty: Role is missing")
result["errors"].append("gmd:md_DataIdentification: Title is missing")
result["errors"].append("gmd:md_DataIdentification: Abstract is missing")
- result["errors"].append("gmd:md_ScopeCode: Resource Type is missing")
+ result["errors"].append("gmd:md_ScopeCode: Resource type is missing")
result["errors"].append("gmd:RS_Identifier: Unique Resource Identifier is missing")
- result["errors"].append("gmd:EX_Extent: extent element is missing")
- result["errors"].append("gmd:EX_GeographicBoundingBox: bbox is missing")
+ result["errors"].append("gmd:EX_Extent: Extent element is missing")
+ result["errors"].append("gmd:EX_GeographicBoundingBox: Bounding box is missing")
result["errors"].append("Both gmd:EX_TemporalExtent and gmd:CI_Date are missing")
result["errors"].append("gmd:useLimitation is missing")
errors += 20
else:
if len(md.identification.contact) < 1 or md.identification.contact is None:
- result["errors"].append("gmd:CI_ResponsibleParty: Organization missing")
- result["errors"].append("gmd:CI_ResponsibleParty: E-mail missing")
- result["errors"].append("gmd:CI_ResponsibleParty: Role missing")
+ result["errors"].append("gmd:CI_ResponsibleParty: Organization name is missing")
+ result["errors"].append("gmd:CI_ResponsibleParty: E-mail is missing")
+ result["errors"].append("gmd:CI_ResponsibleParty: Role is missing")
errors += 3
else:
if md.identification.contact[0].organization is (None or ''):
- result["errors"].append("gmd:CI_ResponsibleParty: Organization missing")
+ result["errors"].append("gmd:CI_ResponsibleParty: Organization name is missing")
errors += 1
if md.identification.contact[0].email is (None or ''):
- result["errors"].append("gmd:CI_ResponsibleParty: E-mail missing")
+ result["errors"].append("gmd:CI_ResponsibleParty: E-mail is missing")
errors += 1
if md.identification.contact[0].role is (None or ''):
- result["errors"].append("gmd:CI_ResponsibleParty: Role missing")
+ result["errors"].append("gmd:CI_ResponsibleParty: Role is missing")
errors += 1
if md.identification.title is (None or ''):
@@ -115,15 +115,15 @@
result["errors"].append("gmd:md_DataIdentification: Abstract is missing")
errors += 1
if md.identification.identtype is '':
- result["errors"].append("gmd:md_ScopeCode: Resource Type is missing")
+ result["errors"].append("gmd:md_ScopeCode: Resource type is missing")
errors += 1
if md.identification.extent is None:
- result["errors"].append("gmd:EX_Extent: extent element is missing")
+ result["errors"].append("gmd:EX_Extent: Extent element is missing")
errors += 4
else:
if md.identification.extent.boundingBox is None:
- result["errors"].append("gmd:EX_GeographicBoundingBox: bbox is missing")
+ result["errors"].append("gmd:EX_GeographicBoundingBox: Bounding box is missing")
errors += 4
else:
if md.identification.extent.boundingBox.minx is (None or ''):
@@ -154,8 +154,8 @@
if md.contact is None:
result["errors"].append("gmd:contact: Organization name is missing")
- result["errors"].append("gmd:contact: e-mail is missing")
- result["errors"].append("gmd:role: role is missing")
+ result["errors"].append("gmd:contact: E-mail is missing")
+ result["errors"].append("gmd:role: Role is missing")
errors += 3
else:
if md.contact[0].organization is (None or ''):
@@ -163,11 +163,11 @@
errors += 1
if md.contact[0].email is (None or ''):
- result["errors"].append("gmd:contact: e-mail is missing")
+ result["errors"].append("gmd:contact: E-mail is missing")
errors += 1
if md.contact[0].role is (None or ''):
- result["errors"].append("gmd:role: role is missing")
+ result["errors"].append("gmd:role: Role is missing")
errors += 1
if errors > 0:
@@ -186,21 +186,21 @@
errors = 0
if md.identification is None:
- result["errors"].append("gmd:CI_ResponsibleParty: Organization missing")
- result["errors"].append("gmd:CI_ResponsibleParty: E-mail missing")
- result["errors"].append("gmd:CI_ResponsibleParty: Role missing")
+ result["errors"].append("gmd:CI_ResponsibleParty: Organization name is missing")
+ result["errors"].append("gmd:CI_ResponsibleParty: E-mail is missing")
+ result["errors"].append("gmd:CI_ResponsibleParty: Role is missing")
result["errors"].append("gmd:md_DataIdentification: Title is missing")
result["errors"].append("gmd:md_DataIdentification: Abstract is missing")
- result["errors"].append("gmd:md_ScopeCode: Resource Type is missing")
- result["errors"].append("gmd:language: Resource Language is missing")
+ result["errors"].append("gmd:md_ScopeCode: Resource type is missing")
+ result["errors"].append("gmd:language: Resource language is missing")
result["errors"].append("gmd:RS_Identifier: Unique Resource Identifier is missing")
result["errors"].append("gmd:topicCategory: TopicCategory is missing")
result["errors"].append("gmd:md_Keywords: Keywords are missing")
- result["errors"].append("gmd:thesaurusName: Thesaurus Title is missing")
- result["errors"].append("gmd:thesaurusName: Thesaurus Date is missing")
- result["errors"].append("gmd:thesaurusName: Thesaurus Date Type is missing")
- result["errors"].append("gmd:EX_Extent: extent element is missing")
- result["errors"].append("gmd:EX_GeographicBoundingBox: bbox is missing")
+ result["errors"].append("gmd:thesaurusName: Thesaurus title is missing")
+ result["errors"].append("gmd:thesaurusName: Thesaurus date is missing")
+ result["errors"].append("gmd:thesaurusName: Thesaurus date type is missing")
+ result["errors"].append("gmd:EX_Extent: Extent element is missing")
+ result["errors"].append("gmd:EX_GeographicBoundingBox: Bounding box is missing")
result["errors"].append("Both gmd:EX_TemporalExtent and gmd:CI_Date are missing")
result["errors"].append("gmd:useLimitation is missing")
result["errors"].append("gmd:accessConstraints is missing")
@@ -208,22 +208,22 @@
errors += 20
else:
if md.identification.contact is None or len(md.identification.contact) < 1:
- result["errors"].append("gmd:CI_ResponsibleParty: Organization missing")
- result["errors"].append("gmd:CI_ResponsibleParty: E-mail missing")
- result["errors"].append("gmd:CI_ResponsibleParty: Role missing")
+ result["errors"].append("gmd:CI_ResponsibleParty: Organization name is missing")
+ result["errors"].append("gmd:CI_ResponsibleParty: E-mail is missing")
+ result["errors"].append("gmd:CI_ResponsibleParty: Role is missing")
errors += 3
else:
if md.identification.contact[0].organization is (None or ''):
- result["errors"].append("gmd:CI_ResponsibleParty: Organization missing")
+ result["errors"].append("gmd:CI_ResponsibleParty: Organization name is missing")
errors += 1
if md.identification.contact[0].email is (None or ''):
- result["errors"].append("gmd:CI_ResponsibleParty: E-mail missing")
+ result["errors"].append("gmd:CI_ResponsibleParty: E-mail is missing")
errors += 1
if md.identification.contact[0].role is (None or ''):
- result["errors"].append("gmd:CI_ResponsibleParty: Role missing")
+ result["errors"].append("gmd:CI_ResponsibleParty: Role is missing")
errors += 1
if md.identification.title is (None or ''):
@@ -233,15 +233,15 @@
result["errors"].append("gmd:md_DataIdentification: Abstract is missing")
errors += 1
if md.identification.identtype is (None or ''):
- result["errors"].append("gmd:md_ScopeCode: Resource Type is missing")
+ result["errors"].append("gmd:md_ScopeCode: Resource type is missing")
errors += 1
if md.identification.resourcelanguage is None:
errors += 1
- result["errors"].append("gmd:language: Resource Language is missing")
+ result["errors"].append("gmd:language: Resource language is missing")
else:
if len(md.identification.resourcelanguage) < 1 or md.identification.resourcelanguage[0] == '':
- result["errors"].append("gmd:language: Resource Language is missing")
+ result["errors"].append("gmd:language: Resource language is missing")
errors += 1
if md.identification.uricode is None:
@@ -262,9 +262,9 @@
if md.identification.keywords is None or len(md.identification.keywords) < 1:
result["errors"].append("gmd:MD_Keywords: Keywords are missing")
- result["errors"].append("gmd:thesaurusName: Thesaurus Title is missing")
- result["errors"].append("gmd:thesaurusName: Thesaurus Date is missing")
- result["errors"].append("gmd:thesaurusName: Thesaurus Date Type is missing")
+ result["errors"].append("gmd:thesaurusName: Thesaurus title is missing")
+ result["errors"].append("gmd:thesaurusName: Thesaurus date is missing")
+ result["errors"].append("gmd:thesaurusName: Thesaurus date type is missing")
errors += 4
else:
if md.identification.keywords[0]['keywords'] is None or len(md.identification.keywords[0]['keywords']) < 1 \
@@ -272,31 +272,31 @@
result["errors"].append("gmd:MD_Keywords: Keywords are missing")
errors += 1
if md.identification.keywords[0]['thesaurus'] is None:
- result["errors"].append("gmd:thesaurusName: Thesaurus Title is missing")
- result["errors"].append("gmd:thesaurusName: Thesaurus Date is missing")
- result["errors"].append("gmd:thesaurusName: Thesaurus Date Type is missing")
+ result["errors"].append("gmd:thesaurusName: Thesaurus title is missing")
+ result["errors"].append("gmd:thesaurusName: Thesaurus date is missing")
+ result["errors"].append("gmd:thesaurusName: Thesaurus date type is missing")
errors += 3
else:
if md.identification.keywords[0]['thesaurus']['title'] is None \
or len(md.identification.keywords[0]['thesaurus']['title']) < 1:
- result["errors"].append("gmd:thesaurusName: Thesaurus Title is missing")
+ result["errors"].append("gmd:thesaurusName: Thesaurus title is missing")
errors += 1
if md.identification.keywords[0]['thesaurus']['date'] is None \
or len(md.identification.keywords[0]['thesaurus']['date']) < 1:
- result["errors"].append("gmd:thesaurusName: Thesaurus Date is missing")
+ result["errors"].append("gmd:thesaurusName: Thesaurus date is missing")
errors += 1
if md.identification.keywords[0]['thesaurus']['datetype'] is None \
or len(md.identification.keywords[0]['thesaurus']['datetype']) < 1:
- result["errors"].append("gmd:thesaurusName: Thesaurus Date Type is missing")
+ result["errors"].append("gmd:thesaurusName: Thesaurus date type is missing")
errors += 1
if md.identification.extent is None:
- result["errors"].append("gmd:EX_Extent: extent element is missing")
+ result["errors"].append("gmd:EX_Extent: Extent element is missing")
errors += 1
else:
if md.identification.extent.boundingBox is None:
result["errors"].append(
- "gmd:EX_GeographicBoundingBox: bbox is missing")
+ "gmd:EX_GeographicBoundingBox: Bounding box is missing")
errors += 1
else:
if md.identification.extent.boundingBox.minx is (None or ''):
@@ -328,7 +328,7 @@
errors += 1
if md.languagecode is (None or ''):
- result["errors"].append("gmd:LanguageCode: Language code missing")
+ result["errors"].append("gmd:LanguageCode: Language code is missing")
errors += 1
if md.datestamp is (None or ''):
result["errors"].append("gmd:dateStamp: Date is missing")
@@ -338,10 +338,10 @@
errors += 1
if md.dataquality is (None or ''):
result["errors"].append("gmd:LI_Lineage is missing")
- result["errors"].append("gmd:DQ_ConformanceResult: date is missing")
- result["errors"].append("gmd:DQ_ConformanceResult: date type is missing")
- # result["errors"].append("gmd:DQ_ConformanceResult: degree is missing")
- result["errors"].append("gmd:DQ_ConformanceResult: title is missing")
+ result["errors"].append("gmd:DQ_ConformanceResult: Date is missing")
+ result["errors"].append("gmd:DQ_ConformanceResult: Date type is missing")
+ # result["errors"].append("gmd:DQ_ConformanceResult: Degree is missing")
+ result["errors"].append("gmd:DQ_ConformanceResult: Title is missing")
errors += 4
else:
@@ -349,22 +349,22 @@
result["errors"].append("gmd:LI_Lineage is missing")
errors += 1
if len(md.dataquality.conformancedate) < 1 or md.dataquality.conformancedate[0] == '':
- result["errors"].append("gmd:DQ_ConformanceResult: date is missing")
+ result["errors"].append("gmd:DQ_ConformanceResult: Date is missing")
errors += 1
if len(md.dataquality.conformancedatetype) < 1 or md.dataquality.conformancedatetype[0] == '':
- result["errors"].append("gmd:DQ_ConformanceResult: date type is missing")
+ result["errors"].append("gmd:DQ_ConformanceResult: Date type is missing")
errors += 1
# if len(md.dataquality.conformancedegree) < 1:
- # result["errors"].append("gmd:DQ_ConformanceResult: degree is missing")
+ # result["errors"].append("gmd:DQ_ConformanceResult: Degree is missing")
# errors += 1
if len(md.dataquality.conformancetitle) < 1 or md.dataquality.conformancetitle[0] == '':
- result["errors"].append("gmd:DQ_ConformanceResult: title is missing")
+ result["errors"].append("gmd:DQ_ConformanceResult: Title is missing")
errors += 1
if md.contact is None or len(md.contact) < 1:
result["errors"].append("gmd:contact: Organization name is missing")
- result["errors"].append("gmd:contact: e-mail is missing")
- result["errors"].append("gmd:role: role is missing")
+ result["errors"].append("gmd:contact: E-mail is missing")
+ result["errors"].append("gmd:role: Role is missing")
errors += 3
else:
@@ -373,11 +373,11 @@
errors += 1
if md.contact[0].email is (None or ''):
- result["errors"].append("gmd:contact: e-mail is missing")
+ result["errors"].append("gmd:contact: E-mail is missing")
errors += 1
if md.contact[0].role is (None or ''):
- result["errors"].append("gmd:role: role is missing")
+ result["errors"].append("gmd:role: Role is missing")
errors += 1
if errors > 0:
Modified: grass-addons/grass7/gui/wxpython/wx.metadata/r.info.iso/r.info.iso.html
===================================================================
--- grass-addons/grass7/gui/wxpython/wx.metadata/r.info.iso/r.info.iso.html 2014-08-14 03:51:17 UTC (rev 61613)
+++ grass-addons/grass7/gui/wxpython/wx.metadata/r.info.iso/r.info.iso.html 2014-08-14 10:10:06 UTC (rev 61614)
@@ -1,5 +1,9 @@
<h2>DESCRIPTION</h2>
-Metadata creator according to EN ISO 19115 and EN ISO 19119
+
+Metadata creator according to EN ISO 19115 and EN ISO 19119.
+
<h2>AUTHOR</h2>
Matej Krejci, Czech Technical University in Prague, Czech Republic
+
+<p><i>Last changed: $Date$</i>
Modified: grass-addons/grass7/gui/wxpython/wx.metadata/r.info.iso/r.info.iso.py
===================================================================
--- grass-addons/grass7/gui/wxpython/wx.metadata/r.info.iso/r.info.iso.py 2014-08-14 03:51:17 UTC (rev 61613)
+++ grass-addons/grass7/gui/wxpython/wx.metadata/r.info.iso/r.info.iso.py 2014-08-14 10:10:06 UTC (rev 61614)
@@ -22,7 +22,7 @@
#%option
#% key: profil
#% label: Metadata profil based on ISO
-#% description: INSPIRE profile is not filled properly (unknown values are filled '$NULL')
+#% description: INSPIRE profile is not filled properly (unknown values are filled with '$NULL')
#% options: basic, inspire
#% answer: basic
#%end
Modified: grass-addons/grass7/gui/wxpython/wx.metadata/v.info.iso/v.info.iso.html
===================================================================
--- grass-addons/grass7/gui/wxpython/wx.metadata/v.info.iso/v.info.iso.html 2014-08-14 03:51:17 UTC (rev 61613)
+++ grass-addons/grass7/gui/wxpython/wx.metadata/v.info.iso/v.info.iso.html 2014-08-14 10:10:06 UTC (rev 61614)
@@ -1,5 +1,9 @@
<h2>DESCRIPTION</h2>
-Metadata creator according to EN ISO 19115 and EN ISO 19119
+
+Metadata creator according to EN ISO 19115 and EN ISO 19119.
+
<h2>AUTHOR</h2>
Matej Krejci, Czech Technical University in Prague, Czech Republic
+
+<p><i>Last changed: $Date$</i>
Modified: grass-addons/grass7/gui/wxpython/wx.metadata/v.info.iso/v.info.iso.py
===================================================================
--- grass-addons/grass7/gui/wxpython/wx.metadata/v.info.iso/v.info.iso.py 2014-08-14 03:51:17 UTC (rev 61613)
+++ grass-addons/grass7/gui/wxpython/wx.metadata/v.info.iso/v.info.iso.py 2014-08-14 10:10:06 UTC (rev 61614)
@@ -22,7 +22,7 @@
#%option
#% key: profil
#% label: Metadata profil based on ISO
-#% description: INSPIRE profile is not filled properly (unknown values are filled '$NULL')
+#% description: INSPIRE profile is not filled properly (unknown values are filled with '$NULL')
#% options: basic, inspire
#% answer: basic
#%end
More information about the grass-commit
mailing list