1
2
3 """
4
5 SPARQL Wrapper Utils
6
7 @authors: U{Ivan Herman<http://www.ivan-herman.net>}, U{Sergio Fernández<http://www.wikier.org>}, U{Carlos Tejo Alonso<http://www.dayures.net>}
8 @organization: U{World Wide Web Consortium<http://www.w3.org>} and U{Foundation CTIC<http://www.fundacionctic.org/>}.
9 @license: U{W3C SOFTWARE NOTICE AND LICENSE<href="http://www.w3.org/Consortium/Legal/copyright-software">}
10
11 """
12
13 import warnings
14
16 """
17 This is a decorator which can be used to mark functions
18 as deprecated. It will result in a warning being emmitted
19 when the function is used.
20 @see: http://code.activestate.com/recipes/391367/
21 """
22 def newFunc(*args, **kwargs):
23 warnings.warn("Call to deprecated function %s." % func.__name__, category=DeprecationWarning, stacklevel=2)
24 return func(*args, **kwargs)
25 newFunc.__name__ = func.__name__
26 newFunc.__doc__ = func.__doc__
27 newFunc.__dict__.update(func.__dict__)
28 return newFunc
29