functions.py 622 B

123456789101112131415161718192021222324252627
  1. # -*- coding: utf-8 -*-
  2. """
  3. Created on Mon Nov 26 11:48:03 2012
  4. @author: lucadelu
  5. """
  6. import wx
  7. import os
  8. from grass.script import core as grass
  9. def checkValue(value):
  10. if value == '':
  11. wx.FindWindowById(wx.ID_FORWARD).Enable(False)
  12. else:
  13. wx.FindWindowById(wx.ID_FORWARD).Enable(True)
  14. def retRLiPath():
  15. major_version = int(grass.version()['version'].split('.', 1)[0])
  16. rlipath = os.path.join(os.environ['HOME'], '.grass%d' % major_version,
  17. 'r.li')
  18. if os.path.exists(rlipath):
  19. return rlipath
  20. else:
  21. os.mkdir(rlipath)
  22. return rlipath