diff options
author | 2013-03-11 19:49:20 +0100 | |
---|---|---|
committer | 2013-03-11 19:50:54 +0100 | |
commit | 763b142db70ce77952cb46cfccf84d9800f15651 (patch) | |
tree | d2636e48766d365bd8a9d079de603b127ab88744 /module/threads/BaseThread.py | |
parent | Merge pull request #33 from stickell/patch-3 (diff) | |
download | pyload-763b142db70ce77952cb46cfccf84d9800f15651.tar.xz |
websocket login via session, websocket pushes server status, webui renders server status
Diffstat (limited to 'module/threads/BaseThread.py')
-rw-r--r-- | module/threads/BaseThread.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/module/threads/BaseThread.py b/module/threads/BaseThread.py index 3e27eec96..c64678a72 100644 --- a/module/threads/BaseThread.py +++ b/module/threads/BaseThread.py @@ -1,10 +1,6 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -import os -import sys -import locale - from threading import Thread from time import strftime, gmtime from sys import exc_info @@ -12,6 +8,7 @@ from types import MethodType from pprint import pformat from traceback import format_exc +from module.utils import primary_uid from module.utils.fs import listdir, join, save_join, stat, exists class BaseThread(Thread): @@ -24,6 +21,13 @@ class BaseThread(Thread): self.core = manager.core self.log = manager.core.log + #: Owner of the thread, every type should set it + self.owner = None + + @property + def user(self): + return primary_uid(self.owner) + def getProgress(self): """ retrieves progress information about the current running task |