Make ipython accept paths, not a single path
This commit is contained in:
parent
8de14c1fd7
commit
17b32b1765
|
@ -104,8 +104,8 @@ use ``c.Powerline.KEY``. Supported ``KEY`` strings or keyword argument names:
|
|||
a dictionary where keys are theme names and values are dictionaries which
|
||||
will be recursively merged with the contents of the given theme.
|
||||
|
||||
``path``
|
||||
Sets directory where configuration should be read from. If present, no
|
||||
``paths``
|
||||
Sets directories where configuration should be read from. If present, no
|
||||
default locations are searched for configuration. No expansions are
|
||||
performed thus you cannot use paths starting with ``~/``.
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@ class ConfigurableIpythonPowerline(IpythonPowerline):
|
|||
config = ip.config.Powerline
|
||||
self.config_overrides = config.get('config_overrides')
|
||||
self.theme_overrides = config.get('theme_overrides', {})
|
||||
self.path = config.get('path')
|
||||
self.paths = config.get('paths')
|
||||
super(ConfigurableIpythonPowerline, self).__init__(is_prompt)
|
||||
|
||||
|
||||
|
|
|
@ -82,10 +82,10 @@ class PowerlinePrompt2(PowerlinePromptOut):
|
|||
|
||||
|
||||
class ConfigurableIpythonPowerline(IpythonPowerline):
|
||||
def __init__(self, is_prompt, config_overrides=None, theme_overrides={}, path=None):
|
||||
def __init__(self, is_prompt, config_overrides=None, theme_overrides={}, paths=None):
|
||||
self.config_overrides = config_overrides
|
||||
self.theme_overrides = theme_overrides
|
||||
self.path = path
|
||||
self.paths = paths
|
||||
super(ConfigurableIpythonPowerline, self).__init__(is_prompt)
|
||||
|
||||
|
||||
|
|
|
@ -31,8 +31,8 @@ class IpythonPowerline(Powerline):
|
|||
)
|
||||
|
||||
def get_config_paths(self):
|
||||
if self.path:
|
||||
return [self.path]
|
||||
if self.paths:
|
||||
return self.paths
|
||||
else:
|
||||
return super(IpythonPowerline, self).get_config_paths()
|
||||
|
||||
|
|
|
@ -112,7 +112,7 @@ class TestConfig(TestCase):
|
|||
from powerline.ipython import IpythonPowerline
|
||||
|
||||
class IpyPowerline(IpythonPowerline):
|
||||
path = None
|
||||
paths = None
|
||||
config_overrides = None
|
||||
theme_overrides = {}
|
||||
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
import os
|
||||
c = get_config()
|
||||
c.InteractiveShellApp.extensions = ['powerline.bindings.ipython.post_0_11']
|
||||
c.TerminalInteractiveShell.autocall = 1
|
||||
c.Powerline.paths = [os.path.abspath('powerline/config_files')]
|
||||
c.Powerline.theme_overrides = {
|
||||
'in': {
|
||||
'segment_data': {
|
||||
|
|
Loading…
Reference in New Issue