Philipp Hörist pushed to branch master at gajim / gajim


Commits:
246e5090 by lovetox at 2022-06-17T16:26:02+02:00
chore: Fix codestyle errors

- - - - -


7 changed files:

- gajim/common/modules/bits_of_binary.py
- gajim/common/modules/contacts.py
- gajim/common/modules/httpupload.py
- gajim/common/modules/ibb.py
- gajim/common/modules/jingle.py
- gajim/common/modules/misc.py
- gajim/common/modules/user_avatar.py


Changes:

=====================================
gajim/common/modules/bits_of_binary.py
=====================================
@@ -86,6 +86,7 @@ def _on_bob_received(self,
                     args = func[1]
                     pos = func[2]
                     bob_data = data.getData()
+
                     def recurs(node, cid, data):
                         if node.getData() == 'cid:' + cid:
                             node.setData(data)


=====================================
gajim/common/modules/contacts.py
=====================================
@@ -62,21 +62,23 @@ def __init__(self, account: str, jid: JID) -> None:
         self._jid = jid
 
     @overload
-    def get(self, setting: StringGroupChatSettings) -> str: ...
+    def get(self, setting: StringGroupChatSettings) -> str: ...  # noqa: E704
     @overload
-    def get(self, setting: BoolGroupChatSettings) -> bool: ...
+    def get(self, setting: BoolGroupChatSettings) -> bool: ...  # noqa: E704
     @overload
-    def get(self, setting: IntGroupChatSettings) -> int: ...
+    def get(self, setting: IntGroupChatSettings) -> int: ...  # noqa: E704
+
     def get(self, setting: Any) -> Any:
         return app.settings.get_group_chat_setting(
             self._account, self._jid, setting)
 
     @overload
-    def set(self, setting: StringGroupChatSettings, value: str) -> None: ...
+    def set(self, setting: StringGroupChatSettings, value: str) -> None: ...  
# noqa: E501, E704
     @overload
-    def set(self, setting: BoolGroupChatSettings, value: bool) -> None: ...
+    def set(self, setting: BoolGroupChatSettings, value: bool) -> None: ...  # 
noqa: E501, E704
     @overload
-    def set(self, setting: IntGroupChatSettings, value: int) -> None: ...
+    def set(self, setting: IntGroupChatSettings, value: int) -> None: ...  # 
noqa: E501, E704
+
     def set(self, setting: Any, value: Any) -> None:
         app.settings.set_group_chat_setting(
             self._account, self._jid, setting, value)


=====================================
gajim/common/modules/httpupload.py
=====================================
@@ -251,6 +251,7 @@ def _check_certificate(self,
         if app.cert_store.verify(tls_certificate, tls_errors):
             return
 
+        phrase = ''
         for error in tls_errors:
             phrase = get_tls_error_phrase(error)
             self._log.warning('TLS verification failed: %s', phrase)
@@ -273,7 +274,6 @@ def _on_finish(self,
             self._log.info('Upload completed successfully')
             transfer.set_finished()
 
-
         else:
             phrase = Soup.Status.get_phrase(message.props.status_code)
             self._log.error('Got unexpected http upload response code: %s',
@@ -416,7 +416,7 @@ def _close(self) -> None:
     def get_chunk(self) -> Optional[bytes]:
         if self._stream is None:
             if self._encryption is None:
-                self._stream = open(self._path, 'rb')  # pylint: 
disable=consider-using-with
+                self._stream = open(self._path, 'rb')  # pylint: 
disable=consider-using-with  # noqa: E501
             else:
                 self._stream = io.BytesIO(self._data)
 


=====================================
gajim/common/modules/ibb.py
=====================================
@@ -97,7 +97,7 @@ def _ibb_received(self,
             file_props.disconnect_cb = None
             file_props.continue_cb = None
             file_props.syn_id = stanza.getID()
-            file_props.fp = open(file_props.file_name, 'wb')  # pylint: 
disable=consider-using-with
+            file_props.fp = open(file_props.file_name, 'wb')  # pylint: 
disable=consider-using-with  # noqa: E501
             self.send_reply(stanza)
 
         elif properties.ibb.type == 'close':


=====================================
gajim/common/modules/jingle.py
=====================================
@@ -16,7 +16,7 @@
 Handles the jingle signalling protocol
 """
 
-#TODO:
+# TODO:
 # * things in XEP 0176, including:
 #      - http://xmpp.org/extensions/xep-0176.html#protocol-restarts
 #      - http://xmpp.org/extensions/xep-0176.html#fallback
@@ -94,7 +94,7 @@ def delete_jingle_session(self, sid: str) -> None:
         Remove a jingle session from a jingle stanza dispatcher
         """
         if sid in self._sessions:
-            #FIXME: Move this elsewhere?
+            # FIXME: Move this elsewhere?
             for content in list(self._sessions[sid].contents.values()):
                 content.destroy()
             self._sessions[sid].callbacks = []
@@ -159,7 +159,7 @@ def _on_jingle_iq(self,
 
         # do we need to create a new jingle object
         if sid not in self._sessions:
-            #TODO: tie-breaking and other things...
+            # TODO: tie-breaking and other things...
             newjingle = JingleSession(self._con, weinitiate=False, jid=jid,
                                       iq_id=id_, sid=sid)
             self._sessions[sid] = newjingle
@@ -313,8 +313,8 @@ def get_file_info(self,
                       _account: Optional[str] = None
                       ) -> Optional[dict[str, Any]]:
         if hash_:
-            for file in self.files: # DEBUG
-                #if f['hash'] == '1294809248109223':
+            for file in self.files:  # DEBUG
+                # if f['hash'] == '1294809248109223':
                 if file['hash'] == hash_ and file['peerjid'] == peerjid:
                     return file
         elif name:


=====================================
gajim/common/modules/misc.py
=====================================
@@ -25,6 +25,7 @@
 
 log = logging.getLogger('gajim.c.m.misc')
 
+
 # XEP-0066: Out of Band Data
 def parse_oob(properties: MessageProperties,
               additional_data: AdditionalDataDict


=====================================
gajim/common/modules/user_avatar.py
=====================================
@@ -31,6 +31,7 @@
 from gajim.common.modules.util import event_node
 from gajim.common.modules.util import as_task
 
+
 class UserAvatar(BaseModule):
 
     _nbxmpp_extends = 'UserAvatar'



View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/commit/246e509049b365076f55547d8f8b090ff03594c5

-- 
View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/commit/246e509049b365076f55547d8f8b090ff03594c5
You're receiving this email because of your account on dev.gajim.org.


_______________________________________________
Commits mailing list
Commits@gajim.org
https://lists.gajim.org/cgi-bin/listinfo/commits

Reply via email to