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


Commits:
2dc8242d by lovetox at 2021-12-27T21:06:43+01:00
Exceptions: Add type annotations

- - - - -
dac20658 by lovetox at 2021-12-27T21:07:58+01:00
Remove unused imports

- - - - -


3 changed files:

- gajim/common/exceptions.py
- gajim/common/types.py
- pyrightconfig.json


Changes:

=====================================
gajim/common/exceptions.py
=====================================
@@ -25,10 +25,10 @@ class ServiceNotAvailable(Exception):
     This exception is raised when we cannot use Gajim remotely'
     """
 
-    def __init__(self):
+    def __init__(self) -> None:
         Exception.__init__(self)
 
-    def __str__(self):
+    def __str__(self) -> str:
         return _('Service not available: Gajim is not running, or 
remote_control is False')
 
 
@@ -37,10 +37,10 @@ class SessionBusNotPresent(Exception):
     This exception indicates that there is no session daemon
     """
 
-    def __init__(self):
+    def __init__(self) -> None:
         Exception.__init__(self)
 
-    def __str__(self):
+    def __str__(self) -> str:
         return _('Session bus is not available.\nTry reading %(url)s') % \
                 {'url': 
'https://dev.gajim.org/gajim/gajim/wikis/help/GajimDBus'}
 
@@ -50,11 +50,11 @@ class GajimGeneralException(Exception):
     This exception is our general exception
     """
 
-    def __init__(self, text=''):
+    def __init__(self, text: str = '') -> None:
         Exception.__init__(self)
         self.text = text
 
-    def __str__(self):
+    def __str__(self) -> str:
         return self.text
 
 
@@ -63,11 +63,11 @@ class PluginsystemError(Exception):
     Error in the pluginsystem
     """
 
-    def __init__(self, text=''):
+    def __init__(self, text: str = '') -> None:
         Exception.__init__(self)
         self.text = text
 
-    def __str__(self):
+    def __str__(self) -> str:
         return self.text
 
 


=====================================
gajim/common/types.py
=====================================
@@ -23,7 +23,6 @@
 from typing import Union
 from typing import TYPE_CHECKING
 
-from pathlib import Path
 import weakref
 
 from gi.repository import GdkPixbuf
@@ -32,8 +31,6 @@
 from nbxmpp.protocol import JID
 from nbxmpp.structs import BookmarkData
 
-from gajim.common.const import PathType, PathLocation
-
 if TYPE_CHECKING:
     # pylint: disable=unused-import
     from gajim.common.client import Client


=====================================
pyrightconfig.json
=====================================
@@ -16,6 +16,7 @@
         "gajim/common/cert_store.py",
         "gajim/common/configpaths.py",
         "gajim/common/const.py",
+        "gajim/common/exceptions.py",
         "gajim/common/ged.py",
         "gajim/common/i18n.py",
         "gajim/common/logging_helpers.py",



View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/compare/00da2416ac1caf71e27338a4b29a84aa8a197f3a...dac2065844afe16ad00ce677a5c2a51168b4d8f7

-- 
View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/compare/00da2416ac1caf71e27338a4b29a84aa8a197f3a...dac2065844afe16ad00ce677a5c2a51168b4d8f7
You're receiving this email because of your account on dev.gajim.org.


_______________________________________________
Commits mailing list
[email protected]
https://lists.gajim.org/cgi-bin/listinfo/commits

Reply via email to