summaryrefslogtreecommitdiffstats
path: root/pyload/remote
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2014-01-29 18:51:38 +0100
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2014-01-29 18:51:38 +0100
commit3401bcfd5ed57dec9e0f78553d627d7608170cb6 (patch)
treec36ac6fe4581379ed03f72409244aa40414b9580 /pyload/remote
parentfixed new waiting dl rule (diff)
downloadpyload-3401bcfd5ed57dec9e0f78553d627d7608170cb6.tar.xz
added connection flags to download status
Diffstat (limited to 'pyload/remote')
-rw-r--r--pyload/remote/apitypes.py12
-rw-r--r--pyload/remote/apitypes_debug.py3
-rw-r--r--pyload/remote/create_apitypes.py7
-rw-r--r--pyload/remote/pyload.thrift11
4 files changed, 25 insertions, 8 deletions
diff --git a/pyload/remote/apitypes.py b/pyload/remote/apitypes.py
index 4c66800c6..704d3b876 100644
--- a/pyload/remote/apitypes.py
+++ b/pyload/remote/apitypes.py
@@ -4,14 +4,21 @@
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
class BaseObject(object):
+ __version__ = (0, 4, 9, 9)
__slots__ = []
def __str__(self):
return "<%s %s>" % (self.__class__.__name__, ", ".join("%s=%s" % (k,getattr(self,k)) for k in self.__slots__))
class ExceptionObject(Exception):
+ __version__ = (0, 4, 9, 9)
__slots__ = []
+class Connection:
+ All = 0
+ Resumable = 1
+ Secure = 2
+
class DownloadState:
All = 0
Finished = 1
@@ -194,12 +201,13 @@ class DownloadInfo(BaseObject):
self.error = error
class DownloadProgress(BaseObject):
- __slots__ = ['fid', 'pid', 'speed', 'status']
+ __slots__ = ['fid', 'pid', 'speed', 'conn', 'status']
- def __init__(self, fid=None, pid=None, speed=None, status=None):
+ def __init__(self, fid=None, pid=None, speed=None, conn=None, status=None):
self.fid = fid
self.pid = pid
self.speed = speed
+ self.conn = conn
self.status = status
class EventInfo(BaseObject):
diff --git a/pyload/remote/apitypes_debug.py b/pyload/remote/apitypes_debug.py
index a30009bad..6c959e56a 100644
--- a/pyload/remote/apitypes_debug.py
+++ b/pyload/remote/apitypes_debug.py
@@ -6,6 +6,7 @@
from apitypes import *
enums = [
+ "Connection",
"DownloadState",
"DownloadStatus",
"FileStatus",
@@ -26,7 +27,7 @@ classes = {
'ConfigInfo' : [basestring, basestring, basestring, basestring, bool, (None, bool)],
'ConfigItem' : [basestring, basestring, basestring, Input, basestring],
'DownloadInfo' : [basestring, basestring, basestring, int, basestring, basestring],
- 'DownloadProgress' : [int, int, int, int],
+ 'DownloadProgress' : [int, int, int, int, int],
'EventInfo' : [basestring, (list, basestring)],
'FileDoesNotExist' : [int],
'FileInfo' : [int, basestring, int, int, int, int, int, int, int, (None, DownloadInfo)],
diff --git a/pyload/remote/create_apitypes.py b/pyload/remote/create_apitypes.py
index 61063fa3b..80fdb7848 100644
--- a/pyload/remote/create_apitypes.py
+++ b/pyload/remote/create_apitypes.py
@@ -12,8 +12,7 @@ from thrift.Thrift import TType
from thriftgen.pyload import ttypes
from thriftgen.pyload import Pyload
-# TODO: import and add version
-# from pyload import CURRENT_VERSION
+from pyload import __version_info__
type_map = {
TType.BOOL: 'bool',
@@ -80,15 +79,17 @@ def main():
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
class BaseObject(object):
+\t__version__ = {0}
\t__slots__ = []
\tdef __str__(self):
\t\treturn "<%s %s>" % (self.__class__.__name__, ", ".join("%s=%s" % (k,getattr(self,k)) for k in self.__slots__))
class ExceptionObject(Exception):
+\t__version__ = {0}
\t__slots__ = []
-""")
+""".format(__version_info__))
dev = open(join(path, "apitypes_debug.py"), "wb")
dev.write("""#!/usr/bin/env python
diff --git a/pyload/remote/pyload.thrift b/pyload/remote/pyload.thrift
index 9d400c4e2..8c85fbd00 100644
--- a/pyload/remote/pyload.thrift
+++ b/pyload/remote/pyload.thrift
@@ -129,6 +129,12 @@ enum ProgressType {
FileOperation = 32,
}
+enum Connection {
+ All = 0,
+ Resumable = 1,
+ Secure = 2,
+}
+
struct Input {
1: InputType type,
2: optional JSONString default_value,
@@ -139,7 +145,8 @@ struct DownloadProgress {
1: FileID fid,
2: PackageID pid,
3: ByteCount speed, // per second
- 4: DownloadStatus status,
+ 4: Connection conn,
+ 5: DownloadStatus status,
}
struct ProgressInfo {
@@ -315,7 +322,7 @@ struct AccountInfo {
9: bool premium,
10: bool activated,
11: bool shared,
- 13: list <ConfigItem> config,
+ 12: list <ConfigItem> config,
}
struct OnlineCheck {