summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--plugins/status.py2
-rw-r--r--src/core.py1
-rw-r--r--src/logger.py1
-rw-r--r--src/plugin.py7
-rw-r--r--src/plugin_manager.py1
-rw-r--r--src/theming.py7
-rw-r--r--src/windows.py6
7 files changed, 21 insertions, 4 deletions
diff --git a/plugins/status.py b/plugins/status.py
index 7eb27cb5..71b2315d 100644
--- a/plugins/status.py
+++ b/plugins/status.py
@@ -17,5 +17,5 @@ class Plugin(BasePlugin):
'/afk [status message]\nAfk: Set your status as afk (away from keyboard).')
self.add_command('away', lambda line: self.core.command_status('away '+line),
'/away [status message]\nAway: Set your status as away.')
- self.add_command('away', lambda line: self.core.command_status('away '+line),
+ self.add_command('available', lambda line: self.core.command_status('available '+line),
'/available [status message]\nAvailable: Set your status as available.')
diff --git a/src/core.py b/src/core.py
index 311c187d..6bfb4c63 100644
--- a/src/core.py
+++ b/src/core.py
@@ -1340,6 +1340,7 @@ class Core(object):
os.path.join(os.environ.get('XDG_DATA_HOME') or\
os.path.join(os.environ.get('HOME'), '.local', 'share'),
'poezio', 'themes')
+ themes_dir = os.path.expanduser(themes_dir)
try:
names = os.listdir(themes_dir)
except OSError as e:
diff --git a/src/logger.py b/src/logger.py
index bd24eb3b..4f6768cf 100644
--- a/src/logger.py
+++ b/src/logger.py
@@ -16,6 +16,7 @@ import logging
log = logging.getLogger(__name__)
DATA_HOME = config.get('log_dir', '') or os.path.join(environ.get('XDG_DATA_HOME') or os.path.join(environ.get('HOME'), '.local', 'share'), 'poezio')
+DATA_HOME = os.path.expanduser(DATA_HOME)
class Logger(object):
"""
diff --git a/src/plugin.py b/src/plugin.py
index 7d1aeb4b..f35bdab1 100644
--- a/src/plugin.py
+++ b/src/plugin.py
@@ -27,6 +27,13 @@ class PluginConfig(config.Config):
if not self.has_section(self.module_name):
self.add_section(self.module_name)
+ def options(self, section=None):
+ if not section:
+ section = self.module_name
+ if not self.has_section(section):
+ self.add_section(section)
+ return config.Config.options(self, section)
+
def write(self):
"""Write the config to the disk"""
try:
diff --git a/src/plugin_manager.py b/src/plugin_manager.py
index e3b786cb..6d3fb05a 100644
--- a/src/plugin_manager.py
+++ b/src/plugin_manager.py
@@ -10,6 +10,7 @@ plugins_dir = plugins_dir or\
os.path.join(os.environ.get('XDG_DATA_HOME') or\
os.path.join(os.environ.get('HOME'), '.local', 'share'),
'poezio', 'plugins')
+plugins_dir = os.path.expanduser(plugins_dir)
config_home = os.environ.get("XDG_CONFIG_HOME")
if not config_home:
diff --git a/src/theming.py b/src/theming.py
index 0fe45d59..7b653d66 100644
--- a/src/theming.py
+++ b/src/theming.py
@@ -94,6 +94,12 @@ class Theme(object):
# in the user list
CHAR_STATUS = '|'
+ # The characters used for the chatstates in the user list
+ # in a MUC
+ CHAR_CHATSTATE_ACTIVE = 'A'
+ CHAR_CHATSTATE_COMPOSING = 'X'
+ CHAR_CHATSTATE_PAUSED = 'p'
+
# Separators
COLOR_VERTICAL_SEPARATOR = (4, -1)
COLOR_NEW_TEXT_SEPARATOR = (2, -1)
@@ -246,6 +252,7 @@ def reload_theme():
os.path.join(os.environ.get('XDG_DATA_HOME') or\
os.path.join(os.environ.get('HOME'), '.local', 'share'),
'poezio', 'themes')
+ themes_dir = os.path.expanduser(themes_dir)
try:
os.makedirs(themes_dir)
except OSError:
diff --git a/src/windows.py b/src/windows.py
index 54cf82af..8b723b1e 100644
--- a/src/windows.py
+++ b/src/windows.py
@@ -233,11 +233,11 @@ class UserList(Win):
else:
show_col = self.color_show[user.show]()
if user.chatstate == 'composing':
- char = 'X'
+ char = get_theme().CHAR_CHATSTATE_COMPOSING
elif user.chatstate == 'active':
- char = 'A'
+ char = get_theme().CHAR_CHATSTATE_ACTIVE
elif user.chatstate == 'paused':
- char = 'p'
+ char = get_theme().CHAR_CHATSTATE_PAUSED
else:
char = get_theme().CHAR_STATUS
self.addstr(y, 0, char, to_curses_attr(show_col))