Changeset 2939


Ignore:
Timestamp:
Jul 21, 2017 5:22:13 PM (6 years ago)
Author:
toby
Message:

improve error messages for writing config.py

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branch/2frame/GSASIIctrlGUI.py

    r2924 r2939  
    39743974    except IOError:  # can't write there, write in local mods directory
    39753975        # create a local mods directory, if needed
    3976         if not os.path.exists(os.path.expanduser('~/.G2local/')):
    3977             print('Creating directory '+os.path.expanduser('~/.G2local/'))
    3978             os.mkdir(os.path.expanduser('~/.G2local/'))
     3976        g2local = os.path.expanduser('~/.G2local/')
     3977        if not os.path.exists(g2local):
     3978            try:
     3979                print(u'Creating directory '+g2local)
     3980                os.mkdir(g2local)
     3981            except:
     3982                if parent:
     3983                    G2MessageBox(parent,u'Error trying to create directory '+g2local,
     3984                        'Unable to save')
     3985                else:
     3986                    print(u'Error trying to create directory '+g2local)
     3987                return True
    39793988            sys.path.insert(0,os.path.expanduser('~/.G2local/'))
    39803989        savefile = os.path.join(os.path.expanduser('~/.G2local/'),'config.py')
Note: See TracChangeset for help on using the changeset viewer.