Skip to content

Commit

Permalink
g.download.location: Add path option for compatibility with core modu…
Browse files Browse the repository at this point in the history
…le (#586)

This adds path option for compatibility with the version of the module in v8.
It is an additional option, so the original dbase still works.
Same code can now be used for v7 and v8, but the original code for v7 still works
(v8 code should be updated to use the version in core, not the addon).
  • Loading branch information
wenzeslaus committed Jul 13, 2021
1 parent b0e4c7e commit 9925460
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/general/g.download.location/g.download.location.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,21 @@
#% key_desc: name
#%end
#%option G_OPT_M_DBASE
#% key: path
#% required: no
#% multiple: no
#%end
#%option
#% key: dbase
#% multiple: no
#% type: string
#% label: Path to database, use path option instead
#% description: This option is obsolete and replaced by path
#% required: no
#%end
#%rules
#% exclusive: path,dbase
#%end

import os
import shutil
Expand Down Expand Up @@ -232,7 +244,9 @@ def location_name_from_url(url):
def main(options, flags):
url = options["url"]
name = options["name"]
database = options["dbase"]
database = options["path"]
if not database:
database = options["dbase"]

if not database:
# use current
Expand Down

0 comments on commit 9925460

Please sign in to comment.