Changeset 124

Show
Ignore:
Timestamp:
04/17/08 15:35:00 (4 years ago)
Author:
phil
Message:

rdfalchemy Tweeked the logging to fix {20}

Location:
rdfalchemy/trunk/rdfalchemy
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • rdfalchemy/trunk/rdfalchemy/engine/__init__.py

    r123 r124  
    123123        return (name, opts) 
    124124    else: 
    125         raise exceptions.ArgumentError("Could not parse rfc1738 URL from string '%s'" % name) 
     125        raise exceptions.ValueError("Could not parse rfc1738 URL from string '%s'" % name) 
    126126 
  • rdfalchemy/trunk/rdfalchemy/exceptions.py

    r108 r124  
    33 
    44 
    5 class ArgumentError(RDFAlchemyError): 
    6     """Raised for all those conditions where invalid arguments are 
    7     sent to constructed objects.  This error generally corresponds to 
    8     construction time state errors. 
    9     """ 
    105class SPARQLError(Exception): 
    116    """Base SPARQL Error""" 
  • rdfalchemy/trunk/rdfalchemy/Literal.py

    r111 r124  
    1111from rdflib.Literal import _PythonToXSD 
    1212import re 
     13import logging 
    1314 
    1415XSD = Namespace(u'http://www.w3.org/2001/XMLSchema#') 
    1516 
     17################################################################################ 
     18# Let's fix the logging.  this seems like a log of work... 
     19# all that it does is not log rebinding errors  
     20# We know about them ... and they confuse type citizenry 
     21_log = logging.getLogger("rdflib") 
     22if not _log.handlers: 
     23    class rebindingLogFilter(logging.Filter): 
     24        def filter(self, record): 
     25            if record.getMessage().find("Rebinding") > -1: 
     26                return False 
     27            return True 
     28     
     29    h = logging.StreamHandler() 
     30    h.addFilter(rebindingLogFilter()) 
     31    _log.addHandler(h) 
     32     
    1633################################################################################ 
    1734## Let's make toPython return a Decimal if an XSD.decimal in in the triplestore