diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2013-09-26 16:40:38 +0200 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2013-09-26 16:40:50 +0200 |
commit | 967d6dd16c25ceba22dcd105079f72534ddb87e9 (patch) | |
tree | 4c971ff446dc955f1884e5aa80ef4cb62bbf55fe /pyload/datatypes/OnlineCheck.py | |
parent | new DLC plugins (diff) | |
download | pyload-967d6dd16c25ceba22dcd105079f72534ddb87e9.tar.xz |
rewritten decrypter and info fetching thread
Diffstat (limited to 'pyload/datatypes/OnlineCheck.py')
-rw-r--r-- | pyload/datatypes/OnlineCheck.py | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/pyload/datatypes/OnlineCheck.py b/pyload/datatypes/OnlineCheck.py index 4b31e848b..2797828bf 100644 --- a/pyload/datatypes/OnlineCheck.py +++ b/pyload/datatypes/OnlineCheck.py @@ -1 +1,32 @@ -__author__ = 'christian' +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +from time import time + +from pyload.Api import OnlineCheck as OC + +class OnlineCheck: + """ Helper class that holds result of an initiated online check """ + + def __init__(self, rid, owner): + self.rid = rid + self.owner = owner + self.result = {} + self.done = False + + self.timestamp = time() + + def update(self, result): + self.timestamp = time() + self.result.update(result) + + def toApiData(self): + self.timestamp = time() + oc = OC(self.rid, self.result) + # getting the results clears the older ones + self.result = {} + # indication for no more data + if self.done: + oc.rid = -1 + + return oc
\ No newline at end of file |