Changeset 4719 for exist


Ignore:
Timestamp:
05/01/09 09:20:49 (10 years ago)
Author:
cbyrom
Message:

Avoid looking up invalid links more than once during validation +
retrieve all possible info from sockets failure errors.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • exist/trunk/python/ndgUtils/lib/atomvalidator.py

    r4663 r4719  
    254254        ''' 
    255255        logging.info("Validating atom links") 
     256        invalidLinks = [] 
    256257        for link in self._atom.relatedLinks: 
    257258            if link.hasValue(): 
     
    261262                        continue 
    262263                     
    263                     if not simpleURLCheck(link.href): 
     264                    if link.href in invalidLinks or not simpleURLCheck(link.href): 
    264265                        self.__addError(self.BROKEN_LINKS, "Broken link: '%s'" %link.href) 
     266                        if link.href not in invalidLinks: 
     267                            invalidLinks.append(link.href) 
    265268                    else: 
    266269                        self._validLinks.append(link.href) 
     
    334337                error = e.faultString.split(':')[-1]  
    335338            elif isinstance(e, socket.error): 
    336                 error = e.args[1] 
     339                error = " ".join(e.args) 
    337340                 
    338341            errorMessage = "Problem experienced when validating against schema:%s'%s'" \ 
Note: See TracChangeset for help on using the changeset viewer.