Rename exceptions to custom_exceptions (because exceptions screws up pylint)
authorHugh Brown <hbrown@amplify.com>
Fri, 11 Oct 2013 00:04:44 +0000 (20:04 -0400)
committerHugh Brown <hbrown@amplify.com>
Fri, 11 Oct 2013 00:04:44 +0000 (20:04 -0400)
13 files changed:
jenkinsapi/__init__.py
jenkinsapi/api.py
jenkinsapi/artifact.py
jenkinsapi/build.py
jenkinsapi/custom_exceptions.py [new file with mode: 0644]
jenkinsapi/exceptions.py [deleted file]
jenkinsapi/fingerprint.py
jenkinsapi/invocation.py
jenkinsapi/jenkins.py
jenkinsapi/jenkinsbase.py
jenkinsapi/job.py
jenkinsapi/nodes.py
jenkinsapi/queue.py

index 5e9bac36e59e820f5172f0635db039e629ba3dba..f6810dae602e6f73eb4ec81f070231957a45168c 100644 (file)
@@ -52,13 +52,13 @@ from jenkinsapi import (
     utils,
 
     # Files
-    api, artifact, build, config, constants, exceptions, fingerprint,
+    api, artifact, build, config, constants, custom_exceptions, fingerprint,
     jenkins, jenkinsbase, job, node, result_set, result, view
 )
 
 __all__ = [
     "command_line", "utils",
-    "api", "artifact", "build", "config", "constants", "exceptions", "fingerprint",
+    "api", "artifact", "build", "config", "constants", "custom_exceptions", "fingerprint",
     "jenkins", "jenkinsbase", "job", "node", "result_set", "result", "view"
 ]
 __docformat__ = "epytext"
index 53efb77cbf2c839bbfb942783cafc01428b1a62b..108b567c97f3c06433b7baed177546e2ad8a0003 100644 (file)
@@ -10,7 +10,7 @@ from urllib2 import urlparse
 from jenkinsapi import constants
 from jenkinsapi.jenkins import Jenkins
 from jenkinsapi.artifact import Artifact
-from jenkinsapi.exceptions import ArtifactsMissing, TimeOut, BadURL
+from jenkinsapi.custom_exceptions import ArtifactsMissing, TimeOut, BadURL
 
 log = logging.getLogger(__name__)
 
index 4ac0acf85b044aeb333e42cbf8b9fe03528c93b8..b84dac91a628541ef3bca93058e9764dbd7f70ad 100644 (file)
@@ -12,7 +12,7 @@ import logging
 import hashlib
 
 from jenkinsapi.fingerprint import Fingerprint
-from jenkinsapi.exceptions import ArtifactBroken
+from jenkinsapi.custom_exceptions import ArtifactBroken
 
 log = logging.getLogger(__name__)
 
index f18427c32a45bb6ff3f14ecb33a4359a835d5253..3088555c50d7f115bbfee6a31d77ad543280df5d 100644 (file)
@@ -8,7 +8,7 @@ import datetime
 from jenkinsapi.artifact import Artifact
 from jenkinsapi import config
 from jenkinsapi.jenkinsbase import JenkinsBase
-from jenkinsapi.exceptions import NoResults
+from jenkinsapi.custom_exceptions import NoResults
 from jenkinsapi.constants import STATUS_SUCCESS
 from jenkinsapi.result_set import ResultSet
 
diff --git a/jenkinsapi/custom_exceptions.py b/jenkinsapi/custom_exceptions.py
new file mode 100644 (file)
index 0000000..bb88d56
--- /dev/null
@@ -0,0 +1,127 @@
+"""
+Module for custom_exceptions specialized for jenkinsapi
+"""
+
+
+class JenkinsAPIException(Exception):
+    """
+    Base class for all errors
+    """
+    pass
+
+class NotFound(JenkinsAPIException):
+    """
+    Resource cannot be found
+    """
+    pass
+
+
+class ArtifactsMissing(NotFound):
+    """
+    Cannot find a build with all of the required artifacts.
+    """
+    pass
+
+
+class UnknownJob(KeyError, NotFound):
+    """
+    Jenkins does not recognize the job requested.
+    """
+    pass
+
+
+class UnknownView(KeyError, NotFound):
+    """
+    Jenkins does not recognize the view requested.
+    """
+    pass
+
+
+class UnknownNode(KeyError, NotFound):
+    """
+    Jenkins does not recognize the node requested.
+    """
+    pass
+
+
+class UnknownQueueItem(KeyError, NotFound):
+    """
+    Jenkins does not recognize the requested queue item
+    """
+    pass
+
+
+class NoBuildData(NotFound):
+    """
+    A job has no build data.
+    """
+    pass
+
+
+class ArtifactBroken(JenkinsAPIException):
+    """
+    An artifact is broken, wrong
+    """
+    pass
+
+
+class TimeOut(JenkinsAPIException):
+    """
+    Some jobs have taken too long to complete.
+    """
+    pass
+
+
+class WillNotBuild(JenkinsAPIException):
+    """
+    Cannot trigger a new build.
+    """
+    pass
+
+
+class NoResults(JenkinsAPIException):
+    """
+    A build did not publish any results.
+    """
+    pass
+
+
+class FailedNoResults(NoResults):
+    """
+    A build did not publish any results because it failed
+    """
+    pass
+
+
+class BadURL(ValueError, JenkinsAPIException):
+    """
+    A URL appears to be broken
+    """
+    pass
+
+
+class NotAuthorized(JenkinsAPIException):
+    """Not Authorized to access resource"""
+    # Usually thrown when we get a 403 returned
+    pass
+
+
+class NotSupportSCM(JenkinsAPIException):
+    """
+    It's a SCM that does not supported by current version of jenkinsapi
+    """
+    pass
+
+
+class NotConfiguredSCM(JenkinsAPIException):
+    """
+    It's a job that doesn't have configured SCM
+    """
+    pass
+
+
+class NotInQueue(JenkinsAPIException):
+    """
+    It's a job that is not in the queue
+    """
+    pass
diff --git a/jenkinsapi/exceptions.py b/jenkinsapi/exceptions.py
deleted file mode 100644 (file)
index 48539cc..0000000
+++ /dev/null
@@ -1,110 +0,0 @@
-"""
-Module for exceptions specialized for jenkinsapi
-"""
-
-
-class JenkinsAPIException(Exception):
-    """
-    Base class for all errors
-    """
-
-
-class NotFound(JenkinsAPIException):
-    """
-    Resource cannot be found
-    """
-
-
-class ArtifactsMissing(NotFound):
-    """
-    Cannot find a build with all of the required artifacts.
-    """
-
-
-class UnknownJob(KeyError, NotFound):
-    """
-    Jenkins does not recognize the job requested.
-    """
-
-
-class UnknownView(KeyError, NotFound):
-    """
-    Jenkins does not recognize the view requested.
-    """
-
-
-class UnknownNode(KeyError, NotFound):
-    """
-    Jenkins does not recognize the node requested.
-    """
-
-
-class UnknownQueueItem(KeyError, NotFound):
-    """
-    Jenkins does not recognize the requested queue item
-    """
-
-
-class NoBuildData(NotFound):
-    """
-    A job has no build data.
-    """
-
-
-class ArtifactBroken(JenkinsAPIException):
-    """
-    An artifact is broken, wrong
-    """
-
-
-class TimeOut(JenkinsAPIException):
-    """
-    Some jobs have taken too long to complete.
-    """
-
-
-class WillNotBuild(JenkinsAPIException):
-    """
-    Cannot trigger a new build.
-    """
-
-
-class NoResults(JenkinsAPIException):
-    """
-    A build did not publish any results.
-    """
-
-
-class FailedNoResults(NoResults):
-    """
-    A build did not publish any results because it failed
-    """
-
-
-class BadURL(ValueError, JenkinsAPIException):
-    """
-    A URL appears to be broken
-    """
-
-
-class NotAuthorized(JenkinsAPIException):
-    """Not Authorized to access resource"""
-    # Usually thrown when we get a 403 returned
-
-
-class NotSupportSCM(JenkinsAPIException):
-    """
-    It's a SCM that does not supported by current version of jenkinsapi
-    """
-
-
-class NotConfiguredSCM(JenkinsAPIException):
-    """
-    It's a job that doesn't have configured SCM
-    """
-
-
-class NotInQueue(JenkinsAPIException):
-    """
-    It's a job that is not in the queue
-    """
index 050dd081e144242cc2c56b84336d26a19a1389e1..9a9891424336c46d2f7bb593d58080cec0bcebff 100644 (file)
@@ -3,7 +3,7 @@ Module for jenkinsapi Fingerprint
 """
 
 from jenkinsapi.jenkinsbase import JenkinsBase
-from jenkinsapi.exceptions import ArtifactBroken
+from jenkinsapi.custom_exceptions import ArtifactBroken
 
 import urllib2
 import re
index 3ff2eb1d300e05b223320f56736879733673f799..cfcf9926352fc71752f4c0cd9936bbf10ca27c36 100644 (file)
@@ -4,7 +4,7 @@ Module for Jenkinsapi Invocation object
 
 import time
 import datetime
-from jenkinsapi.exceptions import UnknownQueueItem, TimeOut
+from jenkinsapi.custom_exceptions import UnknownQueueItem, TimeOut
 
 
 class Invocation(object):
index 324335db44dfe4181808ceba5ab63ee117f5a443..0e382f5d097224e0262f0ee9143e492ec0afa117 100644 (file)
@@ -19,7 +19,7 @@ from jenkinsapi.queue import Queue
 from jenkinsapi.fingerprint import Fingerprint
 from jenkinsapi.jenkinsbase import JenkinsBase
 from jenkinsapi.utils.requester import Requester
-from jenkinsapi.exceptions import UnknownJob, JenkinsAPIException
+from jenkinsapi.custom_exceptions import UnknownJob, JenkinsAPIException
 
 log = logging.getLogger(__name__)
 
index 5fd59abe14dd8dfaf3b9554836287ad37bae5776..00840c9bf9369cec2fd168f66c84cf332c3462c7 100644 (file)
@@ -4,7 +4,7 @@ Module for JenkinsBase class
 
 import logging
 from jenkinsapi import config
-from jenkinsapi.exceptions import JenkinsAPIException
+from jenkinsapi.custom_exceptions import JenkinsAPIException
 log = logging.getLogger(__name__)
 
 
index 73faa4b1e2c8c0e235b022d8258aeea8c9deffaf..3f4215bf7a40913f3e1e6ffd893ab3aaf7c13a3b 100644 (file)
@@ -13,7 +13,7 @@ from jenkinsapi.invocation import Invocation
 from jenkinsapi.jenkinsbase import JenkinsBase
 from jenkinsapi.queue import QueueItem
 from jenkinsapi.mutable_jenkins_thing import MutableJenkinsThing
-from jenkinsapi.exceptions import (
+from jenkinsapi.custom_exceptions import (
     NoBuildData,
     NotConfiguredSCM,
     NotFound,
index d3ec02b5481e8c517d4b36a91ad484f3c665a344..82fbe705d3631facf1d2a371089ab15634606f8e 100644 (file)
@@ -4,7 +4,7 @@ Module for jenkinsapi nodes
 
 import logging
 from jenkinsapi.node import Node
-from jenkinsapi.exceptions import UnknownNode
+from jenkinsapi.custom_exceptions import UnknownNode
 from jenkinsapi.jenkinsbase import JenkinsBase
 
 log = logging.getLogger(__name__)
index e6fda7cea06e2c6f1c445879f451bb04d8cbf803..92f0d6068bc5eed232a9b46fa99736720fa6a009 100644 (file)
@@ -3,7 +3,7 @@ Queue module for jenkinsapi
 """
 
 from jenkinsapi.jenkinsbase import JenkinsBase
-from jenkinsapi.exceptions import UnknownQueueItem
+from jenkinsapi.custom_exceptions import UnknownQueueItem
 import logging
 
 log = logging.getLogger(__name__)