changeset 1075:7b4600ad73ad

misc: remove some pylints warnings
author souliane <souliane@mailoo.org>
date Sun, 15 Jun 2014 18:18:36 +0200
parents a47995155e55
children a65ad0e738f7
files src/plugins/plugin_misc_text_syntaxes.py src/plugins/plugin_xep_0054.py src/test/test_plugin_xep_0277.py
diffstat 3 files changed, 5 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/src/plugins/plugin_misc_text_syntaxes.py	Sun Jun 15 16:09:30 2014 +0200
+++ b/src/plugins/plugin_misc_text_syntaxes.py	Sun Jun 15 18:18:36 2014 +0200
@@ -21,7 +21,6 @@
 from sat.core.log import getLogger
 log = getLogger(__name__)
 
-from wokkel import disco, pubsub
 from twisted.internet import defer
 from twisted.internet.threads import deferToThread
 from sat.core import exceptions
--- a/src/plugins/plugin_xep_0054.py	Sun Jun 15 16:09:30 2014 +0200
+++ b/src/plugins/plugin_xep_0054.py	Sun Jun 15 18:18:36 2014 +0200
@@ -126,14 +126,14 @@
             if name == "avatar":
                 self.avatars_cache[jid.userhost()] = value
 
-    def get_cache(self, jid, name, profile):
+    def get_cache(self, entity_jid, name, profile):
         """return cached value for jid
-        @param jid: target contact
+        @param entity_jid: target contact
         @param name: name of the value ('nick' or 'avatar')
         @param profile: %(doc_profile)s
         @return: wanted value or None"""
         try:
-            data = self.host.memory.getEntityData(jid, [name], profile)
+            data = self.host.memory.getEntityData(entity_jid, [name], profile)
         except exceptions.UnknownEntityError:
             return None
         return data.get(name)
@@ -149,8 +149,8 @@
                 image_hash = sha1(decoded).hexdigest()
                 filename = self.avatar_path + '/' + image_hash
                 if not os.path.exists(filename):
-                    with open(filename, 'wb') as file:
-                        file.write(decoded)
+                    with open(filename, 'wb') as file_:
+                        file_.write(decoded)
                     log.debug(_("file saved to %s") % image_hash)
                 else:
                     log.debug(_("file [%s] already in cache") % image_hash)
--- a/src/test/test_plugin_xep_0277.py	Sun Jun 15 16:09:30 2014 +0200
+++ b/src/test/test_plugin_xep_0277.py	Sun Jun 15 18:18:36 2014 +0200
@@ -23,7 +23,6 @@
 from sat.plugins import plugin_xep_0277
 from sat.plugins import plugin_misc_text_syntaxes
 from sat.tools.xml_tools import ElementParser
-import re
 
 
 class XEP_0277Test(helpers.SatTestCase):