summaryrefslogtreecommitdiffstats
path: root/module/remote
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2012-12-20 15:33:01 +0100
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2012-12-20 15:33:01 +0100
commitceb59ee0739546368135b0d86a69b17c92bfbccf (patch)
tree863b70e281f8aa833d2a4a72a61f25113dd9b8e3 /module/remote
parentseparated handlebars init (diff)
downloadpyload-ceb59ee0739546368135b0d86a69b17c92bfbccf.tar.xz
added models and collections for progress
Diffstat (limited to 'module/remote')
-rw-r--r--module/remote/pyload.thrift39
-rw-r--r--module/remote/ttypes.py21
-rw-r--r--module/remote/ttypes_debug.py8
3 files changed, 29 insertions, 39 deletions
diff --git a/module/remote/pyload.thrift b/module/remote/pyload.thrift
index 0c4eea9c4..50164c292 100644
--- a/module/remote/pyload.thrift
+++ b/module/remote/pyload.thrift
@@ -114,7 +114,7 @@ enum Role {
struct DownloadProgress {
1: FileID fid,
2: PackageID pid,
- 3: ByteCount speed,
+ 3: ByteCount speed, // per second
4: DownloadStatus status,
}
@@ -123,21 +123,18 @@ struct ProgressInfo {
2: string name,
3: string statusmsg,
4: i32 eta, // in seconds
- 5: string format_eta,
- 6: ByteCount done,
- 7: ByteCount total, // arbitary number, size in case of files
- 8: optional DownloadProgress download
+ 5: ByteCount done,
+ 6: ByteCount total, // arbitary number, size in case of files
+ 7: optional DownloadProgress download
}
-# TODO: Maybe more are needed? Should be simple values
struct ServerStatus {
- 1: bool pause,
- 2: i16 active,
- 3: i16 queue,
- 4: i16 total,
- 5: ByteCount speed,
- 6: bool download,
- 7: bool reconnect
+ 1: i16 queuedDownloads,
+ 2: i16 totalDownloads,
+ 3: ByteCount speed,
+ 4: bool pause,
+ 5: bool download,
+ 6: bool reconnect
}
// download info for specific file
@@ -333,19 +330,19 @@ service Pyload {
string getServerVersion(),
string getWSAddress(),
- ServerStatus statusServer(),
+ ServerStatus getServerStatus(),
+ list<ProgressInfo> getProgressInfo(),
+
+ list<string> getLog(1: i32 offset),
+ ByteCount freeSpace(),
+
void pauseServer(),
void unpauseServer(),
bool togglePause(),
- ByteCount freeSpace(),
- void kill(),
- void restart(),
- list<string> getLog(1: i32 offset),
- bool isTimeDownload(),
- bool isTimeReconnect(),
bool toggleReconnect(),
- list<ProgressInfo> getProgressInfo(),
+ void stop(),
+ void restart(),
///////////////////////
// Configuration
diff --git a/module/remote/ttypes.py b/module/remote/ttypes.py
index 36b56d961..4368479fd 100644
--- a/module/remote/ttypes.py
+++ b/module/remote/ttypes.py
@@ -284,14 +284,13 @@ class ProgressInfo(BaseObject):
self.download = download
class ServerStatus(BaseObject):
- __slots__ = ['pause', 'active', 'queue', 'total', 'speed', 'download', 'reconnect']
+ __slots__ = ['queuedDownloads', 'totalDownloads', 'speed', 'pause', 'download', 'reconnect']
- def __init__(self, pause=None, active=None, queue=None, total=None, speed=None, download=None, reconnect=None):
- self.pause = pause
- self.active = active
- self.queue = queue
- self.total = total
+ def __init__(self, queuedDownloads=None, totalDownloads=None, speed=None, pause=None, download=None, reconnect=None):
+ self.queuedDownloads = queuedDownloads
+ self.totalDownloads = totalDownloads
self.speed = speed
+ self.pause = pause
self.download = download
self.reconnect = reconnect
@@ -435,6 +434,8 @@ class Iface(object):
pass
def getProgressInfo(self):
pass
+ def getServerStatus(self):
+ pass
def getServerVersion(self):
pass
def getUserData(self):
@@ -447,12 +448,6 @@ class Iface(object):
pass
def isInteractionWaiting(self, mode):
pass
- def isTimeDownload(self):
- pass
- def isTimeReconnect(self):
- pass
- def kill(self):
- pass
def login(self, username, password):
pass
def moveFiles(self, fids, pid):
@@ -499,7 +494,7 @@ class Iface(object):
pass
def setPassword(self, username, old_password, new_password):
pass
- def statusServer(self):
+ def stop(self):
pass
def stopAllDownloads(self):
pass
diff --git a/module/remote/ttypes_debug.py b/module/remote/ttypes_debug.py
index 1b7065d9a..6ca9e892a 100644
--- a/module/remote/ttypes_debug.py
+++ b/module/remote/ttypes_debug.py
@@ -24,7 +24,7 @@ classes = {
'PackageInfo' : [int, basestring, basestring, int, int, basestring, basestring, basestring, int, (list, basestring), int, int, PackageStats, (list, int), (list, int)],
'PackageStats' : [int, int, int, int],
'ProgressInfo' : [basestring, basestring, basestring, int, basestring, int, int, (None, DownloadProgress)],
- 'ServerStatus' : [bool, int, int, int, int, bool, bool],
+ 'ServerStatus' : [int, int, int, bool, bool, bool],
'ServiceDoesNotExists' : [basestring, basestring],
'ServiceException' : [basestring],
'TreeCollection' : [PackageInfo, (dict, int, FileInfo), (dict, int, PackageInfo)],
@@ -79,15 +79,13 @@ methods = {
'getPackageContent': TreeCollection,
'getPackageInfo': PackageInfo,
'getProgressInfo': (list, ProgressInfo),
+ 'getServerStatus': ServerStatus,
'getServerVersion': basestring,
'getUserData': UserData,
'getUserPlugins': (list, ConfigInfo),
'getWSAddress': basestring,
'hasAddonHandler': bool,
'isInteractionWaiting': bool,
- 'isTimeDownload': bool,
- 'isTimeReconnect': bool,
- 'kill': None,
'login': bool,
'moveFiles': bool,
'movePackage': bool,
@@ -111,7 +109,7 @@ methods = {
'setPackageFolder': bool,
'setPackagePaused': None,
'setPassword': bool,
- 'statusServer': ServerStatus,
+ 'stop': None,
'stopAllDownloads': None,
'stopDownloads': None,
'togglePause': bool,