# Path: git_trac/trac_error.py
# class TracInternalError(TracError):
#     def __init__(self, fault):
#         self._fault = fault
#         self.faultCode = fault.faultCode
# 
#     def __str__(self):
#         return str(self._fault)
# 
# class TracAuthenticationError(TracError):
#     def __init__(self):
#         TracError.__init__(self, 'Authentication with trac server failed.')
# 
# class TracConnectionError(TracError):
#     def __init__(self, msg=None):
#         if msg is None:
#             TracError.__init__(self, 'Connection to trac server failed.')
#         else:
#             TracError.__init__(self, msg)
# 
# Path: git_trac/cached_property.py
# class cached_property(object):
# 
#     def __init__(self, method, name=None):
#         self.method = method
#         self.name = name or method.__name__
#         self.__doc__ = method.__doc__
# 
#     def __get__(self, instance, cls):
#         if instance is None:
#             return self
#         result = self.method(instance)
#         setattr(instance, self.name, result)
#         return result


import sys
import urllib2
    import httplib
            import urlparse
from xmlrpclib import SafeTransport, Fault
from .trac_error import \
    TracInternalError, TracAuthenticationError, TracConnectionError
from .cached_property import cached_property
              <DateTime '20071025T16:48:05' at ...>,
              <DateTime '...' at ...>,
              {'status': 'closed',
               'changetime': <DateTime '...' at ...>,
               'description': '...',
               'reporter': 'was',
               'cc': '',
               'type': 'defect',
               'milestone': 'sage-2.10',
               '_ts': '...',
               'component': 'distribution',
               'summary': 'Sage does not have 10000 users yet.',
               'priority': 'major',
               'owner': 'was',
               'time': <DateTime '20071025T16:48:05' at ...>,
               'keywords': '',
               'resolution': 'fixed'}],)
        """
        try:
            req = urllib2.Request(
                    urlparse.urlunparse(('https', host, handler, '', '', '')),
                    request_body, {'Content-Type': 'text/xml',
                        'User-Agent': self.user_agent})
            response = self.opener.open(req)
            self.verbose = verbose
            return self.parse_response(response)
        except Fault as e:
            raise TracInternalError(e)
        except urllib2.HTTPError as e:
            if e.code == 401:

# Path: git_trac/trac_error.py
# class TracInternalError(TracError):
#     def __init__(self, fault):
#         self._fault = fault
#         self.faultCode = fault.faultCode
# 
#     def __str__(self):
#         return str(self._fault)
# 
# class TracAuthenticationError(TracError):
#     def __init__(self):
#         TracError.__init__(self, 'Authentication with trac server failed.')
# 
# class TracConnectionError(TracError):
#     def __init__(self, msg=None):
#         if msg is None:
#             TracError.__init__(self, 'Connection to trac server failed.')
#         else:
#             TracError.__init__(self, msg)
# 
# Path: git_trac/cached_property.py
# class cached_property(object):
# 
#     def __init__(self, method, name=None):
#         self.method = method
#         self.name = name or method.__name__
#         self.__doc__ = method.__doc__
# 
#     def __get__(self, instance, cls):
#         if instance is None:
#             return self
#         result = self.method(instance)
#         setattr(instance, self.name, result)
#         return result


# Path: git_trac/digest_transport_py2.py
import sys
import urllib2
    import httplib
            import urlparse
from xmlrpclib import SafeTransport, Fault
from .trac_error import \
    TracInternalError, TracAuthenticationError, TracConnectionError
from .cached_property import cached_property

              <DateTime '20071025T16:48:05' at ...>,
              <DateTime '...' at ...>,
              {'status': 'closed',
               'changetime': <DateTime '...' at ...>,
               'description': '...',
               'reporter': 'was',
               'cc': '',
               'type': 'defect',
               'milestone': 'sage-2.10',
               '_ts': '...',
               'component': 'distribution',
               'summary': 'Sage does not have 10000 users yet.',
               'priority': 'major',
               'owner': 'was',
               'time': <DateTime '20071025T16:48:05' at ...>,
               'keywords': '',
               'resolution': 'fixed'}],)
        """
        try:
            req = urllib2.Request(
                    urlparse.urlunparse(('https', host, handler, '', '', '')),
                    request_body, {'Content-Type': 'text/xml',
                        'User-Agent': self.user_agent})
            response = self.opener.open(req)
            self.verbose = verbose
            return self.parse_response(response)
        except Fault as e:
            raise TracInternalError(e)
        except urllib2.HTTPError as e:
            if e.code == 401:

                raise TracAuthenticationError()