##// END OF EJS Templates
Fixing bugs in BaseIPythonApplication....
Brian Granger -
Show More
@@ -70,7 +70,7 b' class Application(SingletonConfigurable):'
70
70
71 # The name of the application, will usually match the name of the command
71 # The name of the application, will usually match the name of the command
72 # line application
72 # line application
73 app_name = Unicode(u'application')
73 name = Unicode(u'application')
74
74
75 # The description of the application that is printed at the beginning
75 # The description of the application that is printed at the beginning
76 # of the help.
76 # of the help.
@@ -47,7 +47,7 b' class Bar(Configurable):'
47
47
48 class MyApp(Application):
48 class MyApp(Application):
49
49
50 app_name = Unicode(u'myapp')
50 name = Unicode(u'myapp')
51 running = Bool(False, config=True,
51 running = Bool(False, config=True,
52 help="Is the app running?")
52 help="Is the app running?")
53 classes = List([Bar, Foo])
53 classes = List([Bar, Foo])
@@ -71,7 +71,7 b' class TestApplication(TestCase):'
71
71
72 def test_basic(self):
72 def test_basic(self):
73 app = MyApp()
73 app = MyApp()
74 self.assertEquals(app.app_name, u'myapp')
74 self.assertEquals(app.name, u'myapp')
75 self.assertEquals(app.running, False)
75 self.assertEquals(app.running, False)
76 self.assertEquals(app.classes, [MyApp,Bar,Foo])
76 self.assertEquals(app.classes, [MyApp,Bar,Foo])
77 self.assertEquals(app.config_file, u'')
77 self.assertEquals(app.config_file, u'')
@@ -43,7 +43,7 b' from IPython.utils.traitlets import Tuple, Unicode, Type'
43
43
44 class BaseIPythonApplication(Application):
44 class BaseIPythonApplication(Application):
45
45
46 app_name = Unicode(u'ipython')
46 name = Unicode(u'ipython')
47 description = Unicode(u'IPython: an enhanced interactive Python shell.')
47 description = Unicode(u'IPython: an enhanced interactive Python shell.')
48 version = Unicode(release.version)
48 version = Unicode(release.version)
49
49
@@ -56,7 +56,7 b' class BaseIPythonApplication(Application):'
56 os.path.join(get_ipython_package_dir(), u'config', u'profile')
56 os.path.join(get_ipython_package_dir(), u'config', u'profile')
57 )
57 )
58
58
59 config_file_paths = Tuple(Unicode)
59 config_file_paths = Tuple(Unicode, Unicode, Unicode)
60 def _config_file_paths_default(self):
60 def _config_file_paths_default(self):
61 return (os.getcwdu(), self.ipython_dir, self.builtin_profile_dir)
61 return (os.getcwdu(), self.ipython_dir, self.builtin_profile_dir)
62
62
@@ -125,7 +125,8 b' class BaseIPythonApplication(Application):'
125 self.log.warn("Config file not found, skipping: %s" %
125 self.log.warn("Config file not found, skipping: %s" %
126 self.config_file_name, exc_info=True)
126 self.config_file_name, exc_info=True)
127 except:
127 except:
128 if not suppress_errors: # For testing purposes
128 # For testing purposes.
129 if not suppress_errors:
129 raise
130 raise
130 self.log.warn("Error loading config file: %s" %
131 self.log.warn("Error loading config file: %s" %
131 self.config_file_name, exc_info=True)
132 self.config_file_name, exc_info=True)
@@ -56,7 +56,7 b' class Bar(Configurable):'
56
56
57 class MyApp(Application):
57 class MyApp(Application):
58
58
59 app_name = Unicode(u'myapp')
59 name = Unicode(u'myapp')
60 running = Bool(False, config=True,
60 running = Bool(False, config=True,
61 help="Is the app running?")
61 help="Is the app running?")
62 classes = List([Bar, Foo])
62 classes = List([Bar, Foo])
General Comments 0
You need to be logged in to leave comments. Login now