diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2012-12-17 21:28:10 +0100 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2012-12-17 21:28:10 +0100 |
commit | c19a05c355760e1e0782ccb434eae4459baaf4cd (patch) | |
tree | 0e166b6917261101bb38fe35cb3bb072ee9923fb | |
parent | updated lots of libraries (diff) | |
download | pyload-c19a05c355760e1e0782ccb434eae4459baaf4cd.tar.xz |
small api changes
-rw-r--r-- | module/Api.py | 7 | ||||
-rw-r--r-- | module/remote/pyload.thrift | 12 | ||||
-rw-r--r-- | module/remote/ttypes.py | 21 | ||||
-rw-r--r-- | module/remote/ttypes_debug.py | 1 | ||||
-rw-r--r-- | module/web/static/js/models/File.js | 4 | ||||
-rw-r--r-- | pavement.py | 2 |
6 files changed, 32 insertions, 15 deletions
diff --git a/module/Api.py b/module/Api.py index d8e7c537e..8422a10a0 100644 --- a/module/Api.py +++ b/module/Api.py @@ -90,7 +90,7 @@ urlmatcher = re.compile(r"((https?|ftps?|xdcc|sftp):((//)|(\\\\))+[\w\d:#@%/;$() stateMap = { DownloadState.All: frozenset(getattr(DownloadStatus, x) for x in dir(DownloadStatus) if not x.startswith("_")), DownloadState.Finished : frozenset((DownloadStatus.Finished, DownloadStatus.Skipped)), - DownloadState.Unfinished : None, + DownloadState.Unfinished : None, # set below DownloadState.Failed : frozenset((DownloadStatus.Failed, DownloadStatus.TempOffline, DownloadStatus.Aborted)), DownloadState.Unmanaged: None, #TODO } @@ -172,6 +172,11 @@ class Api(Iface): return self.core.version @RequirePerm(Permission.All) + def getWSAddress(self): + """Gets and address for the websocket based on configuration""" + # TODO + + @RequirePerm(Permission.All) def statusServer(self): """Some general information about the current status of pyLoad. diff --git a/module/remote/pyload.thrift b/module/remote/pyload.thrift index 902c01534..0c4eea9c4 100644 --- a/module/remote/pyload.thrift +++ b/module/remote/pyload.thrift @@ -33,7 +33,7 @@ enum DownloadStatus { } // Download states, combination of several downloadstatuses -// defined in Filedatabase +// defined in Api enum DownloadState { All, Finished, @@ -68,10 +68,13 @@ enum PackageStatus { // types for user interaction // some may only be place holder currently not supported // also all input - output combination are not reasonable, see InteractionManager for further info -// Todo: how about: time, int, ip, file, s.o. +// Todo: how about: time, ip, s.o. enum Input { NA, Text, + Int, + File, + Folder, Textbox, Password, Bool, // confirm like, yes or no dialog @@ -126,6 +129,7 @@ struct ProgressInfo { 8: optional DownloadProgress download } +# TODO: Maybe more are needed? Should be simple values struct ServerStatus { 1: bool pause, 2: i16 active, @@ -328,6 +332,7 @@ service Pyload { /////////////////////// string getServerVersion(), + string getWSAddress(), ServerStatus statusServer(), void pauseServer(), void unpauseServer(), @@ -340,9 +345,6 @@ service Pyload { bool isTimeReconnect(), bool toggleReconnect(), - // TODO - //void scanDownloadFolder(), - list<ProgressInfo> getProgressInfo(), /////////////////////// diff --git a/module/remote/ttypes.py b/module/remote/ttypes.py index 0412c3709..36b56d961 100644 --- a/module/remote/ttypes.py +++ b/module/remote/ttypes.py @@ -40,14 +40,17 @@ class FileStatus: class Input: NA = 0 Text = 1 - Textbox = 2 - Password = 3 - Bool = 4 - Click = 5 - Select = 6 - Multiple = 7 - List = 8 - Table = 9 + Int = 2 + File = 3 + Folder = 4 + Textbox = 5 + Password = 6 + Bool = 7 + Click = 8 + Select = 9 + Multiple = 10 + List = 11 + Table = 12 class MediaType: All = 0 @@ -438,6 +441,8 @@ class Iface(object): pass def getUserPlugins(self): pass + def getWSAddress(self): + pass def hasAddonHandler(self, plugin, func): pass def isInteractionWaiting(self, mode): diff --git a/module/remote/ttypes_debug.py b/module/remote/ttypes_debug.py index 0e5312fdc..1b7065d9a 100644 --- a/module/remote/ttypes_debug.py +++ b/module/remote/ttypes_debug.py @@ -82,6 +82,7 @@ methods = { 'getServerVersion': basestring, 'getUserData': UserData, 'getUserPlugins': (list, ConfigInfo), + 'getWSAddress': basestring, 'hasAddonHandler': bool, 'isInteractionWaiting': bool, 'isTimeDownload': bool, diff --git a/module/web/static/js/models/File.js b/module/web/static/js/models/File.js index 71aa2b84f..66d9ef050 100644 --- a/module/web/static/js/models/File.js +++ b/module/web/static/js/models/File.js @@ -26,6 +26,10 @@ define(['jquery', 'backbone', 'underscore'], function($, Backbone, _) { // Any time a model attribute is set, this method is called validate: function(attrs) { + }, + + isDownload : function() { + return this.has('download') } }); diff --git a/pavement.py b/pavement.py index 9b99d9298..e6e789882 100644 --- a/pavement.py +++ b/pavement.py @@ -58,7 +58,7 @@ setup( include_package_data=True, exclude_package_data={'pyload': ['docs*', 'scripts*', 'tests*']}, #exluced from build but not from sdist # 'bottle >= 0.10.0' not in list, because its small and contain little modifications - install_requires=['pycurl', 'jinja2', 'Beaker >= 1.6'] + extradeps, + install_requires=['pycurl', 'jinja2 >= 2.6', 'Beaker >= 1.6'] + extradeps, tests_require=['websocket-client >= 0.8.0'], extras_require={ 'SSL': ["pyOpenSSL"], |