Skip to content

Commit

Permalink
wx.metadata/m.csw.update: fix exlusive flags rules (#283)
Browse files Browse the repository at this point in the history
  • Loading branch information
tmszi committed Sep 26, 2020
1 parent 214558f commit e841798
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions grass7/gui/wxpython/wx.metadata/m.csw.update/m.csw.update.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,13 @@
#% description: Remove and print not valid CSW connections resources from XML file
#%end

#%rules
#% exclusive: -a, -i
#% exclusive: -v, -n
#% exclusive: -a, -n
#% exclusive: -i, -n
#%end


import http
import io
Expand Down Expand Up @@ -1347,21 +1354,10 @@ def main():
),
),
)
if flags['a'] and flags['i']:
gscript.fatal(_('Flags \'a\' and \'i\' are mutually exclusive'))

if flags['v'] and flags['n']:
gscript.fatal(_('Flags \'v\' and \'n\' are mutually exclusive'))

if flags['a'] and flags['n']:
gscript.fatal(_('Flags \'a\' and \'n\' are mutually exclusive'))

if flags['i'] and flags['n']:
gscript.fatal(_('Flags \'i\' and \'n\' are mutually exclusive'))

if (flags['a'] or flags['i'] or flags['v'] or flags['n']) and not \
flags['p']:
gscript.fatal(_('Add \'p\' flag please'))
flags['p'] = True

if flags['w']:
sys.stdout.write("{}\n".format(url))
Expand Down

0 comments on commit e841798

Please sign in to comment.