Changeset 37873


Ignore:
Timestamp:
Jun 13, 2009, 7:27:48 PM (15 years ago)
Author:
glynn
Message:

Windows fixes
Handle missing ~/.grassrc7
Call wxgui.py, not wxgui shell script

Location:
grass/trunk/lib/init
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • grass/trunk/lib/init/Makefile

    r37863 r37873  
    3232FILES = \
    3333        $(ARCH_BINDIR)/$(START_UP).sh \
    34         $(ARCH_BINDIR)/$(START_UP) \
    3534        $(ETC)/Init.sh \
    3635        $(ETC)/functions.sh \
     
    5655ifneq ($(strip $(MINGW)),)
    5756        FILES += \
     57                $(ARCH_BINDIR)/$(START_UP).py \
    5858                $(ARCH_BINDIR)/$(START_UP).bat \
    5959                $(ETC)/Init.bat
     60else
     61        FILES += \
     62                $(ARCH_BINDIR)/$(START_UP)
     63
    6064endif
    6165
     
    7680        chmod a+x $@
    7781
     82ifneq ($(strip $(MINGW)),)
     83$(ARCH_BINDIR)/$(START_UP).py: grass.py
     84else
    7885$(ARCH_BINDIR)/$(START_UP): grass.py
     86endif
    7987        rm -f $@
    8088        sed \
    81         -e 's#@GISBASE@#$(GISBASE)#' \
     89        -e 's#@GISBASE@#$(RUN_GISBASE)#' \
    8290        -e 's#@GRASS_VERSION_NUMBER@#$(GRASS_VERSION_NUMBER)#' \
    8391        -e 's#@LD_LIBRARY_PATH_VAR@#$(LD_LIBRARY_PATH_VAR)#' \
  • grass/trunk/lib/init/grass.py

    r37864 r37873  
    3838config_projshare = "@CONFIG_PROJSHARE@"
    3939
     40gisbase = os.path.normpath(gisbase)
     41
    4042tmpdir = None
    4143lockfile = None
     
    191193    if not grass_gui:
    192194        # Check for a reference to the GRASS user interface in the grassrc file
    193         kv = read_gisrc()
    194         if 'GRASS_GUI' not in kv:
    195             # Set the GRASS user interface to the default if needed
    196             grass_gui = default_gui
     195        if os.access(gisrc, os.R_OK):
     196            kv = read_gisrc()
     197            if 'GRASS_GUI' not in kv:
     198                # Set the GRASS user interface to the default if needed
     199                grass_gui = default_gui
    197200        else:
    198201            grass_gui = kv['GRASS_GUI']
    199202   
     203    if not grass_gui:
     204        grass_gui = default_gui
     205
    200206    if grass_gui == 'gui':
    201207        grass_gui = default_gui
     
    271277    if not os.getenv('GRASS_PYTHON'):
    272278        if windows:
    273             os.environ['GRASS_PYTHON'] = "pythonw.exe"
     279            os.environ['GRASS_PYTHON'] = "python.exe"
    274280        else:
    275281            os.environ['GRASS_PYTHON'] = "python"
     
    320326
    321327def grass_intro():
    322     path = gfile("locale", locale, "etc", "grass_intro")
    323     if not os.access(path, os.R_OK):
     328    if locale:
     329        path = gfile("locale", locale, "etc", "grass_intro")
     330        if not os.access(path, os.R_OK):
     331            path = gfile("etc", "grass_intro")
     332    else:
    324333        path = gfile("etc", "grass_intro")
    325334    f = open(path, 'r')
     
    583592    # Check for gui interface
    584593    if grass_gui == "wxpython":
    585         call([gfile("etc", "wxpython", "scripts", "wxgui")])
     594        call([gfile("etc", "wxpython", "wxgui.py")])
    586595
    587596def clear_screen():
     
    802811os.environ['GISBASE'] = gisbase
    803812
     813# set HOME
     814if windows and not os.getenv('HOME'):
     815    os.environ['HOME'] = os.path.join(os.getenv('HOMEDRIVE'), os.getenv('HOMEPATH'))
     816
    804817atexit.register(cleanup)
    805818
Note: See TracChangeset for help on using the changeset viewer.