diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2012-08-31 23:25:26 +0200 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2012-08-31 23:25:26 +0200 |
commit | cbd4f4b5375f89362733e10a9b98e5a74c2a5734 (patch) | |
tree | 056bb5af9aec5dee164d7f3055819ceb40e92a87 /module/remote | |
parent | Fixed free space issue closed #676 (diff) | |
download | pyload-cbd4f4b5375f89362733e10a9b98e5a74c2a5734.tar.xz |
first js models/views
Diffstat (limited to 'module/remote')
-rw-r--r-- | module/remote/socketbackend/ttypes.py | 32 | ||||
-rw-r--r-- | module/remote/thriftbackend/pyload.thrift | 14 | ||||
-rwxr-xr-x | module/remote/thriftbackend/thriftgen/pyload/Pyload-remote | 14 | ||||
-rw-r--r-- | module/remote/thriftbackend/thriftgen/pyload/Pyload.py | 16 | ||||
-rw-r--r-- | module/remote/thriftbackend/thriftgen/pyload/constants.py | 2 | ||||
-rw-r--r-- | module/remote/thriftbackend/thriftgen/pyload/ttypes.py | 52 |
6 files changed, 65 insertions, 65 deletions
diff --git a/module/remote/socketbackend/ttypes.py b/module/remote/socketbackend/ttypes.py index b7e0d7f3d..569c758fe 100644 --- a/module/remote/socketbackend/ttypes.py +++ b/module/remote/socketbackend/ttypes.py @@ -32,15 +32,15 @@ class FileStatus: class Input: Bool = 4 - Choice = 6 Click = 5 List = 8 Multiple = 7 NA = 0 Password = 3 + Select = 6 Table = 9 Text = 1 - TextBox = 2 + Textbox = 2 class MediaType: All = 0 @@ -58,20 +58,20 @@ class Output: Query = 4 class PackageStatus: + Folder = 2 Ok = 0 Paused = 1 - Remote = 2 + Remote = 3 class Permission: - Accounts = 32 + Accounts = 16 Add = 1 - Addons = 128 + Addons = 64 All = 0 Delete = 2 - Download = 16 - Interaction = 64 + Download = 8 + Interaction = 32 Modify = 4 - Status = 8 class Role: Admin = 0 @@ -237,14 +237,6 @@ class PackageStats(BaseObject): self.sizetotal = sizetotal self.sizedone = sizedone -class PackageView(BaseObject): - __slots__ = ['root', 'files', 'packages'] - - def __init__(self, root=None, files=None, packages=None): - self.root = root - self.files = files - self.packages = packages - class ProgressInfo(BaseObject): __slots__ = ['fid', 'name', 'speed', 'eta', 'format_eta', 'bleft', 'size', 'format_size', 'percent', 'status', 'statusmsg', 'format_wait', 'wait_until', 'packageID', 'packageName', 'plugin'] @@ -291,6 +283,14 @@ class ServiceException(Exception): def __init__(self, msg=None): self.msg = msg +class TreeCollection(BaseObject): + __slots__ = ['root', 'files', 'packages'] + + def __init__(self, root=None, files=None, packages=None): + self.root = root + self.files = files + self.packages = packages + class UserData(BaseObject): __slots__ = ['uid', 'name', 'email', 'role', 'permission', 'folder', 'traffic', 'dllimit', 'dlquota', 'hddquota', 'user', 'templateName'] diff --git a/module/remote/thriftbackend/pyload.thrift b/module/remote/thriftbackend/pyload.thrift index c628dff78..23b39fada 100644 --- a/module/remote/thriftbackend/pyload.thrift +++ b/module/remote/thriftbackend/pyload.thrift @@ -175,7 +175,7 @@ struct PackageInfo { } // thrift does not allow recursive datatypes, so all data is accumulated and mapped with id -struct PackageView { +struct TreeCollection { 1: PackageInfo root, 2: map<FileID, FileInfo> files, 3: map<PackageID, PackageInfo> packages @@ -385,19 +385,19 @@ service Pyload { // File Information retrival //////////////////////////// - PackageView getAllFiles(), - PackageView getAllUnfinishedFiles(), + TreeCollection getAllFiles(), + TreeCollection getAllUnfinishedFiles(), // pid -1 for root, full=False only delivers first level in tree - PackageView getFileTree(1: PackageID pid, 2: bool full), - PackageView getUnfinishedFileTree(1: PackageID pid, 2: bool full), + TreeCollection getFileTree(1: PackageID pid, 2: bool full), + TreeCollection getUnfinishedFileTree(1: PackageID pid, 2: bool full), // same as above with full=False - PackageView getPackageContent(1: PackageID pid), + TreeCollection getPackageContent(1: PackageID pid), PackageInfo getPackageInfo(1: PackageID pid) throws (1: PackageDoesNotExists e), FileInfo getFileInfo(1: FileID fid) throws (1: FileDoesNotExists e), - map<FileID, FileInfo> findFiles(1: string pattern), + TreeCollection findFiles(1: string pattern), /////////////////////// // Modify Downloads diff --git a/module/remote/thriftbackend/thriftgen/pyload/Pyload-remote b/module/remote/thriftbackend/thriftgen/pyload/Pyload-remote index 5b4a6fc75..a84de7978 100755 --- a/module/remote/thriftbackend/thriftgen/pyload/Pyload-remote +++ b/module/remote/thriftbackend/thriftgen/pyload/Pyload-remote @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# Autogenerated by Thrift Compiler (0.9.0-dev) +# Autogenerated by Thrift Compiler (0.8.0) # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # @@ -64,14 +64,14 @@ if len(sys.argv) <= 1 or sys.argv[1] == '--help': print ' void renameCollPack(string name, string new_name)' print ' void deleteCollPack(string name)' print ' void deleteCollLink(string url)' - print ' PackageView getAllFiles()' - print ' PackageView getAllUnfinishedFiles()' - print ' PackageView getFileTree(PackageID pid, bool full)' - print ' PackageView getUnfinishedFileTree(PackageID pid, bool full)' - print ' PackageView getPackageContent(PackageID pid)' + print ' TreeCollection getAllFiles()' + print ' TreeCollection getAllUnfinishedFiles()' + print ' TreeCollection getFileTree(PackageID pid, bool full)' + print ' TreeCollection getUnfinishedFileTree(PackageID pid, bool full)' + print ' TreeCollection getPackageContent(PackageID pid)' print ' PackageInfo getPackageInfo(PackageID pid)' print ' FileInfo getFileInfo(FileID fid)' - print ' findFiles(string pattern)' + print ' TreeCollection findFiles(string pattern)' print ' void restartPackage(PackageID pid)' print ' void restartFile(FileID fid)' print ' void recheckPackage(PackageID pid)' diff --git a/module/remote/thriftbackend/thriftgen/pyload/Pyload.py b/module/remote/thriftbackend/thriftgen/pyload/Pyload.py index ba5d8cadc..c807d3d9e 100644 --- a/module/remote/thriftbackend/thriftgen/pyload/Pyload.py +++ b/module/remote/thriftbackend/thriftgen/pyload/Pyload.py @@ -1,5 +1,5 @@ # -# Autogenerated by Thrift Compiler (0.9.0-dev) +# Autogenerated by Thrift Compiler (0.8.0) # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # @@ -8,7 +8,7 @@ from thrift.Thrift import TType, TMessageType, TException from ttypes import * -from thrift.Thrift import TProcessor +from thrift.Thrift import TProcessor, TApplicationException from thrift.protocol.TBase import TBase, TExceptionBase @@ -5636,7 +5636,7 @@ class getAllFiles_result(TBase): ] thrift_spec = ( - (0, TType.STRUCT, 'success', (PackageView, PackageView.thrift_spec), None, ), # 0 + (0, TType.STRUCT, 'success', (TreeCollection, TreeCollection.thrift_spec), None, ), # 0 ) def __init__(self, success=None,): @@ -5663,7 +5663,7 @@ class getAllUnfinishedFiles_result(TBase): ] thrift_spec = ( - (0, TType.STRUCT, 'success', (PackageView, PackageView.thrift_spec), None, ), # 0 + (0, TType.STRUCT, 'success', (TreeCollection, TreeCollection.thrift_spec), None, ), # 0 ) def __init__(self, success=None,): @@ -5704,7 +5704,7 @@ class getFileTree_result(TBase): ] thrift_spec = ( - (0, TType.STRUCT, 'success', (PackageView, PackageView.thrift_spec), None, ), # 0 + (0, TType.STRUCT, 'success', (TreeCollection, TreeCollection.thrift_spec), None, ), # 0 ) def __init__(self, success=None,): @@ -5745,7 +5745,7 @@ class getUnfinishedFileTree_result(TBase): ] thrift_spec = ( - (0, TType.STRUCT, 'success', (PackageView, PackageView.thrift_spec), None, ), # 0 + (0, TType.STRUCT, 'success', (TreeCollection, TreeCollection.thrift_spec), None, ), # 0 ) def __init__(self, success=None,): @@ -5782,7 +5782,7 @@ class getPackageContent_result(TBase): ] thrift_spec = ( - (0, TType.STRUCT, 'success', (PackageView, PackageView.thrift_spec), None, ), # 0 + (0, TType.STRUCT, 'success', (TreeCollection, TreeCollection.thrift_spec), None, ), # 0 ) def __init__(self, success=None,): @@ -5901,7 +5901,7 @@ class findFiles_result(TBase): ] thrift_spec = ( - (0, TType.MAP, 'success', (TType.I32,None,TType.STRUCT,(FileInfo, FileInfo.thrift_spec)), None, ), # 0 + (0, TType.STRUCT, 'success', (TreeCollection, TreeCollection.thrift_spec), None, ), # 0 ) def __init__(self, success=None,): diff --git a/module/remote/thriftbackend/thriftgen/pyload/constants.py b/module/remote/thriftbackend/thriftgen/pyload/constants.py index f8960dc63..7842b3177 100644 --- a/module/remote/thriftbackend/thriftgen/pyload/constants.py +++ b/module/remote/thriftbackend/thriftgen/pyload/constants.py @@ -1,5 +1,5 @@ # -# Autogenerated by Thrift Compiler (0.9.0-dev) +# Autogenerated by Thrift Compiler (0.8.0) # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # diff --git a/module/remote/thriftbackend/thriftgen/pyload/ttypes.py b/module/remote/thriftbackend/thriftgen/pyload/ttypes.py index 3e4cce276..b61d4c479 100644 --- a/module/remote/thriftbackend/thriftgen/pyload/ttypes.py +++ b/module/remote/thriftbackend/thriftgen/pyload/ttypes.py @@ -1,5 +1,5 @@ # -# Autogenerated by Thrift Compiler (0.9.0-dev) +# Autogenerated by Thrift Compiler (0.8.0) # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # @@ -119,28 +119,31 @@ class FileStatus(TBase): class PackageStatus(TBase): Ok = 0 Paused = 1 - Remote = 2 + Folder = 2 + Remote = 3 _VALUES_TO_NAMES = { 0: "Ok", 1: "Paused", - 2: "Remote", + 2: "Folder", + 3: "Remote", } _NAMES_TO_VALUES = { "Ok": 0, "Paused": 1, - "Remote": 2, + "Folder": 2, + "Remote": 3, } class Input(TBase): NA = 0 Text = 1 - TextBox = 2 + Textbox = 2 Password = 3 Bool = 4 Click = 5 - Choice = 6 + Select = 6 Multiple = 7 List = 8 Table = 9 @@ -148,11 +151,11 @@ class Input(TBase): _VALUES_TO_NAMES = { 0: "NA", 1: "Text", - 2: "TextBox", + 2: "Textbox", 3: "Password", 4: "Bool", 5: "Click", - 6: "Choice", + 6: "Select", 7: "Multiple", 8: "List", 9: "Table", @@ -161,11 +164,11 @@ class Input(TBase): _NAMES_TO_VALUES = { "NA": 0, "Text": 1, - "TextBox": 2, + "Textbox": 2, "Password": 3, "Bool": 4, "Click": 5, - "Choice": 6, + "Select": 6, "Multiple": 7, "List": 8, "Table": 9, @@ -196,22 +199,20 @@ class Permission(TBase): Add = 1 Delete = 2 Modify = 4 - Status = 8 - Download = 16 - Accounts = 32 - Interaction = 64 - Addons = 128 + Download = 8 + Accounts = 16 + Interaction = 32 + Addons = 64 _VALUES_TO_NAMES = { 0: "All", 1: "Add", 2: "Delete", 4: "Modify", - 8: "Status", - 16: "Download", - 32: "Accounts", - 64: "Interaction", - 128: "Addons", + 8: "Download", + 16: "Accounts", + 32: "Interaction", + 64: "Addons", } _NAMES_TO_VALUES = { @@ -219,11 +220,10 @@ class Permission(TBase): "Add": 1, "Delete": 2, "Modify": 4, - "Status": 8, - "Download": 16, - "Accounts": 32, - "Interaction": 64, - "Addons": 128, + "Download": 8, + "Accounts": 16, + "Interaction": 32, + "Addons": 64, } class Role(TBase): @@ -559,7 +559,7 @@ class PackageInfo(TBase): self.pids = pids -class PackageView(TBase): +class TreeCollection(TBase): """ Attributes: - root |