Commit 65f4f3bb authored by Jérome Perrin's avatar Jérome Perrin

define and allow SubversionLoginError and SubversionSSLTrustError before the

try / except ImportError to make those two classes available even if pysvn is
not installed (they are used by some python scripts)


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@25314 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent d87375c1
......@@ -54,34 +54,41 @@ class SubversionTimeoutError(SubversionError):
"""Raised when a Subversion transaction is too long.
"""
pass
class SubversionLoginError(SubversionError):
"""Raised when an authentication is required.
"""
# Declarative Security
security = ClassSecurityInfo()
def __init__(self, realm = None):
self._realm = realm
security.declarePublic('getRealm')
def getRealm(self):
return self._realm
InitializeClass(SubversionLoginError)
allow_class(SubversionLoginError)
try:
import pysvn
class SubversionSSLTrustError(SubversionError):
"""Raised when a SSL certificate is not trusted.
"""
# Declarative Security
security = ClassSecurityInfo()
class SubversionLoginError(SubversionError):
"""Raised when an authentication is required.
"""
# Declarative Security
security = ClassSecurityInfo()
def __init__(self, realm = None):
self._realm = realm
def __init__(self, trust_dict = None):
self._trust_dict = trust_dict
security.declarePublic('getTrustDict')
def getTrustDict(self):
return self._trust_dict
security.declarePublic('getRealm')
def getRealm(self):
return self._realm
class SubversionSSLTrustError(SubversionError):
"""Raised when a SSL certificate is not trusted.
"""
# Declarative Security
security = ClassSecurityInfo()
InitializeClass(SubversionSSLTrustError)
allow_class(SubversionSSLTrustError)
def __init__(self, trust_dict = None):
self._trust_dict = trust_dict
security.declarePublic('getTrustDict')
def getTrustDict(self):
return self._trust_dict
try:
import pysvn
class Callback:
"""The base class for callback functions.
......@@ -370,11 +377,6 @@ try:
def newSubversionClient(container, **kw):
return SubversionClient(container, **kw).__of__(container)
InitializeClass(SubversionSSLTrustError)
allow_class(SubversionSSLTrustError)
InitializeClass(SubversionLoginError)
allow_class(SubversionLoginError)
except ImportError:
from zLOG import LOG, WARNING
LOG('SubversionTool', WARNING,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment