[GRASS-git] [OSGeo/grass] 2246f5: Simplify grass init script (#5)

pmav99 noreply at github.com
Wed Jul 24 19:01:07 PDT 2019


  Branch: refs/heads/master
  Home:   https://github.com/OSGeo/grass
  Commit: 2246f5b6aca7a3dca67fc8b0d0c46fe64be39626
      https://github.com/OSGeo/grass/commit/2246f5b6aca7a3dca67fc8b0d0c46fe64be39626
  Author: pmav99 <pmav99 at users.noreply.github.com>
  Date:   2019-07-24 (Wed, 24 Jul 2019)

  Changed paths:
    M REQUIREMENTS.html
    M Vagrantfile
    M lib/init/grass.py

  Log Message:
  -----------
  Simplify grass init script (#5)

* shutil.rmtree removes directories recursively and has ignore errors, so no need for the wrapper
function/classes

* lib/init/grass: Simplify encode()/decode() functions.

* lib/init/grass: Move all the imports at the beginning of the file.

* lib/init/grass: Simplify clean_env().

"clean_env()" is only being called once. Even if it gets called multiple
times in the future, it is unlikely that it will be used with a different
"gisrc".

* Just keeping globals and the initialization stuff at the beginning of the
module

* lib/init/grass: Group the logging functions together.

* lib/init/grass: Move the info message out of the "show_info()" function.

This was messing up with the vim code folding.

* lib/init/grass: Remove unused constants

* lib/init/grass: Remove old comment about removed nested session test

The comment is from 2015. If there were problems, they would have surfaced
since then.

* lib/init/grass: Move all the gisbase stuff in a single place.

* lib/init/grass: Capitalize all constants

* lib/init/grass: Simplify setting a value to CONFIG_PROJSHARE

* lib/init/grass: Add comments about GISBASE

* lib/init/grass: Validate cmdline in a separate function

* lib/init/grass: Inline variable substitution inside "help_message()"

The main motivation here is to avoid making "_()" calls at the module
level which will hopefully let us remove the early "gettext.install()"
call in a later commit.

* lib/init/grass: Refuse to start if ~/.grass7 exists but is not a directory

* lib/init/grass: Ensure that the init process only happens inside main()

1. we remove the "gettext.install()" call from the module level
2. we make sure that "set_language()" is the first step of the init process.

* lib/init/grass: Use six for cross version Python compatibility

Six is being pulled by matplotlib anyway, but for good measure,
I also added it to the explicit requirements.




More information about the grass-commit mailing list