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): ...@@ -54,34 +54,41 @@ class SubversionTimeoutError(SubversionError):
"""Raised when a Subversion transaction is too long. """Raised when a Subversion transaction is too long.
""" """
pass 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: class SubversionSSLTrustError(SubversionError):
import pysvn """Raised when a SSL certificate is not trusted.
"""
# Declarative Security
security = ClassSecurityInfo()
class SubversionLoginError(SubversionError): def __init__(self, trust_dict = None):
"""Raised when an authentication is required. self._trust_dict = trust_dict
"""
# Declarative Security security.declarePublic('getTrustDict')
security = ClassSecurityInfo() def getTrustDict(self):
def __init__(self, realm = None): return self._trust_dict
self._realm = realm
security.declarePublic('getRealm') InitializeClass(SubversionSSLTrustError)
def getRealm(self): allow_class(SubversionSSLTrustError)
return self._realm
class SubversionSSLTrustError(SubversionError):
"""Raised when a SSL certificate is not trusted.
"""
# Declarative Security
security = ClassSecurityInfo()
def __init__(self, trust_dict = None): try:
self._trust_dict = trust_dict import pysvn
security.declarePublic('getTrustDict')
def getTrustDict(self):
return self._trust_dict
class Callback: class Callback:
"""The base class for callback functions. """The base class for callback functions.
...@@ -370,11 +377,6 @@ try: ...@@ -370,11 +377,6 @@ try:
def newSubversionClient(container, **kw): def newSubversionClient(container, **kw):
return SubversionClient(container, **kw).__of__(container) return SubversionClient(container, **kw).__of__(container)
InitializeClass(SubversionSSLTrustError)
allow_class(SubversionSSLTrustError)
InitializeClass(SubversionLoginError)
allow_class(SubversionLoginError)
except ImportError: except ImportError:
from zLOG import LOG, WARNING from zLOG import LOG, WARNING
LOG('SubversionTool', 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