Commit 515eae37 authored by Dan Pascu's avatar Dan Pascu

Replaced classproperty from blink.util with the one from sipsimple.util

parent d591b4fb
......@@ -5,7 +5,7 @@ __all__ = ['CallFunctionEvent']
from PyQt4.QtCore import QEvent
from blink.util import classproperty
from sipsimple.util import classproperty
class EventMeta(type(QEvent)):
......
......@@ -9,7 +9,7 @@ import os
import platform
import sys
from blink.util import classproperty
from sipsimple.util import classproperty
class DirectoryContextManager(unicode):
......
# Copyright (C) 2010 AG Projects. See LICENSE for details.
#
__all__ = ['QSingleton', 'classproperty', 'call_in_gui_thread', 'run_in_gui_thread']
__all__ = ['QSingleton', 'call_in_gui_thread', 'run_in_gui_thread']
from PyQt4.QtCore import QObject
from application.python.decorator import decorator, preserve_signature
......@@ -12,18 +12,6 @@ class QSingleton(Singleton, type(QObject)):
"""A metaclass for making Qt objects singletons"""
# TODO: replace later with classproperty from sipsimple.util
def classproperty(function):
class Descriptor(object):
def __get__(self, instance, owner):
return function(owner)
def __set__(self, instance, value):
raise AttributeError("read-only attribute cannot be set")
def __delete__(self, instance):
raise AttributeError("read-only attribute cannot be deleted")
return Descriptor()
def call_in_gui_thread(function, *args, **kw):
from blink import Blink
from blink.event import CallFunctionEvent
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment