Browse Source

corrected errors in the exceptions file and made it pep8 clean

Helmut Pozimski 10 năm trước cách đây
mục cha
commit
1236f1ab79
1 tập tin đã thay đổi với 21 bổ sung13 xóa
  1. 21 13
      lib_stov/stov_exceptions.py

+ 21 - 13
lib_stov/stov_exceptions.py

@@ -40,7 +40,8 @@ class DBWriteAccessFailedException(Exception):
 
     def __init__(self):
         self.__message = _("Write access to the database failed, please check"
-                            "file permissions and the file system and try again!")
+                           "file permissions and the file system and try"
+                           " again!")
 
     def __str__(self):
         return self.__message
@@ -53,8 +54,8 @@ class SubscriptionNotFoundException(Exception):
     """
 
     def __init__(self):
-        self.__message = _("The subscription you requested could not be found in "
-                            "the database, requested action aborted.")
+        self.__message = _("The subscription you requested could not be "
+                           "found in the database, requested action aborted.")
 
     def __str__(self):
         return self.__message
@@ -68,21 +69,23 @@ class NoDataFromYoutubeAPIException(Exception):
 
     def __init__(self):
         self.__message = _("The connection to the youtube API failed or "
-                            "no data was returned.")
+                           "no data was returned.")
 
     def __str__(self):
         return self.__message
 
+
 class YoutubeAPITimeoutException(Exception):
     """This exception will be raised when an API request times out"""
 
     def __init__(self, title):
         self.__message = _("The API Request timed out for subscription %s,"
-                            "please try again later") % title
+                           "please try again later") % title
 
     def __str__(self):
         return self.__message
 
+
 class ConfigFileWriteErrorException(Exception):
     """This exception will be raised when a write access to the configuration
     file fails.
@@ -90,24 +93,26 @@ class ConfigFileWriteErrorException(Exception):
     """
     def __init__(self):
         self.__message = _("The configuration could not be written, please"
-                            "check that the configuration direcroty exists"
-                            "and is writable.")
+                           "check that the configuration direcroty exists"
+                           "and is writable.")
 
     def __str__(self):
         return self.__message
 
+
 class DirectoryCreationFailedException(Exception):
     """This exception will be raised when the creation of a directory failed.
 
     """
     def __init__(self):
         self.__message = _("The directory could not be created, "
-                "please check that the parent directory exists and is"
-                " writable")
+                           "please check that the parent directory "
+                           "exists and is writable")
 
     def __str__(self):
         return self.__message
 
+
 class ConfigFileReadErrorException(Exception):
     """This exception will be raised when the configuration file couldn't be
     opened for reading
@@ -115,11 +120,13 @@ class ConfigFileReadErrorException(Exception):
     """
     def __init__(self):
         self.__message = _("The configuration could not be read, please check "
-                           "that the configuration file exists and is readable")
+                           "that the configuration file exists and is "
+                           "readable")
 
     def __str__(self):
         return self.__message
 
+
 class InvalidConfigurationVersionException(Exception):
     """This exception will be raised when an invalid configuration version
     is detected.
@@ -131,6 +138,7 @@ class InvalidConfigurationVersionException(Exception):
     def __str__(self):
         return self.__message
 
+
 class SubscriptionDisabledException(Exception):
     """This exception will be raised when an exception is disabled and
     a requested action is not taken because of this fact.
@@ -143,6 +151,7 @@ class SubscriptionDisabledException(Exception):
     def __str__(self):
         return self.__message
 
+
 class DownloadDirectoryCreationFailedException(Exception):
     """This exception will be raised when the creation of a subscription
     directory to download a video failed.
@@ -150,9 +159,8 @@ class DownloadDirectoryCreationFailedException(Exception):
     """
     def __init__(self):
         self.__message = _("Download directory does not exist and can't be "
-                           "created. Please check your configuration and try again")
+                           "created. Please check your configuration and try "
+                           "again")
 
     def __str__(self):
         return self.__message
-
-