summaryrefslogtreecommitdiff
path: root/poezio
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2016-10-21 00:20:41 +0200
committermathieui <mathieui@mathieui.net>2016-10-21 00:20:41 +0200
commit0bb67982b035a7f158a1999ed86926a71ebd3511 (patch)
tree0f34b536ffd130577d5f04ae6a5579b4acdf8e0b /poezio
parentab84756b450b24383f39793060d2057d33f05301 (diff)
downloadpoezio-0bb67982b035a7f158a1999ed86926a71ebd3511.tar.gz
poezio-0bb67982b035a7f158a1999ed86926a71ebd3511.tar.bz2
poezio-0bb67982b035a7f158a1999ed86926a71ebd3511.tar.xz
poezio-0bb67982b035a7f158a1999ed86926a71ebd3511.zip
pyflake fixes
unused variables, imports, name shadowing
Diffstat (limited to 'poezio')
-rw-r--r--poezio/core/commands.py1
-rw-r--r--poezio/core/core.py2
-rw-r--r--poezio/core/handlers.py1
-rw-r--r--poezio/plugin_manager.py16
-rw-r--r--poezio/poezio.py3
-rw-r--r--poezio/tabs/muctab.py4
-rw-r--r--poezio/tabs/rostertab.py4
-rw-r--r--poezio/tabs/xmltab.py4
8 files changed, 11 insertions, 24 deletions
diff --git a/poezio/core/commands.py b/poezio/core/commands.py
index d44a401e..c4fb6353 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
diff --git a/poezio/core/core.py b/poezio/core/core.py
index f9d30cfe..f2341ba3 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/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 9ed7a77f..e92df03a 100644
--- a/poezio/tabs/xmltab.py
+++ b/poezio/tabs/xmltab.py
@@ -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