MCPcopy Create free account
hub / github.com/ipython/ipython / BaseIPythonApplication

Class BaseIPythonApplication

IPython/core/application.py:102–462  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

100 return super(ProfileAwareConfigLoader, self).load_subconfig(fname, path=path)
101
102class BaseIPythonApplication(Application):
103
104 name = u'ipython'
105 description = Unicode(u'IPython: an enhanced interactive Python shell.')
106 version = Unicode(release.version)
107
108 aliases = base_aliases
109 flags = base_flags
110 classes = List([ProfileDir])
111
112 # enable `load_subconfig('cfg.py', profile='name')`
113 python_config_loader_class = ProfileAwareConfigLoader
114
115 # Track whether the config_file has changed,
116 # because some logic happens only if we aren't using the default.
117 config_file_specified = Set()
118
119 config_file_name = Unicode()
120 @default('config_file_name')
121 def _config_file_name_default(self):
122 return self.name.replace('-','_') + u'_config.py'
123 @observe('config_file_name')
124 def _config_file_name_changed(self, change):
125 if change['new'] != change['old']:
126 self.config_file_specified.add(change['new'])
127
128 # The directory that contains IPython's builtin profiles.
129 builtin_profile_dir = Unicode(
130 os.path.join(get_ipython_package_dir(), u'config', u'profile', u'default')
131 )
132
133 config_file_paths = List(Unicode())
134 @default('config_file_paths')
135 def _config_file_paths_default(self):
136 return [os.getcwd()]
137
138 extra_config_file = Unicode(
139 help="""Path to an extra config file to load.
140
141 If specified, load this config file in addition to any other IPython config.
142 """).tag(config=True)
143 @observe('extra_config_file')
144 def _extra_config_file_changed(self, change):
145 old = change['old']
146 new = change['new']
147 try:
148 self.config_files.remove(old)
149 except ValueError:
150 pass
151 self.config_file_specified.add(new)
152 self.config_files.append(new)
153
154 profile = Unicode(u'default',
155 help="""The IPython profile to use."""
156 ).tag(config=True)
157
158 @observe('profile')
159 def _profile_changed(self, change):

Callers 2

test_unicode_cwdFunction · 0.90
test_unicode_ipdirFunction · 0.90

Calls 1

get_ipython_package_dirFunction · 0.90

Tested by 2

test_unicode_cwdFunction · 0.72
test_unicode_ipdirFunction · 0.72