Created
March 8, 2012 05:15
-
-
Save mnuck/1998863 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from tater.models import FakeGlobal | |
class needsScriptingQueue(object): | |
def __init__(self, f): | |
self.f = f | |
self.__name__ = f.__name__ | |
def __call__(self, *args): | |
global scriptingQueue | |
sq_db = FakeGlobal.objects.get(name='scriptingQueue') | |
scriptingQueue = json.loads(sq_db.value) | |
retval = self.f(*args) | |
sq_db.value = json.dumps(scriptingQueue) | |
sq_db.save() | |
del scriptingQueue | |
return retval |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment