Decorator to enforce suspend
parent
7ac5b9a1fe
commit
e4210ad444
@ -0,0 +1,15 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
Decorators for bound classes
|
||||
"""
|
||||
from decorator import decorator
|
||||
|
||||
@decorator
|
||||
def suspend(func, self, *args, **kw):
|
||||
"""
|
||||
This decorator will try to suspend DF and start needed module before running func
|
||||
"""
|
||||
if self.prepare():
|
||||
return func(self, *args, **kw)
|
||||
else:
|
||||
raise Exception(u"Could not suspend/start")
|
Loading…
Reference in New Issue