Skip to content
Browse files

Fixing bugs in BaseIPythonApplication.

* app_name -> name.
* config_file_paths is properly typed.
  • Loading branch information...
1 parent 7f8de33 commit 49730bf5cebc081c9be255a981e115eeca2588a2 @ellisonbg ellisonbg committed May 18, 2011
View
2 IPython/config/application.py
@@ -70,7 +70,7 @@ class Application(SingletonConfigurable):
# The name of the application, will usually match the name of the command
# line application
- app_name = Unicode(u'application')
+ name = Unicode(u'application')
# The description of the application that is printed at the beginning
# of the help.
View
4 IPython/config/tests/test_application.py
@@ -47,7 +47,7 @@ class Bar(Configurable):
class MyApp(Application):
- app_name = Unicode(u'myapp')
+ name = Unicode(u'myapp')
running = Bool(False, config=True,
help="Is the app running?")
classes = List([Bar, Foo])
@@ -71,7 +71,7 @@ class TestApplication(TestCase):
def test_basic(self):
app = MyApp()
- self.assertEquals(app.app_name, u'myapp')
+ self.assertEquals(app.name, u'myapp')
self.assertEquals(app.running, False)
self.assertEquals(app.classes, [MyApp,Bar,Foo])
self.assertEquals(app.config_file, u'')
View
7 IPython/core/newapplication.py
@@ -43,7 +43,7 @@
class BaseIPythonApplication(Application):
- app_name = Unicode(u'ipython')
+ name = Unicode(u'ipython')
description = Unicode(u'IPython: an enhanced interactive Python shell.')
version = Unicode(release.version)
@@ -56,7 +56,7 @@ class BaseIPythonApplication(Application):
os.path.join(get_ipython_package_dir(), u'config', u'profile')
)
- config_file_paths = Tuple(Unicode)
+ config_file_paths = Tuple(Unicode, Unicode, Unicode)
def _config_file_paths_default(self):
return (os.getcwdu(), self.ipython_dir, self.builtin_profile_dir)
@@ -125,7 +125,8 @@ def load_config_file(self, suppress_errors=True):
self.log.warn("Config file not found, skipping: %s" %
self.config_file_name, exc_info=True)
except:
- if not suppress_errors: # For testing purposes
+ # For testing purposes.
+ if not suppress_errors:
raise
self.log.warn("Error loading config file: %s" %
self.config_file_name, exc_info=True)
View
2 docs/examples/core/appconfig.py
@@ -56,7 +56,7 @@ class Bar(Configurable):
class MyApp(Application):
- app_name = Unicode(u'myapp')
+ name = Unicode(u'myapp')
running = Bool(False, config=True,
help="Is the app running?")
classes = List([Bar, Foo])

0 comments on commit 49730bf

Please sign in to comment.
Something went wrong with that request. Please try again.