Plex plugin to to play various online streams (mostly Latvian).

support.py 552B

123456789101112131415161718192021222324252627282930313233343536
  1. import sys
  2. info = sys.version_info
  3. import unittest2
  4. try:
  5. callable = callable
  6. except NameError:
  7. def callable(obj):
  8. return hasattr(obj, '__call__')
  9. with_available = sys.version_info[:2] >= (2, 5)
  10. def is_instance(obj, klass):
  11. """Version of is_instance that doesn't access __class__"""
  12. return issubclass(type(obj), klass)
  13. class SomeClass(object):
  14. class_attribute = None
  15. def wibble(self):
  16. pass
  17. class X(object):
  18. pass
  19. try:
  20. next = next
  21. except NameError:
  22. def next(obj):
  23. return obj.next()