guiutils.py 733 B

12345678910111213141516171819202122232425
  1. """
  2. @package startup.guiutils
  3. @brief General GUI-dependent utilities for GUI startup of GRASS GIS
  4. (C) 2018 by Vaclav Petras the GRASS Development Team
  5. This program is free software under the GNU General Public License
  6. (>=v2). Read the file COPYING that comes with GRASS for details.
  7. @author Vaclav Petras <wenzeslaus gmail com>
  8. This is for code which depend on something from GUI (wx or wxGUI).
  9. """
  10. from core.gcmd import RunCommand
  11. def SetSessionMapset(database, location, mapset):
  12. """Sets database, location and mapset for the current session"""
  13. RunCommand("g.gisenv", set="GISDBASE=%s" % database)
  14. RunCommand("g.gisenv", set="LOCATION_NAME=%s" % location)
  15. RunCommand("g.gisenv", set="MAPSET=%s" % mapset)