Skip to content

Commit

Permalink
Merge pull request #2 from mundialis/revision
Browse files Browse the repository at this point in the history
revision of grass messages and header
  • Loading branch information
juleshaas authored Mar 10, 2022
2 parents 3d11cc7 + 5284c84 commit 2118a2e
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 20 deletions.
9 changes: 5 additions & 4 deletions g.region.area.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
# GNU General Public License for more details.
#
#############################################################################
# %module

# %Module
# % description: Computes the current region extent or the size of the map in square meters and compares it with the user defined maximum.
# % keyword: general
# % keyword: area
Expand Down Expand Up @@ -70,7 +71,7 @@ def main():
global rm_vectors

# test overlap
grass.message("Create vector map out of current region ...")
grass.message(_("Create vector map out of current region..."))
tmpvector = "tmp_regionvector_%s" % "".join(
random.choice(string.ascii_letters) for i in range(5)
)
Expand All @@ -80,7 +81,7 @@ def main():
else:
grass.run_command("g.copy", vector="%s,%s" % (options["map"], tmpvector))

grass.message("Computing area of current region in sqm ...")
grass.message(_("Computing area of current region in sqm..."))
if len(grass.vector_db(tmpvector)) == 0:
grass.run_command("v.db.addtable", map=tmpvector, quiet=True)
grass.run_command(
Expand All @@ -100,7 +101,7 @@ def main():
overwrite=True,
)

grass.message("Select area ...")
grass.message(_("Select area..."))
area_sqm = float(
[
x
Expand Down
37 changes: 21 additions & 16 deletions testsuite/test_g_region_area.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,24 @@
"""
Name: g.region.area test
Purpose: Tests g.region.area inputs.
Uses NC full sample data set.
Author: Anika Weinmann and Guido Riembauer
Copyright: (C) 2020-2022 by mundialis GmbH & Co. KG and the GRASS Development Team
License: This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
"""
#!/usr/bin/env python3

############################################################################
#
# MODULE: g.region.area test
# AUTHOR(S): Anika Weinmann and Guido Riembauer
#
# PURPOSE: Tests g.region.area inputs. Uses NC full sample data set.
# COPYRIGHT: (C) 2020-2022 by mundialis GmbH & Co. KG and the GRASS Development Team
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
#############################################################################

import os

Expand Down

0 comments on commit 2118a2e

Please sign in to comment.