summaryrefslogtreecommitdiffstats
path: root/module/plugins
diff options
context:
space:
mode:
authorGravatar GammaC0de <GammaC0de@users.noreply.github.com> 2015-12-30 01:08:42 +0100
committerGravatar GammaC0de <GammaC0de@users.noreply.github.com> 2015-12-30 01:08:42 +0100
commitcab3122b447c46cd7da51d1304b1904352f99886 (patch)
tree71270b0289be9d2181d9fdde519060ba48d2fc0c /module/plugins
parentTiny code cosmetics (diff)
downloadpyload-cab3122b447c46cd7da51d1304b1904352f99886.tar.xz
[Hoster] Python 2.5 compatibility hack for property.setter
Diffstat (limited to 'module/plugins')
-rw-r--r--module/plugins/internal/Hoster.py20
1 files changed, 19 insertions, 1 deletions
diff --git a/module/plugins/internal/Hoster.py b/module/plugins/internal/Hoster.py
index 8b5e975d3..1914fbfd4 100644
--- a/module/plugins/internal/Hoster.py
+++ b/module/plugins/internal/Hoster.py
@@ -13,10 +13,28 @@ from module.plugins.internal.Plugin import Fail, Retry
from module.plugins.internal.misc import compute_checksum, encode, exists, fixurl, fsjoin, parse_name, safejoin
+# Python 2.5 compatibility hack for property.setter, property.deleter
+import __builtin__
+if not hasattr(__builtin__.property, "setter"):
+ class property(__builtin__.property):
+ __metaclass__ = type
+
+ def setter(self, method):
+ return property(self.fget, method, self.fdel)
+
+ def deleter(self, method):
+ return property(self.fget, self.fset, method)
+
+ @__builtin__.property
+ def __doc__(self):
+ """Doc seems not to be set correctly when subclassing"""
+ return self.fget.__doc__
+
+
class Hoster(Base):
__name__ = "Hoster"
__type__ = "hoster"
- __version__ = "0.47"
+ __version__ = "0.48"
__status__ = "stable"
__pattern__ = r'^unmatchable$'