Minor code improvements

This commit is contained in:
aceisace
2022-04-10 06:35:08 +02:00
parent f452135b42
commit 5cd04bda04
16 changed files with 84 additions and 95 deletions

View File

@@ -1 +1,2 @@
from .functions import *
from .inkycal_exceptions import *

View File

@@ -243,7 +243,7 @@ def internet_available():
Returned output can be used to add a check for internet availability:
>>> if internet_available() == True:
>>> if internet_available():
>>> #...do something that requires internet connectivity
"""

View File

@@ -0,0 +1,16 @@
#!python3
"""
Inkycal custom Exceptions
"""
class SettingsFileNotFoundError(Exception):
def __init__(self, message="Inkycal could not find a settings.json file. Please check the settings-file path"):
self.message = message
super().__init__(self.message)
class NetworkNotReachableError(Exception):
def __init__(self, message="Inkycal could not establish a connection to the web"):
self.message = message
super().__init__(self.message)