##// END OF EJS Templates
get_home_dir() returns the ipython installation root dir, if _ipython exists there (py2exe support)
vivainio -
Show More
@@ -5,7 +5,7 b' General purpose utilities.'
5 This is a grab-bag of stuff I find useful in most programs I write. Some of
5 This is a grab-bag of stuff I find useful in most programs I write. Some of
6 these things are also convenient when working at the command line.
6 these things are also convenient when working at the command line.
7
7
8 $Id: genutils.py 2190 2007-03-30 18:35:46Z fperez $"""
8 $Id: genutils.py 2371 2007-05-23 18:40:26Z vivainio $"""
9
9
10 #*****************************************************************************
10 #*****************************************************************************
11 # Copyright (C) 2001-2006 Fernando Perez. <fperez@colorado.edu>
11 # Copyright (C) 2001-2006 Fernando Perez. <fperez@colorado.edu>
@@ -33,6 +33,7 b' import types'
33 import warnings
33 import warnings
34
34
35 # Other IPython utilities
35 # Other IPython utilities
36 import IPython
36 from IPython.Itpl import Itpl,itpl,printpl
37 from IPython.Itpl import Itpl,itpl,printpl
37 from IPython import DPyGetOpt
38 from IPython import DPyGetOpt
38 from path import path
39 from path import path
@@ -807,6 +808,14 b' def get_home_dir():'
807
808
808 isdir = os.path.isdir
809 isdir = os.path.isdir
809 env = os.environ
810 env = os.environ
811
812 # first, check py2exe distribution root directory for _ipython.
813 # This overrides all. Normally does not exist.
814 if '\\library.zip\\' in IPython.__file__.lower():
815 root, rest = IPython.__file__.lower().split('library.zip')
816 if os.path.isdir(root + '_ipython'):
817 return root
818
810 try:
819 try:
811 homedir = env['HOME']
820 homedir = env['HOME']
812 if not isdir(homedir):
821 if not isdir(homedir):
General Comments 0
You need to be logged in to leave comments. Login now