Use the new config.get_default_config_dir() in plugin_manager.
This commit is contained in:
parent
b80bb2fcfc
commit
7978481edf
1 changed files with 4 additions and 6 deletions
|
@ -327,11 +327,9 @@ class PluginManager(object):
|
||||||
"""
|
"""
|
||||||
plugins_conf_dir = config.get('plugins_conf_dir')
|
plugins_conf_dir = config.get('plugins_conf_dir')
|
||||||
if not plugins_conf_dir:
|
if not plugins_conf_dir:
|
||||||
config_home = os.environ.get('XDG_CONFIG_HOME')
|
self.plugins_conf_dir = config.get_default_config_dir() / 'plugins'
|
||||||
if not config_home:
|
else:
|
||||||
config_home = path.join(os.environ.get('HOME'), '.config')
|
self.plugins_conf_dir = Path(plugins_conf_dir).expanduser()
|
||||||
plugins_conf_dir = path.join(config_home, 'poezio', 'plugins')
|
|
||||||
self.plugins_conf_dir = path.expanduser(plugins_conf_dir)
|
|
||||||
self.check_create_plugins_conf_dir()
|
self.check_create_plugins_conf_dir()
|
||||||
|
|
||||||
def check_create_plugins_conf_dir(self):
|
def check_create_plugins_conf_dir(self):
|
||||||
|
@ -341,7 +339,7 @@ class PluginManager(object):
|
||||||
"""
|
"""
|
||||||
if not os.access(self.plugins_conf_dir, os.R_OK | os.X_OK):
|
if not os.access(self.plugins_conf_dir, os.R_OK | os.X_OK):
|
||||||
try:
|
try:
|
||||||
os.makedirs(self.plugins_conf_dir)
|
self.plugins_conf_dir.mkdir(parents=True, exist_ok=True)
|
||||||
except OSError:
|
except OSError:
|
||||||
log.error(
|
log.error(
|
||||||
'Unable to create the plugin conf dir: %s',
|
'Unable to create the plugin conf dir: %s',
|
||||||
|
|
Loading…
Reference in a new issue