Show More
@@ -172,8 +172,7 b' class HomeDirError(Exception):' | |||||
172 | def get_home_dir(require_writable=False): |
|
172 | def get_home_dir(require_writable=False): | |
173 | """Return the 'home' directory, as a unicode string. |
|
173 | """Return the 'home' directory, as a unicode string. | |
174 |
|
174 | |||
175 | * First, check for frozen env in case of py2exe |
|
175 | Uses os.path.expanduser('~'), and checks for writability. | |
176 | * Otherwise, defer to os.path.expanduser('~') |
|
|||
177 |
|
176 | |||
178 | See stdlib docs for how this is determined. |
|
177 | See stdlib docs for how this is determined. | |
179 | $HOME is first priority on *ALL* platforms. |
|
178 | $HOME is first priority on *ALL* platforms. | |
@@ -189,19 +188,6 b' def get_home_dir(require_writable=False):' | |||||
189 | The path is resolved, but it is not guaranteed to exist or be writable. |
|
188 | The path is resolved, but it is not guaranteed to exist or be writable. | |
190 | """ |
|
189 | """ | |
191 |
|
190 | |||
192 | # first, check py2exe distribution root directory for _ipython. |
|
|||
193 | # This overrides all. Normally does not exist. |
|
|||
194 |
|
||||
195 | if hasattr(sys, "frozen"): #Is frozen by py2exe |
|
|||
196 | if '\\library.zip\\' in IPython.__file__.lower():#libraries compressed to zip-file |
|
|||
197 | root, rest = IPython.__file__.lower().split('library.zip') |
|
|||
198 | else: |
|
|||
199 | root=os.path.join(os.path.split(IPython.__file__)[0],"../../") |
|
|||
200 | root=os.path.abspath(root).rstrip('\\') |
|
|||
201 | if _writable_dir(os.path.join(root, '_ipython')): |
|
|||
202 | os.environ["IPYKITROOT"] = root |
|
|||
203 | return py3compat.cast_unicode(root, fs_encoding) |
|
|||
204 |
|
||||
205 | homedir = os.path.expanduser('~') |
|
191 | homedir = os.path.expanduser('~') | |
206 | # Next line will make things work even when /home/ is a symlink to |
|
192 | # Next line will make things work even when /home/ is a symlink to | |
207 | # /usr/home as it is on FreeBSD, for example |
|
193 | # /usr/home as it is on FreeBSD, for example |
General Comments 0
You need to be logged in to leave comments.
Login now