mapsets_picker.py 574 B

12345678910111213141516171819202122232425262728293031
  1. #!/usr/bin/env python
  2. import wx
  3. from grass.script.setup import set_gui_path
  4. set_gui_path()
  5. from core.gcmd import RunCommand
  6. from core.utils import _
  7. from gui_core.preferences import MapsetAccess
  8. def main():
  9. app = wx.App()
  10. dlg = MapsetAccess(parent = None)
  11. dlg.CenterOnScreen()
  12. if dlg.ShowModal() == wx.ID_OK:
  13. ms = dlg.GetMapsets()
  14. RunCommand('g.mapsets',
  15. parent = None,
  16. mapset = '%s' % ','.join(ms),
  17. operation = 'set')
  18. dlg.Destroy()
  19. if __name__ == "__main__":
  20. main()