summaryrefslogtreecommitdiff
path: root/plugins/alias.py
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2014-04-20 17:35:16 +0200
committermathieui <mathieui@mathieui.net>2014-04-20 17:35:16 +0200
commit93594b8453626be4e7c620ee2ce1d3529ed8e66c (patch)
treeefbe38e87a01c558cd8ee9b46df3621f7d31d958 /plugins/alias.py
parent3622443631bbb901baaa75552e2021ae0b2798e6 (diff)
downloadpoezio-93594b8453626be4e7c620ee2ce1d3529ed8e66c.tar.gz
poezio-93594b8453626be4e7c620ee2ce1d3529ed8e66c.tar.bz2
poezio-93594b8453626be4e7c620ee2ce1d3529ed8e66c.tar.xz
poezio-93594b8453626be4e7c620ee2ce1d3529ed8e66c.zip
Do not reload unaliased aliases
TODO: implement the remove_option method from configparser
Diffstat (limited to 'plugins/alias.py')
-rw-r--r--plugins/alias.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/plugins/alias.py b/plugins/alias.py
index e52c8d5f..490605e5 100644
--- a/plugins/alias.py
+++ b/plugins/alias.py
@@ -91,7 +91,8 @@ class Plugin(BasePlugin):
"""
for alias in self.config.options():
full = self.config.get(alias, '')
- self.command_alias(alias + ' ' + full)
+ if full:
+ self.command_alias(alias + ' ' + full)
def command_alias(self, line):
"""
@@ -128,6 +129,8 @@ class Plugin(BasePlugin):
if alias in self.commands:
del self.commands[alias]
self.api.del_command(alias)
+ self.config.set(alias, '')
+ self.config.write()
self.api.information('Alias /%s successfuly deleted' % alias, 'Info')
def completion_unalias(self, the_input):