Show More
@@ -778,6 +778,7 b' def get_home_dir():' | |||
|
778 | 778 | |
|
779 | 779 | * On POSIX, we try $HOME. |
|
780 | 780 | * On Windows we try: |
|
781 | - %HOME%: rare, but some people with unix-like setups may have defined it | |
|
781 | 782 | - %HOMESHARE% |
|
782 | 783 | - %HOMEDRIVE\%HOMEPATH% |
|
783 | 784 | - %USERPROFILE% |
@@ -820,7 +821,12 b' def get_home_dir():' | |||
|
820 | 821 | # is needed when running IPython on cluster where all paths have to |
|
821 | 822 | # be UNC. |
|
822 | 823 | try: |
|
823 | homedir = env['HOMESHARE'] | |
|
824 | # A user with a lot of unix tools in win32 may have defined $HOME, | |
|
825 | # honor it if it exists, but otherwise let the more typical | |
|
826 | # %HOMESHARE% variable be used. | |
|
827 | homedir = env.get('HOME') | |
|
828 | if homedir is None: | |
|
829 | homedir = env['HOMESHARE'] | |
|
824 | 830 | except KeyError: |
|
825 | 831 | pass |
|
826 | 832 | else: |
@@ -93,8 +93,9 b' def setup_environment():' | |||
|
93 | 93 | if os.name == 'nt': |
|
94 | 94 | platformstuff = (wreg.OpenKey, wreg.QueryValueEx,) |
|
95 | 95 | |
|
96 | if 'IPYTHONDIR' in env: | |
|
97 |
|
|
|
96 | # Remove both spellings of env variables if present | |
|
97 | env.pop('IPYTHON_DIR', None) | |
|
98 | env.pop('IPYTHONDIR', None) | |
|
98 | 99 | |
|
99 | 100 | def teardown_environment(): |
|
100 | 101 | """Restore things that were remebered by the setup_environment function |
@@ -191,12 +192,14 b' def test_get_home_dir_6():' | |||
|
191 | 192 | @skip_if_not_win32 |
|
192 | 193 | @with_environment |
|
193 | 194 | def test_get_home_dir_7(): |
|
194 |
"""Testcase $HOME is not set, os=='nt' |
|
|
195 | env['HOMEDRIVE'],env['HOMEPATH'], env['USERPROFILE'] missing | |
|
195 | """Testcase $HOME is not set, os=='nt' | |
|
196 | ||
|
197 | env['HOMEDRIVE'],env['HOMEPATH'], env['USERPROFILE'] and others missing | |
|
196 | 198 | """ |
|
197 | 199 | os.name = 'nt' |
|
198 | if 'HOME' in env: del env['HOME'] | |
|
199 | if 'HOMEDRIVE' in env: del env['HOMEDRIVE'] | |
|
200 | # Remove from stub environment all keys that may be set | |
|
201 | for key in ['HOME', 'HOMESHARE', 'HOMEDRIVE', 'HOMEPATH', 'USERPROFILE']: | |
|
202 | env.pop(key, None) | |
|
200 | 203 | |
|
201 | 204 | #Stub windows registry functions |
|
202 | 205 | def OpenKey(x, y): |
@@ -220,7 +223,7 b' def test_get_home_dir_7():' | |||
|
220 | 223 | @with_environment |
|
221 | 224 | def test_get_ipython_dir_1(): |
|
222 | 225 | """test_get_ipython_dir_1, Testcase to see if we can call get_ipython_dir without Exceptions.""" |
|
223 | env['IPYTHONDIR'] = "someplace/.ipython" | |
|
226 | env['IPYTHON_DIR'] = "someplace/.ipython" | |
|
224 | 227 | ipdir = genutils.get_ipython_dir() |
|
225 | 228 | nt.assert_equal(ipdir, "someplace/.ipython") |
|
226 | 229 |
General Comments 0
You need to be logged in to leave comments.
Login now