Minor code improvements
This commit is contained in:
@@ -1 +1,2 @@
|
||||
from .functions import *
|
||||
from .inkycal_exceptions import *
|
||||
|
@@ -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
|
||||
"""
|
||||
|
||||
|
16
inkycal/custom/inkycal_exceptions.py
Normal file
16
inkycal/custom/inkycal_exceptions.py
Normal 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)
|
Reference in New Issue
Block a user