Skip to content

Commit 821edd0

Browse files
lindakarlovskalindakladivova
and
lindakladivova
authored
grass.py: Standardize naming: use "GRASS" instead of "GRASS GIS" (#5645)
replace grass gis by grass in grass.py Co-authored-by: lindakladivova <[email protected]>
1 parent b5c3282 commit 821edd0

File tree

1 file changed

+24
-28
lines changed

1 file changed

+24
-28
lines changed

lib/init/grass.py

Lines changed: 24 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ def Popen(cmd, **kwargs): # pylint: disable=C0103
192192

193193

194194
def gpath(*args) -> str:
195-
"""Construct path to file or directory in GRASS GIS installation
195+
"""Construct path to file or directory in GRASS installation
196196
197197
Can be called only after GISBASE was set.
198198
"""
@@ -255,8 +255,8 @@ def fw(fmt: str, *args) -> str:
255255

256256
# using format for most but leaving usage of template for the dynamic ones
257257
# two different methods are easy way to implement two phase construction
258-
HELP_TEXT = r"""GRASS GIS $VERSION_NUMBER
259-
Geographic Resources Analysis Support System (GRASS GIS).
258+
HELP_TEXT = r"""GRASS $VERSION_NUMBER
259+
Geographic Resources Analysis Support System (GRASS).
260260
261261
{usage}:
262262
$CMD_NAME [-h | --help] [-v | --version]
@@ -388,7 +388,7 @@ def help_message(default_gui) -> None:
388388
def create_grass_config_dir() -> str:
389389
"""Create configuration directory
390390
391-
Determines path of GRASS GIS user configuration directory and creates
391+
Determines path of GRASS user configuration directory and creates
392392
it if it does not exist.
393393
394394
Configuration directory is for example used for grass env file
@@ -677,7 +677,7 @@ def create_location(gisdbase, location, geostring) -> None:
677677
678678
EPSG code format is ``EPSG:code`` or ``EPSG:code:datum_trans``.
679679
680-
:param gisdbase: Path to GRASS GIS database directory
680+
:param gisdbase: Path to GRASS database directory
681681
:param location: name of new Location
682682
:param geostring: path to a georeferenced file or EPSG code
683683
"""
@@ -718,7 +718,7 @@ def cannot_create_location_reason(gisdbase: StrPath, location: str) -> str:
718718
The goal is to provide the most suitable error message
719719
(rather than to do a quick check).
720720
721-
:param gisdbase: Path to GRASS GIS database directory
721+
:param gisdbase: Path to GRASS database directory
722722
:param location: name of a Location
723723
:returns: translated message
724724
"""
@@ -871,9 +871,7 @@ def set_mapset(
871871
if not tmp_location:
872872
# Report report only when new location is not temporary.
873873
message(
874-
_("Creating new GRASS GIS project <{}>...").format(
875-
location_name
876-
)
874+
_("Creating new GRASS project <{}>...").format(location_name)
877875
)
878876
create_location(gisdbase, location_name, geofile)
879877
else:
@@ -909,9 +907,7 @@ def set_mapset(
909907
).format(mapset=mapset, geofile=geofile)
910908
)
911909
if not tmp_mapset:
912-
message(
913-
_("Creating new GRASS GIS mapset <{}>...").format(mapset)
914-
)
910+
message(_("Creating new GRASS mapset <{}>...").format(mapset))
915911
# create mapset directory
916912
os.mkdir(path)
917913
if tmp_mapset:
@@ -935,7 +931,7 @@ def set_mapset(
935931
else:
936932
fatal(
937933
_(
938-
"GRASS GIS database directory, project and mapset"
934+
"GRASS database directory, project and mapset"
939935
" not set properly."
940936
" Use GUI or command line to set them."
941937
)
@@ -945,7 +941,7 @@ def set_mapset(
945941
# we don't follow the LOCATION_NAME legacy naming here but we have to still
946942
# translate to it, so always double check
947943
class MapsetSettings:
948-
"""Holds GRASS GIS database directory, Location and Mapset
944+
"""Holds GRASS database directory, Location and Mapset
949945
950946
Provides few convenient functions.
951947
"""
@@ -1475,7 +1471,7 @@ def close_gui() -> None:
14751471

14761472

14771473
def show_banner() -> None:
1478-
"""Write GRASS GIS ASCII name to stderr"""
1474+
"""Write GRASS ASCII name to stderr"""
14791475
sys.stderr.write(
14801476
r"""
14811477
__________ ___ __________ _______________
@@ -1490,7 +1486,7 @@ def show_banner() -> None:
14901486

14911487
def say_hello() -> None:
14921488
"""Write welcome to stderr including code revision if in git copy"""
1493-
sys.stderr.write(_("Welcome to GRASS GIS %s") % GRASS_VERSION)
1489+
sys.stderr.write(_("Welcome to GRASS %s") % GRASS_VERSION)
14941490
if GRASS_VERSION.endswith("dev"):
14951491
try:
14961492
with open(gpath("etc", "VERSIONNUMBER")) as filerev:
@@ -1512,11 +1508,11 @@ def say_hello() -> None:
15121508

15131509

15141510
def show_info(shellname, grass_gui, default_gui) -> None:
1515-
"""Write basic info about GRASS GIS and GRASS session to stderr"""
1511+
"""Write basic info about GRASS and GRASS session to stderr"""
15161512
sys.stderr.write(
15171513
fw(
15181514
INFO_TEXT,
1519-
_("GRASS GIS homepage:"),
1515+
_("GRASS homepage:"),
15201516
# GTC Running through: SHELL NAME
15211517
_("This version running through:"),
15221518
shellname,
@@ -1638,7 +1634,7 @@ def sh_like_startup(location, location_name, grass_env_file, sh):
16381634
else:
16391635
f.write("test -r ~/.alias && . ~/.alias\n")
16401636

1641-
# GRASS GIS and ISIS blend
1637+
# GRASS and ISIS blend
16421638
grass_name = "GRASS" if not os.getenv("ISISROOT") else "ISIS-GRASS"
16431639

16441640
if sh == "zsh":
@@ -1763,7 +1759,7 @@ def done_message() -> None:
17631759
# here was something for batch job but it was never called
17641760
message(_("Done."))
17651761
message("")
1766-
message(_("Goodbye from GRASS GIS"))
1762+
message(_("Goodbye from GRASS"))
17671763
message("")
17681764

17691765

@@ -1824,7 +1820,7 @@ def print_params(params) -> None:
18241820
if any(param in dev_params for param in params):
18251821
plat = gpath("include", "Make", "Platform.make")
18261822
if not os.path.exists(plat):
1827-
fatal(_("Please install the GRASS GIS development package"))
1823+
fatal(_("Please install the GRASS development package"))
18281824
with open(plat) as fileplat:
18291825
# this is in fact require only for some, but prepare it anyway
18301826
linesplat = fileplat.readlines()
@@ -2054,7 +2050,7 @@ def classic_parser(argv, default_gui) -> Parameters:
20542050
params.batch_job = parsed_args.exec
20552051
# Cases to execute immediately
20562052
if parsed_args.version:
2057-
sys.stdout.write("GRASS GIS %s" % GRASS_VERSION)
2053+
sys.stdout.write("GRASS %s" % GRASS_VERSION)
20582054
sys.stdout.write("\n" + readfile(gpath("etc", "license")))
20592055
sys.exit()
20602056
if parsed_args.config is not None:
@@ -2115,7 +2111,7 @@ def find_grass_python_package() -> None:
21152111
# Not translatable because we don't have translations loaded.
21162112
msg = (
21172113
"The grass Python package is missing. "
2118-
"Is the installation of GRASS GIS complete?"
2114+
"Is the installation of GRASS complete?"
21192115
)
21202116
raise RuntimeError(msg)
21212117

@@ -2141,7 +2137,7 @@ def main() -> None:
21412137
"GRASS_DEBUG environmental variable is set. It is meant to be"
21422138
" an internal variable for debugging only this script.\n"
21432139
" Use 'g.gisenv set=\"DEBUG=[0-5]\"'"
2144-
" to turn GRASS GIS debug mode on if you wish to do so."
2140+
" to turn GRASS debug mode on if you wish to do so."
21452141
)
21462142

21472143
# Set GRASS version number for R interface etc
@@ -2219,7 +2215,7 @@ def main() -> None:
22192215
if grass_gui == "text" and not params.mapset:
22202216
fatal(
22212217
_(
2222-
"Unable to start GRASS GIS. You have the choice to:\n"
2218+
"Unable to start GRASS. You have the choice to:\n"
22232219
" - Launch the graphical user interface with"
22242220
" the '--gui' switch\n"
22252221
" {cmd_name} --gui\n"
@@ -2240,7 +2236,7 @@ def main() -> None:
22402236

22412237
if not params.batch_job and not params.exit_grass:
22422238
# Only for interactive sessions, not for 'one operation' sessions.
2243-
message(_("Starting GRASS GIS..."))
2239+
message(_("Starting GRASS..."))
22442240

22452241
# Ensure GUI is set
22462242
if params.batch_job or params.exit_grass:
@@ -2289,14 +2285,14 @@ def main() -> None:
22892285
if not default_gisdbase:
22902286
fatal(
22912287
_(
2292-
"Failed to start GRASS GIS, grassdata directory cannot"
2288+
"Failed to start GRASS, grassdata directory cannot"
22932289
" be found or created."
22942290
)
22952291
)
22962292
elif not default_location:
22972293
fatal(
22982294
_(
2299-
"Failed to start GRASS GIS, no default project to copy in"
2295+
"Failed to start GRASS, no default project to copy in"
23002296
" the installation or copying failed."
23012297
)
23022298
)

0 commit comments

Comments
 (0)