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
...@@ -55,10 +55,7 @@ class SubversionTimeoutError(SubversionError): ...@@ -55,10 +55,7 @@ class SubversionTimeoutError(SubversionError):
""" """
pass pass
try: class SubversionLoginError(SubversionError):
import pysvn
class SubversionLoginError(SubversionError):
"""Raised when an authentication is required. """Raised when an authentication is required.
""" """
# Declarative Security # Declarative Security
...@@ -70,7 +67,11 @@ try: ...@@ -70,7 +67,11 @@ try:
def getRealm(self): def getRealm(self):
return self._realm return self._realm
class SubversionSSLTrustError(SubversionError): InitializeClass(SubversionLoginError)
allow_class(SubversionLoginError)
class SubversionSSLTrustError(SubversionError):
"""Raised when a SSL certificate is not trusted. """Raised when a SSL certificate is not trusted.
""" """
# Declarative Security # Declarative Security
...@@ -83,6 +84,12 @@ try: ...@@ -83,6 +84,12 @@ try:
def getTrustDict(self): def getTrustDict(self):
return self._trust_dict return self._trust_dict
InitializeClass(SubversionSSLTrustError)
allow_class(SubversionSSLTrustError)
try:
import pysvn
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