##// END OF EJS Templates
Report if cwd does not exist and raise exception in BaseIPythonApplication...
Thomas Spura -
Show More
@@ -147,18 +147,12 b' class BaseIPythonApplication(Application):'
147 def __init__(self, **kwargs):
147 def __init__(self, **kwargs):
148 super(BaseIPythonApplication, self).__init__(**kwargs)
148 super(BaseIPythonApplication, self).__init__(**kwargs)
149 # ensure current working directory exists
149 # ensure current working directory exists
150 level_up = False
150 try:
151 while True:
151 directory = os.getcwdu()
152 try:
152 except:
153 directory = os.getcwdu()
153 # raise exception
154 except OSError:
154 self.log.error("Current working directory doesn't exist.")
155 # search level up until directory exists
155 raise
156 os.chdir("..")
157 level_up = True
158 else:
159 if level_up:
160 self.log.warn("Current working directory doesn't exist.\nSetting to: %s"%(directory))
161 break
162
156
163 # ensure even default IPYTHONDIR exists
157 # ensure even default IPYTHONDIR exists
164 if not os.path.exists(self.ipython_dir):
158 if not os.path.exists(self.ipython_dir):
@@ -11,8 +11,15 b''
11 #-----------------------------------------------------------------------------
11 #-----------------------------------------------------------------------------
12 # Imports
12 # Imports
13 #-----------------------------------------------------------------------------
13 #-----------------------------------------------------------------------------
14
14 import sys
15 import traceback
15
16
16 from IPython.parallel.apps.ipclusterapp import launch_new_instance
17 from IPython.parallel.apps.ipclusterapp import launch_new_instance
17
18
18 launch_new_instance()
19 try:
20 launch_new_instance()
21 except:
22 exc_type, exc_value, exc_traceback = sys.exc_info()
23 traceback.print_exception(exc_type, exc_value, exc_traceback,
24 file=sys.stderr)
25 sys.exit(1)
@@ -11,8 +11,15 b''
11 #-----------------------------------------------------------------------------
11 #-----------------------------------------------------------------------------
12 # Imports
12 # Imports
13 #-----------------------------------------------------------------------------
13 #-----------------------------------------------------------------------------
14
14 import sys
15 import traceback
15
16
16 from IPython.parallel.apps.ipcontrollerapp import launch_new_instance
17 from IPython.parallel.apps.ipcontrollerapp import launch_new_instance
17
18
18 launch_new_instance()
19 try:
20 launch_new_instance()
21 except:
22 exc_type, exc_value, exc_traceback = sys.exc_info()
23 traceback.print_exception(exc_type, exc_value, exc_traceback,
24 file=sys.stderr)
25 sys.exit(1)
@@ -11,10 +11,15 b''
11 #-----------------------------------------------------------------------------
11 #-----------------------------------------------------------------------------
12 # Imports
12 # Imports
13 #-----------------------------------------------------------------------------
13 #-----------------------------------------------------------------------------
14
14 import sys
15 import traceback
15
16
16 from IPython.parallel.apps.ipengineapp import launch_new_instance
17 from IPython.parallel.apps.ipengineapp import launch_new_instance
17
18
18 launch_new_instance()
19 try:
19
20 launch_new_instance()
20
21 except:
22 exc_type, exc_value, exc_traceback = sys.exc_info()
23 traceback.print_exception(exc_type, exc_value, exc_traceback,
24 file=sys.stderr)
25 sys.exit(1)
@@ -11,10 +11,15 b''
11 #-----------------------------------------------------------------------------
11 #-----------------------------------------------------------------------------
12 # Imports
12 # Imports
13 #-----------------------------------------------------------------------------
13 #-----------------------------------------------------------------------------
14
14 import sys
15 import traceback
15
16
16 from IPython.parallel.apps.iploggerapp import launch_new_instance
17 from IPython.parallel.apps.iploggerapp import launch_new_instance
17
18
18 launch_new_instance()
19 try:
19
20 launch_new_instance()
20
21 except:
22 exc_type, exc_value, exc_traceback = sys.exc_info()
23 traceback.print_exception(exc_type, exc_value, exc_traceback,
24 file=sys.stderr)
25 sys.exit(1)
@@ -1,7 +1,15 b''
1 #!/usr/bin/env python
1 #!/usr/bin/env python
2 """Terminal-based IPython entry point.
2 """Terminal-based IPython entry point.
3 """
3 """
4 import sys
5 import traceback
4
6
5 from IPython.frontend.terminal.ipapp import launch_new_instance
7 from IPython.frontend.terminal.ipapp import launch_new_instance
6
8
7 launch_new_instance()
9 try:
10 launch_new_instance()
11 except:
12 exc_type, exc_value, exc_traceback = sys.exc_info()
13 traceback.print_exception(exc_type, exc_value, exc_traceback,
14 file=sys.stderr)
15 sys.exit(1)
General Comments 0
You need to be logged in to leave comments. Login now