diff options
Diffstat (limited to 'poezio')
-rw-r--r-- | poezio/core/commands.py | 5 | ||||
-rw-r--r-- | poezio/core/core.py | 2 | ||||
-rw-r--r-- | poezio/core/handlers.py | 1 | ||||
-rw-r--r-- | poezio/plugin_manager.py | 16 | ||||
-rw-r--r-- | poezio/poezio.py | 3 | ||||
-rw-r--r-- | poezio/roster.py | 2 | ||||
-rw-r--r-- | poezio/tabs/__init__.py | 6 | ||||
-rw-r--r-- | poezio/tabs/muctab.py | 4 | ||||
-rw-r--r-- | poezio/tabs/rostertab.py | 4 | ||||
-rw-r--r-- | poezio/tabs/xmltab.py | 14 | ||||
-rw-r--r-- | poezio/windows/__init__.py | 8 |
11 files changed, 33 insertions, 32 deletions
diff --git a/poezio/core/commands.py b/poezio/core/commands.py index d44a401e..838e08fa 100644 --- a/poezio/core/commands.py +++ b/poezio/core/commands.py @@ -7,7 +7,6 @@ import logging log = logging.getLogger(__name__) import os -from datetime import datetime from xml.etree import cElementTree as ET from slixmpp.xmlstream.stanzabase import StanzaBase @@ -198,6 +197,7 @@ class CommandCore: number = int(name) except ValueError: number = -1 + name = name.lower() if number != -1 and self.core.current_tab_nb == number: return prev_nb = self.core.previous_tab_nb @@ -212,9 +212,10 @@ class CommandCore: matchs = [] for tab in self.core.tabs: for tab_name in tab.matching_names(): - if tab_name[1] and name.lower() in tab_name[1].lower(): + if tab_name[1] and name in tab_name[1].lower(): matchs.append((tab_name[0], tab)) if not matchs: + self.core.previous_tab_nb = prev_nb return tab = min(matchs, key=lambda m: m[0])[1] self.core.current_tab_nb = tab.nb diff --git a/poezio/core/core.py b/poezio/core/core.py index d14130c6..35d50b65 100644 --- a/poezio/core/core.py +++ b/poezio/core/core.py @@ -1136,7 +1136,7 @@ class Core(object): """ def read_next_digit(digit): try: - nb = int(digit) + int(digit) except ValueError: # If it is not a number, we do nothing. If it was the first # one, we do not wait for a second one by re-setting the diff --git a/poezio/core/handlers.py b/poezio/core/handlers.py index 62fc0731..e79e4232 100644 --- a/poezio/core/handlers.py +++ b/poezio/core/handlers.py @@ -23,7 +23,6 @@ from poezio import common from poezio import fixes from poezio import pep from poezio import tabs -from poezio import windows from poezio import xhtml from poezio import multiuserchat as muc from poezio.common import safeJID diff --git a/poezio/plugin_manager.py b/poezio/plugin_manager.py index 11584b23..bebf2133 100644 --- a/poezio/plugin_manager.py +++ b/poezio/plugin_manager.py @@ -271,9 +271,9 @@ class PluginManager(object): """ try: names = set() - for path in self.load_path: + for path_ in self.load_path: try: - add = set(os.listdir(path)) + add = set(os.listdir(path_)) names |= add except: pass @@ -312,9 +312,9 @@ class PluginManager(object): if not plugins_conf_dir: config_home = os.environ.get('XDG_CONFIG_HOME') if not config_home: - config_home = os.path.join(os.environ.get('HOME'), '.config') - plugins_conf_dir = os.path.join(config_home, 'poezio', 'plugins') - self.plugins_conf_dir = os.path.expanduser(plugins_conf_dir) + config_home = path.join(os.environ.get('HOME'), '.config') + plugins_conf_dir = path.join(config_home, 'poezio', 'plugins') + self.plugins_conf_dir = path.expanduser(plugins_conf_dir) self.check_create_plugins_conf_dir() def check_create_plugins_conf_dir(self): @@ -337,11 +337,11 @@ class PluginManager(object): """ plugins_dir = config.get('plugins_dir') plugins_dir = plugins_dir or\ - os.path.join(os.environ.get('XDG_DATA_HOME') or\ - os.path.join(os.environ.get('HOME'), + path.join(os.environ.get('XDG_DATA_HOME') or\ + path.join(os.environ.get('HOME'), '.local', 'share'), 'poezio', 'plugins') - self.plugins_dir = os.path.expanduser(plugins_dir) + self.plugins_dir = path.expanduser(plugins_dir) self.check_create_plugins_dir() def check_create_plugins_dir(self): diff --git a/poezio/poezio.py b/poezio/poezio.py index 784f0553..f841b672 100644 --- a/poezio/poezio.py +++ b/poezio/poezio.py @@ -13,7 +13,6 @@ Starting point of poezio. Launches both the Connection and Gui import sys import os import signal -import logging sys.path.append(os.path.dirname(os.path.abspath(__file__))) @@ -75,8 +74,6 @@ def main(): from poezio import core - log = logging.getLogger('') - signal.signal(signal.SIGINT, signal.SIG_IGN) # ignore ctrl-c cocore = core.Core() signal.signal(signal.SIGUSR1, cocore.sigusr_handler) # reload the config diff --git a/poezio/roster.py b/poezio/roster.py index ac8012cb..89925e07 100644 --- a/poezio/roster.py +++ b/poezio/roster.py @@ -244,8 +244,6 @@ class Roster(object): f.writelines([str(i) + "\n" for i in self.contacts if self[i] and (self[i].subscription == "both" or self[i].ask)]) f.close() return True - except IOError: - return False except OSError: return False diff --git a/poezio/tabs/__init__.py b/poezio/tabs/__init__.py index e6756088..01f65aa3 100644 --- a/poezio/tabs/__init__.py +++ b/poezio/tabs/__init__.py @@ -12,3 +12,9 @@ from poezio.tabs.muclisttab import MucListTab from poezio.tabs.adhoc_commands_list import AdhocCommandsListTab from poezio.tabs.data_forms import DataFormsTab from poezio.tabs.bookmarkstab import BookmarksTab + +__all__ = ['Tab', 'ChatTab', 'GapTab', 'OneToOneTab', 'STATE_PRIORITY', + 'SHOW_NAME', 'RosterInfoTab', 'MucTab', 'NS_MUC_USER', 'PrivateTab', + 'ConfirmTab', 'ConversationTab', 'StaticConversationTab', + 'DynamicConversationTab', 'XMLTab', 'ListTab', 'MucListTab', + 'AdhocCommandsListTab', 'DataFormsTab', 'BookmarksTab'] diff --git a/poezio/tabs/muctab.py b/poezio/tabs/muctab.py index f6965a75..54b7cabf 100644 --- a/poezio/tabs/muctab.py +++ b/poezio/tabs/muctab.py @@ -915,18 +915,14 @@ class MucTab(ChatTab): """ self.need_resize = False if config.get('hide_user_list') or self.size.tab_degrade_x: - display_user_list = False text_width = self.width else: - display_user_list = True text_width = (self.width // 10) * 9 if self.size.tab_degrade_y: - display_info_win = False tab_win_height = 0 info_win_height = 0 else: - display_info_win = True tab_win_height = Tab.tab_win_height() info_win_height = self.core.information_win_size diff --git a/poezio/tabs/rostertab.py b/poezio/tabs/rostertab.py index 7ec9f408..2d311012 100644 --- a/poezio/tabs/rostertab.py +++ b/poezio/tabs/rostertab.py @@ -269,8 +269,6 @@ class RosterInfoTab(Tab): """ completion for /cert_add <name> <path> [management] """ - text = the_input.get_text() - args = common.shell_split(text) n = the_input.get_argument_position() log.debug('%s %s %s', the_input.text, n, the_input.pos) if n == 1: @@ -352,8 +350,6 @@ class RosterInfoTab(Tab): """ completion for /cert_fetch <name> <path> """ - text = the_input.get_text() - args = common.shell_split(text) n = the_input.get_argument_position() log.debug('%s %s %s', the_input.text, n, the_input.pos) if n == 1: diff --git a/poezio/tabs/xmltab.py b/poezio/tabs/xmltab.py index 3fdaffc7..e92df03a 100644 --- a/poezio/tabs/xmltab.py +++ b/poezio/tabs/xmltab.py @@ -72,7 +72,7 @@ class XMLTab(Tab): shortdesc="Close this tab.") self.register_command('clear', self.command_clear, shortdesc='Clear the current buffer.') - self.register_command('reset', self.command_reset, + self.register_command('filter_reset', self.command_filter_reset, shortdesc='Reset the stanza filter.') self.register_command('filter_id', self.command_filter_id, usage='<id>', @@ -154,8 +154,8 @@ class XMLTab(Tab): self.refresh() def match_stanza(self, stanza): - for matcher in self.filters: - if not matcher.match(stanza): + for matcher_ in self.filters: + if not matcher_.match(stanza): return False return True @@ -167,7 +167,7 @@ class XMLTab(Tab): self.refresh() except Exception as e: self.core.information('Invalid XML Mask: %s' % e, 'Error') - self.command_reset('') + self.command_filter_reset('') @command_args_parser.raw def command_filter_to(self, jid): @@ -216,11 +216,11 @@ class XMLTab(Tab): self.refresh() except: self.core.information('Invalid XML Path', 'Error') - self.command_reset('') + self.command_filter_reset('') @command_args_parser.ignored - def command_reset(self): - """/reset""" + def command_filter_reset(self): + """/filter_reset""" if self.filters: self.filters = [] self.filtered_buffer.del_window(self.text_win) diff --git a/poezio/windows/__init__.py b/poezio/windows/__init__.py index 4b52d803..373349f4 100644 --- a/poezio/windows/__init__.py +++ b/poezio/windows/__init__.py @@ -19,3 +19,11 @@ from poezio.windows.muc import UserList, Topic from poezio.windows.roster_win import RosterWin, ContactInfoWin from poezio.windows.text_win import TextWin, XMLTextWin +__all__ = ['Win', 'FormWin', 'BookmarksWin', 'Dialog', 'GlobalInfoBar', + 'VerticalGlobalInfoBar', 'InfoWin', 'PrivateInfoWin', 'XMLInfoWin', + 'MucListInfoWin', 'ConversationInfoWin', 'MucInfoWin', + 'DynamicConversationInfoWin', 'ConversationStatusMessageWin', + 'BookmarksInfoWin', 'ConfirmStatusWin', 'HelpText', 'Input', + 'HistoryInput', 'MessageInput', 'CommandInput', 'ListWin', + 'ColumnHeaderWin', 'VerticalSeparator', 'UserList', 'Topic', + 'RosterWin', 'ContactInfoWin', 'TextWin', 'XMLTextWin'] |