summaryrefslogtreecommitdiffstats
path: root/pyload/utils/__init__.py
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@gmail.com> 2014-12-11 01:04:07 +0100
committerGravatar Walter Purcaro <vuolter@gmail.com> 2014-12-11 01:04:07 +0100
commit1b2591b0650a6a0be1ad41022f6019d17192f195 (patch)
treedbd2158b96141ef9354b5cd5edaead28978d65e7 /pyload/utils/__init__.py
parentSupport new key attributes (diff)
downloadpyload-1b2591b0650a6a0be1ad41022f6019d17192f195.tar.xz
Rename some Addon methods
Diffstat (limited to 'pyload/utils/__init__.py')
-rw-r--r--pyload/utils/__init__.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/pyload/utils/__init__.py b/pyload/utils/__init__.py
index 1c398224f..004274c3e 100644
--- a/pyload/utils/__init__.py
+++ b/pyload/utils/__init__.py
@@ -232,6 +232,11 @@ def fixup(m):
return text # leave as is
+def has_method(obj, name):
+ """ Check if "name" was defined in obj, (false if it was inhereted) """
+ return hasattr(obj, '__dict__') and name in obj.__dict__
+
+
def html_unescape(text):
"""Removes HTML or XML character references and entities from a text string"""
return re.sub("&#?\w+;", fixup, text)