diff --git a/deluge/_rpcapi.py b/deluge/_rpcapi.py new file mode 100644 index 000000000..4ca9dc226 --- /dev/null +++ b/deluge/_rpcapi.py @@ -0,0 +1,20 @@ +from new import classobj +from deluge.core.core import Core +from deluge.core.daemon import Daemon + +class RpcApi: + pass + +def scan_for_methods(obj): + methods = { + '__doc__': 'Methods available in %s' % obj.__name__.lower() + } + for d in dir(obj): + if not hasattr(getattr(obj,d), '_rpcserver_export'): + continue + methods[d] = getattr(obj, d) + cobj = classobj(obj.__name__.lower(), (object,), methods) + setattr(RpcApi, obj.__name__.lower(), cobj) + +scan_for_methods(Core) +scan_for_methods(Daemon) diff --git a/docs/build/doctrees/core/index.doctree b/docs/build/doctrees/core/index.doctree index d935f89a7..f5eac5438 100644 Binary files a/docs/build/doctrees/core/index.doctree and b/docs/build/doctrees/core/index.doctree differ diff --git a/docs/build/doctrees/core/rpc.doctree b/docs/build/doctrees/core/rpc.doctree new file mode 100644 index 000000000..b84ec90f4 Binary files /dev/null and b/docs/build/doctrees/core/rpc.doctree differ diff --git a/docs/build/doctrees/environment.pickle b/docs/build/doctrees/environment.pickle index ca33f75b2..45f09cb85 100644 Binary files a/docs/build/doctrees/environment.pickle and b/docs/build/doctrees/environment.pickle differ diff --git a/docs/build/html/_sources/core/rpc.txt b/docs/build/html/_sources/core/rpc.txt index 8c25f874c..a229c1eb8 100644 --- a/docs/build/html/_sources/core/rpc.txt +++ b/docs/build/html/_sources/core/rpc.txt @@ -101,4 +101,5 @@ daemon's state that the clients need to be made aware of. Remote API ---------- -TODO \ No newline at end of file +.. autoclass:: deluge._rpcapi.RpcApi + :members: \ No newline at end of file diff --git a/docs/build/html/core/rpc.html b/docs/build/html/core/rpc.html index 1cdf59186..8a45d4518 100644 --- a/docs/build/html/core/rpc.html +++ b/docs/build/html/core/rpc.html @@ -135,7 +135,347 @@ being emitted.

Remote API

-

TODO

+
+
+ +class deluge._rpcapi.RpcApi
+
+
+ +class core
+

Methods available in core

+
+
+add_torrent_file(filename, filedump, options)
+

Adds a torrent file to the session.

+ +++ + + + + + +
Parameters:
    +
  • filename – str, the filename of the torrent
  • +
  • filedump – str, a base64 encoded string of the torrent file contents
  • +
  • options – dict, the options to apply to the torrent on add
  • +
+
Returns:

the torrent_id as a str or None

+
+
+ +
+
+add_torrent_magnet(uri, options)
+

Adds a torrent from a magnet link.

+ +++ + + + +
Parameters:
    +
  • uri – str, the magnet link
  • +
  • options – dict, the options to apply to the torrent on add
  • +
+
+
+ +
+
+add_torrent_url(url, options, headers=None)
+

Adds a torrent from a url. Deluge will attempt to fetch the torrent +from url prior to adding it to the session.

+ +++ + + + + + +
Parameters:
    +
  • url – str, the url pointing to the torrent file
  • +
  • options – dict, the options to apply to the torrent on add
  • +
  • headers – dict, any optional headers to send
  • +
+
Returns:

the torrent_id as a str or None, if calling locally, then it +will return a Deferred that fires once the torrent has been added

+
+
+ +
+
+force_recheck(torrent_ids)
+
Forces a data recheck on torrent_ids
+ +
+
+get_available_plugins()
+
Returns a list of plugins available in the core
+ +
+
+get_cache_status()
+

Returns a dictionary of the session’s cache status.

+ +++ + + + +
Returns:a dict of the cache status
+
+ +
+
+get_config()
+
Get all the preferences as a dictionary
+ +
+
+get_config_value(key)
+
Get the config value for key
+ +
+
+get_config_values(keys)
+
Get the config values for the entered keys
+ +
+
+get_dht_nodes()
+
Returns the number of dht nodes
+ +
+
+get_download_rate()
+
Returns the payload download rate
+ +
+
+get_enabled_plugins()
+
Returns a list of enabled plugins in the core
+ +
+
+get_filter_tree(show_zero_hits=True, hide_cat=None)
+
returns {field: [(value,count)] } +for use in sidebar(s)
+ +
+
+get_health()
+
Returns True if we have established incoming connections
+ +
+
+get_listen_port()
+
Returns the active listen port
+ +
+
+get_num_connections()
+
Returns the current number of connections
+ +
+
+get_path_size(path)
+
Returns the size of the file or folder ‘path’ and -1 if the path is +unaccessible (non-existent or insufficient privs)
+ +
+
+get_session_state()
+
Returns a list of torrent_ids in the session.
+ +
+
+get_session_status(keys)
+

Gets the session status values for ‘keys’

+ +++ + + + + + + + +
Parameter:keys – list of strings, the keys for which we want values
Returns:a dictionary of {key: value, ...}
Return type:dict
+
+ +
+
+get_stats()
+
document me!!!
+ +
+
+get_status_keys()
+
returns all possible keys for the keys argument in get_torrent(s)_status.
+ +
+
+get_torrents_status(filter_dict, keys)
+
returns all torrents , optionally filtered by filter_dict.
+ +
+
+get_upload_rate()
+
Returns the payload upload rate
+ +
+
+pause_all_torrents()
+
Pause all torrents in the session
+ +
+
+rename_files(torrent_id, filenames)
+
Renames files in ‘torrent_id’. The ‘filenames’ parameter should be a +list of (index, filename) pairs.
+ +
+
+rename_folder(torrent_id, folder, new_folder)
+
Renames the ‘folder’ to ‘new_folder’ in ‘torrent_id’.
+ +
+
+rescan_plugins()
+
Rescans the plugin folders for new plugins
+ +
+
+resume_all_torrents()
+
Resume all torrents in the session
+ +
+
+set_config(config)
+
Set the config with values from dictionary
+ +
+
+set_torrent_auto_managed(torrent_id, value)
+
Sets the auto managed flag for queueing purposes
+ +
+
+set_torrent_file_priorities(torrent_id, priorities)
+
Sets a torrents file priorities
+ +
+
+set_torrent_max_connections(torrent_id, value)
+
Sets a torrents max number of connections
+ +
+
+set_torrent_max_download_speed(torrent_id, value)
+
Sets a torrents max download speed
+ +
+
+set_torrent_max_upload_slots(torrent_id, value)
+
Sets a torrents max number of upload slots
+ +
+
+set_torrent_max_upload_speed(torrent_id, value)
+
Sets a torrents max upload speed
+ +
+
+set_torrent_move_completed(torrent_id, value)
+
Sets the torrent to be moved when completed
+ +
+
+set_torrent_move_completed_path(torrent_id, value)
+
Sets the path for the torrent to be moved when completed
+ +
+
+set_torrent_options(torrent_ids, options)
+
Sets the torrent options for torrent_ids
+ +
+
+set_torrent_prioritize_first_last(torrent_id, value)
+
Sets a higher priority to the first and last pieces
+ +
+
+set_torrent_remove_at_ratio(torrent_id, value)
+
Sets the torrent to be removed at ‘stop_ratio’
+ +
+
+set_torrent_stop_at_ratio(torrent_id, value)
+
Sets the torrent to stop at ‘stop_ratio’
+ +
+
+set_torrent_stop_ratio(torrent_id, value)
+
Sets the ratio when to stop a torrent if ‘stop_at_ratio’ is set
+ +
+
+set_torrent_trackers(torrent_id, trackers)
+
Sets a torrents tracker list. trackers will be [{“url”, “tier”}]
+ +
+
+test_listen_port()
+
Checks if active port is open
+ +
+
+upload_plugin(filename, plugin_data)
+
This method is used to upload new plugins to the daemon. It is used +when connecting to the daemon remotely and installing a new plugin on +the client side. ‘plugin_data’ is a xmlrpc.Binary object of the file data, +ie, plugin_file.read()
+ +
+ +
+
+ +class RpcApi.daemon
+

Methods available in daemon

+
+
+get_method_list()
+
Returns a list of the exported methods.
+ +
+
+info()
+

Returns some info from the daemon.

+ +++ + + + +
Returns:str, the version number
+
+ +
+ +
+
diff --git a/docs/build/html/genindex.html b/docs/build/html/genindex.html index 2f8757b0e..d5a99141e 100644 --- a/docs/build/html/genindex.html +++ b/docs/build/html/genindex.html @@ -43,7 +43,7 @@

Index

- _ | A | C | D | F | G | I | L | O | R | S | V | W + _ | A | C | D | F | G | I | L | O | P | R | S | T | U | V | W
@@ -60,8 +60,11 @@
+
add_torrent_file() (deluge._rpcapi.RpcApi.core method)
+
add_torrent_magnet() (deluge._rpcapi.RpcApi.core method)
+
add_torrent_url() (deluge._rpcapi.RpcApi.core method)
apply_all() (deluge.config.Config method)
-
apply_set_functions() (deluge.config.Config method)
+
apply_set_functions() (deluge.config.Config method)

C

@@ -88,9 +91,10 @@
fdate() (in module deluge.common)
fetch_url() (in module deluge.common)
+
force_recheck() (deluge._rpcapi.RpcApi.core method)
fpcnt() (in module deluge.common)
-
fpeer() (in module deluge.common)
-
free_space() (in module deluge.common)
+
fpeer() (in module deluge.common)
+
free_space() (in module deluge.common)
fsize() (in module deluge.common)
fspeed() (in module deluge.common)
ftime() (in module deluge.common)
@@ -100,12 +104,34 @@
+
get_available_plugins() (deluge._rpcapi.RpcApi.core method)
+
get_cache_status() (deluge._rpcapi.RpcApi.core method)
+
get_config() (deluge._rpcapi.RpcApi.core method)
+
get_config_value() (deluge._rpcapi.RpcApi.core method)
+
get_config_values() (deluge._rpcapi.RpcApi.core method)
get_default_config_dir() (in module deluge.common)
get_default_download_dir() (in module deluge.common)
+
get_dht_nodes() (deluge._rpcapi.RpcApi.core method)
+
get_download_rate() (deluge._rpcapi.RpcApi.core method)
+
get_enabled_plugins() (deluge._rpcapi.RpcApi.core method)
+
get_filter_tree() (deluge._rpcapi.RpcApi.core method)
+
get_health() (deluge._rpcapi.RpcApi.core method)
get_item() (deluge.config.Config method)
-
get_path_size() (in module deluge.common)
+
get_listen_port() (deluge._rpcapi.RpcApi.core method)
+
get_method_list() (deluge._rpcapi.RpcApi.daemon method)
+
get_num_connections() (deluge._rpcapi.RpcApi.core method)
+
get_path_size() (deluge._rpcapi.RpcApi.core method)
+
+
(in module deluge.common)
+
get_pixmap() (in module deluge.common)
get_revision() (in module deluge.common)
+
get_session_state() (deluge._rpcapi.RpcApi.core method)
+
get_session_status() (deluge._rpcapi.RpcApi.core method)
+
get_stats() (deluge._rpcapi.RpcApi.core method)
+
get_status_keys() (deluge._rpcapi.RpcApi.core method)
+
get_torrents_status() (deluge._rpcapi.RpcApi.core method)
+
get_upload_rate() (deluge._rpcapi.RpcApi.core method)
get_version() (in module deluge.common)
@@ -113,6 +139,7 @@
+
info() (deluge._rpcapi.RpcApi.daemon method)
is_ip() (in module deluge.common)
is_magnet() (in module deluge.common)
is_url() (in module deluge.common)
@@ -134,12 +161,26 @@
osx_check() (in module deluge.common)
+

P

+
+
+ +
pause_all_torrents() (deluge._rpcapi.RpcApi.core method)
+
+

R

register_change_callback() (deluge.config.Config method)
-
register_set_function() (deluge.config.Config method)
+
register_set_function() (deluge.config.Config method)
+
rename_files() (deluge._rpcapi.RpcApi.core method)
+
rename_folder() (deluge._rpcapi.RpcApi.core method)
+
rescan_plugins() (deluge._rpcapi.RpcApi.core method)
+
resume_all_torrents() (deluge._rpcapi.RpcApi.core method)
+
RpcApi (class in deluge._rpcapi)
+
RpcApi.core (class in deluge._rpcapi)
+
RpcApi.daemon (class in deluge._rpcapi)
run_converter() (deluge.config.Config method)
@@ -148,7 +189,36 @@
save() (deluge.config.Config method)
-
set_item() (deluge.config.Config method)
+
set_config() (deluge._rpcapi.RpcApi.core method)
+
set_item() (deluge.config.Config method)
+
set_torrent_auto_managed() (deluge._rpcapi.RpcApi.core method)
+
set_torrent_file_priorities() (deluge._rpcapi.RpcApi.core method)
+
set_torrent_max_connections() (deluge._rpcapi.RpcApi.core method)
+
set_torrent_max_download_speed() (deluge._rpcapi.RpcApi.core method)
+
set_torrent_max_upload_slots() (deluge._rpcapi.RpcApi.core method)
+
set_torrent_max_upload_speed() (deluge._rpcapi.RpcApi.core method)
+
set_torrent_move_completed() (deluge._rpcapi.RpcApi.core method)
+
set_torrent_move_completed_path() (deluge._rpcapi.RpcApi.core method)
+
set_torrent_options() (deluge._rpcapi.RpcApi.core method)
+
set_torrent_prioritize_first_last() (deluge._rpcapi.RpcApi.core method)
+
set_torrent_remove_at_ratio() (deluge._rpcapi.RpcApi.core method)
+
set_torrent_stop_at_ratio() (deluge._rpcapi.RpcApi.core method)
+
set_torrent_stop_ratio() (deluge._rpcapi.RpcApi.core method)
+
set_torrent_trackers() (deluge._rpcapi.RpcApi.core method)
+
+ +

T

+
+
+ +
test_listen_port() (deluge._rpcapi.RpcApi.core method)
+
+ +

U

+
+
+ +
upload_plugin() (deluge._rpcapi.RpcApi.core method)

V

diff --git a/docs/build/html/objects.inv b/docs/build/html/objects.inv index 33d615883..8e7ff0b1e 100644 --- a/docs/build/html/objects.inv +++ b/docs/build/html/objects.inv @@ -3,40 +3,90 @@ # Version: 1.2.0-dev deluge.config mod modules/config.html deluge.common mod modules/common.html -deluge.config.Config.apply_all method modules/config.html deluge.config.Config.__getitem__ method modules/config.html -deluge.config.Config.__setitem__ method modules/config.html -deluge.config.Config class modules/config.html -deluge.common.is_ip function modules/common.html -deluge.config.Config.get_item method modules/config.html -deluge.common.fsize function modules/common.html -deluge.common.ftime function modules/common.html -deluge.common.free_space function modules/common.html -deluge.config.Config.config_file attribute modules/config.html -deluge.common.open_file function modules/common.html -deluge.common.get_default_config_dir function modules/common.html -deluge.common.open_url_in_browser function modules/common.html -deluge.common.get_path_size function modules/common.html -deluge.config.Config.register_set_function method modules/config.html -deluge.common.is_url function modules/common.html -deluge.common.fpcnt function modules/common.html -deluge.common.fspeed function modules/common.html -deluge.config.Config.run_converter method modules/config.html -deluge.config.Config.register_change_callback method modules/config.html -deluge.common.get_version function modules/common.html +deluge._rpcapi.RpcApi.core.set_torrent_stop_at_ratio method core/rpc.html +deluge._rpcapi.RpcApi.core.get_config_values method core/rpc.html +deluge._rpcapi.RpcApi.core.get_status_keys method core/rpc.html +deluge._rpcapi.RpcApi.core.get_torrents_status method core/rpc.html +deluge._rpcapi.RpcApi.core.set_torrent_max_download_speed method core/rpc.html +deluge._rpcapi.RpcApi.core.set_torrent_prioritize_first_last method core/rpc.html deluge.config.Config.config attribute modules/config.html -deluge.config.Config.apply_set_functions method modules/config.html -deluge.common.get_revision function modules/common.html -deluge.common.fdate function modules/common.html -deluge.common.get_pixmap function modules/common.html +deluge._rpcapi.RpcApi.daemon.get_method_list method core/rpc.html +deluge._rpcapi.RpcApi.core.rescan_plugins method core/rpc.html deluge.common.fpeer function modules/common.html -deluge.common.is_magnet function modules/common.html -deluge.common.fetch_url function modules/common.html deluge.config.Config.load method modules/config.html deluge.common.create_magnet_uri function modules/common.html +deluge.common.vista_check function modules/common.html +deluge._rpcapi.RpcApi.core.add_torrent_magnet method core/rpc.html +deluge.common.is_ip function modules/common.html +deluge._rpcapi.RpcApi.core.rename_files method core/rpc.html +deluge._rpcapi.RpcApi.core.get_session_status method core/rpc.html +deluge._rpcapi.RpcApi.core.test_listen_port method core/rpc.html +deluge.common.ftime function modules/common.html +deluge.common.get_default_config_dir function modules/common.html +deluge._rpcapi.RpcApi.core.get_dht_nodes method core/rpc.html +deluge._rpcapi.RpcApi.core.set_torrent_auto_managed method core/rpc.html +deluge.common.fpcnt function modules/common.html +deluge._rpcapi.RpcApi.core.set_torrent_max_connections method core/rpc.html +deluge.common.fspeed function modules/common.html +deluge._rpcapi.RpcApi.core.get_cache_status method core/rpc.html +deluge._rpcapi.RpcApi.core.set_config method core/rpc.html +deluge._rpcapi.RpcApi.daemon.info method core/rpc.html +deluge._rpcapi.RpcApi.core.force_recheck method core/rpc.html +deluge.common.get_version function modules/common.html +deluge._rpcapi.RpcApi.core.get_stats method core/rpc.html +deluge._rpcapi.RpcApi.core.set_torrent_move_completed_path method core/rpc.html +deluge._rpcapi.RpcApi.core.get_health method core/rpc.html +deluge.common.fdate function modules/common.html +deluge._rpcapi.RpcApi.core.set_torrent_remove_at_ratio method core/rpc.html +deluge._rpcapi.RpcApi.core.get_download_rate method core/rpc.html +deluge._rpcapi.RpcApi.core.rename_folder method core/rpc.html +deluge.common.get_default_download_dir function modules/common.html +deluge._rpcapi.RpcApi.daemon class core/rpc.html +deluge._rpcapi.RpcApi.core.set_torrent_options method core/rpc.html +deluge._rpcapi.RpcApi.core.get_config_value method core/rpc.html +deluge._rpcapi.RpcApi.core.get_num_connections method core/rpc.html +deluge.config.Config.apply_all method modules/config.html +deluge._rpcapi.RpcApi.core.get_path_size method core/rpc.html +deluge.config.Config.__setitem__ method modules/config.html +deluge._rpcapi.RpcApi.core.pause_all_torrents method core/rpc.html +deluge.config.Config.get_item method modules/config.html +deluge._rpcapi.RpcApi.core.add_torrent_file method core/rpc.html +deluge.config.Config.register_set_function method modules/config.html +deluge.common.free_space function modules/common.html +deluge.common.open_file function modules/common.html +deluge._rpcapi.RpcApi.core.get_listen_port method core/rpc.html +deluge.common.is_url function modules/common.html +deluge._rpcapi.RpcApi.core.get_enabled_plugins method core/rpc.html +deluge.config.Config.register_change_callback method modules/config.html +deluge._rpcapi.RpcApi.core.get_upload_rate method core/rpc.html +deluge.config.Config.apply_set_functions method modules/config.html +deluge._rpcapi.RpcApi.core.set_torrent_max_upload_speed method core/rpc.html +deluge.common.is_magnet function modules/common.html +deluge._rpcapi.RpcApi.core.get_available_plugins method core/rpc.html +deluge._rpcapi.RpcApi.core.get_session_state method core/rpc.html +deluge.common.get_path_size function modules/common.html +deluge._rpcapi.RpcApi.core.set_torrent_stop_ratio method core/rpc.html +deluge._rpcapi.RpcApi.core class core/rpc.html deluge.common.osx_check function modules/common.html deluge.config.Config.save method modules/config.html +deluge._rpcapi.RpcApi.core.get_filter_tree method core/rpc.html +deluge._rpcapi.RpcApi.core.upload_plugin method core/rpc.html +deluge._rpcapi.RpcApi.core.resume_all_torrents method core/rpc.html +deluge.common.fsize function modules/common.html +deluge._rpcapi.RpcApi.core.set_torrent_file_priorities method core/rpc.html +deluge._rpcapi.RpcApi class core/rpc.html +deluge.config.Config.config_file attribute modules/config.html +deluge.common.open_url_in_browser function modules/common.html +deluge.config.Config.run_converter method modules/config.html +deluge._rpcapi.RpcApi.core.set_torrent_move_completed method core/rpc.html +deluge.common.get_revision function modules/common.html +deluge._rpcapi.RpcApi.core.get_config method core/rpc.html +deluge.common.get_pixmap function modules/common.html +deluge.common.fetch_url function modules/common.html +deluge._rpcapi.RpcApi.core.set_torrent_max_upload_slots method core/rpc.html +deluge.config.Config class modules/config.html deluge.config.Config.set_item method modules/config.html deluge.common.windows_check function modules/common.html -deluge.common.vista_check function modules/common.html -deluge.common.get_default_download_dir function modules/common.html +deluge._rpcapi.RpcApi.core.set_torrent_trackers method core/rpc.html +deluge._rpcapi.RpcApi.core.add_torrent_url method core/rpc.html diff --git a/docs/build/html/searchindex.js b/docs/build/html/searchindex.js index 053aef1a3..77269916b 100644 --- a/docs/build/html/searchindex.js +++ b/docs/build/html/searchindex.js @@ -1 +1 @@ -Search.setIndex({desctypes:{"0":"method","1":"class","2":"function","3":"attribute"},terms:{represent:8,all:[6,1],is_ip:8,four:6,follow:1,disk:1,dht:[],output_vers:1,privat:4,exception_typ:6,base64:[],readabl:8,send:[],program:8,sent:6,liter:[1,8],string:[6,1,8],fals:[1,8],util:8,stop_at_ratio:[],list:[6,8],upload:[],magnet:8,item:1,create_magnet_uri:8,rpc_respons:6,direct:0,second:8,download:8,config_dir:1,port:[],index:0,what:[6,1],repli:6,abl:4,access:[1,4,8],version:[1,8],"new":[],method:6,metadata:8,slot:[],full:4,hash:8,filter_dict:[],gener:6,get_health:[],rename_fil:[],path:[1,8],along:1,modifi:1,sinc:[1,8],valu:[6,1,4,8],open_url_in_brows:8,search:0,purpos:[],convers:1,get_download_r:[],queue:[],prior:[],osx_check:8,chang:[6,1],infohash:8,overrid:4,decim:8,appli:[],modul:[0,1],prefer:4,filenam:[1,8],initiliaz:1,api:[6,5],rename_fold:[],instal:[],total:8,establish:[],unit:8,regex:8,from:[6,8],would:[6,1],commun:6,regist:1,two:8,call:[6,1],type:[6,1,8],flag:[],accept:1,hold:6,cach:[],dot:6,must:1,none:[1,8],augment:1,can:[0,1,6],dec:8,root:0,fetch:8,def:1,control:1,defer:[],quickstart:0,process:6,get_default_download_dir:8,indic:0,want:[1,4],serial:1,multipl:6,filepath:8,anoth:6,add_torrent_url:[],how:4,set_item:1,instead:6,simpl:8,"23m":8,set_torrent_max_connect:[],get_filter_tre:[],max:[],lag:6,befor:1,mac:8,date:8,data:[6,8],attempt:[],add_torrent_magnet:[],caus:6,callback:1,su5225urmtueqldxqwrb2eqwn6kltykn:8,allow:1,enter:[],egg:8,order:6,config_fil:1,get_pixmap:8,move:[],rpc_event:6,paramet:[1,8],pixmap:8,monitor:1,set_torrent_track:[],gtk:[0,7,3],set_torrent_move_complet:[],platform:8,window:[4,8],bittorr:8,non:[],within:8,"return":[6,1,8],"__getitem__":1,auto:[],set_torrent_auto_manag:[],initi:[6,1],framework:4,new_fold:[],nov:0,register_set_funct:1,name:[6,1,8],anyth:1,config:[0,1,8],stop_ratio:[],request_id:6,delugerpc:[0,5,6],higher:[],event_nam:6,extj:4,replac:6,realli:1,filedump:[],connect:8,todo:6,event:[6,5],shown:8,space:8,payload:[],content:[0,1],adapt:0,print:1,get_default_config_dir:8,unaccess:[],sphinx:0,earlier:6,given:8,free:8,"__setitem__":1,base:[1,8],rencod:6,dictionari:1,org:8,"byte":8,could:[6,1],traceback:6,set_torrent_remove_at_ratio:[],set_config:[],filter:[],get_config:[],place:8,timezon:8,first:[],rang:[1,8],directli:1,onc:[],number:8,tier:[],done:1,messag:[6,5],owner:1,open:8,add_torrent_fil:[],size:8,prioriti:[],differ:[1,4],fetch_url:8,top:4,get_session_st:[],system:8,least:0,get_upload_r:[],master:0,interfac:[0,4,3],listen:[],consol:[0,2,3],option:8,specifi:4,part:8,than:1,serv:6,kind:6,keyword:6,remot:[6,5],free_spac:8,remov:[],rate:[],fpcnt:8,str:[6,1],is_magnet:8,torrent:8,recheck:[],browser:8,pre:[1,8],test_listen_port:[],arg:6,argument:[6,1],set_torrent_file_prior:[],have:1,tabl:0,need:[6,1],built:4,inform:4,mib:8,fsize:8,get_revis:8,note:1,without:6,take:[6,1],which:[6,1,4],fsize_b:8,unless:1,get_stat:[],object:[6,1],compress:6,pair:[],"class":[1,8],apply_al:1,url:8,urn:8,request:[6,5],uri:8,doe:[1,8],btih:8,set_torrent_max_upload_slot:[],determin:[6,8],apply_now:1,get_enabled_plugin:[],get_torrents_statu:[],show:8,upload_plugin:[],session:[],is_url:8,priv:[],involv:6,current:[1,8],onli:[1,8],ratio:8,configur:[3,1,4,8],activ:[],state:6,should:[0,1],dict:[6,1],get_num_connect:[],get_listen_port:[],get_dht_nod:[],folder:8,local:8,count:[],get_vers:8,variou:[1,8],get:[1,8],stop:[],ssl:[3,4],enabl:4,provid:8,fpeer:8,common:[0,8],contain:0,respond:6,certif:4,set:1,fspeed:8,delug:[0,1,2,3,4,5,6,7,8],signifi:1,respons:[6,5],awar:6,statu:[],someth:1,listen_interfac:[],set_torrent_prioritize_first_last:[],written:1,ftime:8,altern:6,kei:[1,4],vista_check:8,succeed:1,come:6,tue:0,addit:6,last:[],rtype:1,rescan_plugin:[],rpc_error:6,com:[],load:1,simpli:1,point:[],rescan:[],set_torrent_move_completed_path:[],header:[],rpc:[6,5],been:[],insuffici:[],valueerror:1,plugin_data:[],files:8,fire:[],convert:1,ani:[],func:1,those:1,"case":6,look:8,exception_msg:6,zlib:6,windows_check:8,"while":6,error:[6,5],get_available_plugin:[],"default":[1,4,8],kwarg:6,set_torrent_stop_ratio:[],conf:1,incom:[],revis:8,"_statu":[],welcom:0,receiv:6,get_status_kei:[],same:[6,1,4],binari:[],epoch:8,document:0,complet:0,http:8,webserv:4,see:[1,4,8],upon:6,get_cache_statu:[],rais:[6,1],apply_set_funct:1,kib:8,resume_all_torr:[],exampl:1,thi:[0,1,6],plugin:6,show_zero_hit:[],protocol:6,paus:[],less:1,hide_cat:[],via:4,human:8,sidebar:[],speed:8,web:[0,4,3],run_convert:1,easi:8,except:6,param:1,desktop:8,add:4,valid:8,register_change_callback:1,input:1,save:1,build:8,fname:8,xmlrpc:[],format:[6,1,5,8],read:[],piec:[],set_torrent_max_download_spe:[],know:6,get_item:1,daemon:[6,4],like:0,docutil:[1,8],get_session_statu:[],integ:6,server:6,page:0,depend:6,"function":[1,8],www:[],num_peer:8,set_torrent_max_upload_spe:[],some:1,percentag:8,intern:1,toctre:0,get_torr:[],save_dht_st:[],per:8,tracker:8,total_p:8,core:[0,5],set_torrent_stop_at_ratio:[],run:[1,4],usag:[1,8],peer:8,after:1,plugin_fil:[],side:6,includ:8,input_rang:1,client:6,"float":8,encod:[],ensur:6,announc:8,your:[0,4],manag:[],span:[1,8],wai:[1,4],transfer:8,force_recheck:[],why:6,avail:8,start:[],return_valu:6,gib:8,resum:[],pause_all_torr:[],torrent_id:[],form:8,forc:[],tupl:1,bundl:6,message_typ:6,keyerror:1,link:[],newer:1,renam:[],line:1,"true":[1,8],info:8,made:6,possibl:[],whether:1,wish:4,displai:8,below:[6,1],fdate:8,similar:1,emit:6,featur:4,creat:[0,1,8,4,6],"int":[6,1,8],get_config_valu:[],repres:8,twist:4,exist:8,file:[0,1,8],check:8,vista:8,encrypt:4,set_torrent_opt:[],when:[1,4],detail:6,field:[],other:[6,4],bool:[1,8],test:[1,8],you:[0,1,4],node:[],intend:4,svn:8,open_fil:8,longer:6,directori:[1,8],yatblog:[],time:8,get_path_s:8},titles:["Welcome to Deluge’s documentation!","deluge.config","Deluge Console UI","Deluge’s Interfaces","Deluge Web UI","The Deluge Core","Deluge RPC","Deluge GTK UI","deluge.common"],modules:{"deluge.config":1,"deluge.common":8},descrefs:{"deluge.config":{Config:[1,1]},"deluge.common":{is_ip:[8,2],get_pixmap:[8,2],get_default_download_dir:[8,2],fspeed:[8,2],fpeer:[8,2],get_revision:[8,2],is_url:[8,2],vista_check:[8,2],fetch_url:[8,2],open_file:[8,2],get_version:[8,2],fsize:[8,2],ftime:[8,2],get_default_config_dir:[8,2],open_url_in_browser:[8,2],get_path_size:[8,2],free_space:[8,2],windows_check:[8,2],fpcnt:[8,2],osx_check:[8,2],fdate:[8,2],create_magnet_uri:[8,2],is_magnet:[8,2]},"deluge.config.Config":{apply_set_functions:[1,0],apply_all:[1,0],config_file:[1,3],"__getitem__":[1,0],run_converter:[1,0],set_item:[1,0],load:[1,0],"__setitem__":[1,0],register_change_callback:[1,0],register_set_function:[1,0],save:[1,0],config:[1,3],get_item:[1,0]}},filenames:["index","modules/config","interfaces/console","interfaces/index","interfaces/web","core/index","core/rpc","interfaces/gtk","modules/common"]}) \ No newline at end of file +Search.setIndex({desctypes:{"0":"method","1":"attribute","2":"function","3":"class"},terms:{represent:8,all:[6,1],is_ip:8,four:6,follow:1,disk:1,dht:6,output_vers:1,privat:4,exception_typ:6,base64:6,readabl:8,send:6,program:8,sent:6,liter:[1,8],string:[6,1,8],fals:[1,8],util:8,stop_at_ratio:6,list:[6,8],upload:6,magnet:[6,8],item:1,create_magnet_uri:8,rpc_respons:6,direct:0,second:8,download:[6,8],config_dir:1,port:6,index:[0,6],what:[6,1],repli:6,abl:4,access:[1,4,8],version:[6,1,8],"new":6,method:6,metadata:8,slot:6,full:4,hash:8,filter_dict:6,gener:6,get_health:6,rename_fil:6,path:[6,1,8],along:1,modifi:1,sinc:[1,8],valu:[6,1,4,8],open_url_in_brows:8,search:0,purpos:6,convers:1,get_download_r:6,queue:6,prior:6,osx_check:8,chang:[6,1],infohash:8,overrid:4,via:4,appli:6,modul:[0,1],prefer:[6,4],filenam:[6,1,8],initiliaz:1,api:[6,5],rename_fold:6,instal:6,total:8,establish:6,unit:8,regex:8,from:[6,8],would:[6,1],commun:6,regist:1,two:8,call:[6,1],type:[6,1,8],flag:6,accept:1,hold:6,cach:6,dot:6,must:1,none:[6,1,8],augment:1,can:[0,1,6],dec:8,root:0,fetch:[6,8],def:1,control:1,defer:6,quickstart:0,process:6,get_default_download_dir:8,indic:0,want:[6,1,4],serial:1,multipl:6,filepath:8,anoth:6,add_torrent_url:6,how:4,set_item:1,instead:6,simpl:8,"23m":8,set_torrent_max_connect:6,get_filter_tre:6,max:6,lag:6,befor:1,mac:8,date:8,data:[6,8],attempt:6,add_torrent_magnet:6,caus:6,callback:1,su5225urmtueqldxqwrb2eqwn6kltykn:8,allow:1,enter:6,egg:8,order:6,config_fil:1,get_pixmap:8,move:6,rpc_event:6,paramet:[6,1,8],pixmap:8,monitor:1,set_torrent_track:6,gtk:[0,7,3],set_torrent_move_complet:6,platform:8,window:[4,8],bittorr:8,non:6,within:8,"return":[6,1,8],"__getitem__":1,auto:6,set_torrent_auto_manag:6,initi:[6,1],framework:4,new_fold:6,nov:0,register_set_funct:1,name:[6,1,8],anyth:1,config:[0,1,8,6],stop_ratio:6,request_id:6,delugerpc:[0,5,6],higher:6,event_nam:6,extj:4,replac:6,realli:1,filedump:6,connect:[6,8],todo:[],event:[6,5],shown:8,space:8,payload:6,content:[0,1,6],adapt:0,print:1,get_default_config_dir:8,unaccess:6,sphinx:0,earlier:6,given:8,free:8,"__setitem__":1,base:[1,8],rencod:6,dictionari:[6,1],org:8,"byte":8,could:[6,1],traceback:6,set_torrent_remove_at_ratio:6,set_config:6,filter:6,get_config:6,place:8,timezon:8,first:6,rang:[1,8],directli:1,onc:6,number:[6,8],tier:6,done:1,messag:[6,5],owner:1,open:[6,8],add_torrent_fil:6,size:[6,8],prioriti:6,differ:[1,4],fetch_url:8,top:4,get_session_st:6,system:8,least:0,get_upload_r:6,master:0,interfac:[0,4,3],listen:6,consol:[0,2,3],option:[6,8],specifi:4,part:8,than:1,serv:6,kind:6,keyword:6,remot:[6,5],free_spac:8,remov:6,rate:6,fpcnt:8,str:[6,1],is_magnet:8,torrent:[6,8],recheck:6,browser:8,pre:[1,8],test_listen_port:6,arg:6,argument:[6,1],set_torrent_file_prior:6,have:[6,1],tabl:0,need:[6,1],built:4,inform:4,mib:8,fsize:8,get_revis:8,note:1,without:6,take:[6,1],which:[6,1,4],fsize_b:8,unless:1,get_stat:6,object:[6,1],compress:6,pair:6,"_rpcapi":6,"class":[6,1,8],apply_al:1,url:[6,8],urn:8,request:[6,5],uri:[6,8],doe:[1,8],btih:8,set_torrent_max_upload_slot:6,determin:[6,8],apply_now:1,get_enabled_plugin:6,get_torrents_statu:6,show:8,upload_plugin:6,session:6,is_url:8,priv:6,involv:6,current:[6,1,8],onli:[1,8],ratio:[6,8],configur:[3,1,4,8],activ:6,state:6,should:[0,1,6],dict:[6,1],get_num_connect:6,get_listen_port:6,get_dht_nod:6,folder:[6,8],local:[6,8],count:6,get_vers:8,variou:[1,8],get:[6,1,8],stop:6,ssl:[3,4],enabl:[6,4],provid:8,common:[0,8],contain:0,respond:6,certif:4,set:[6,1],fspeed:8,delug:[0,1,2,3,4,5,6,7,8],signifi:1,respons:[6,5],awar:6,statu:6,someth:1,listen_interfac:[],set_torrent_prioritize_first_last:6,written:1,ftime:8,rpcapi:6,altern:6,kei:[6,1,4],vista_check:8,succeed:1,come:6,tue:0,addit:6,last:6,rtype:1,rescan_plugin:6,rpc_error:6,com:[],load:1,simpli:1,point:6,rescan:6,set_torrent_move_completed_path:6,header:6,rpc:[6,5],been:6,insuffici:6,valueerror:1,plugin_data:6,files:8,fire:6,convert:1,ani:6,decim:8,func:1,those:1,"case":6,look:8,exception_msg:6,zlib:6,windows_check:8,"while":6,error:[6,5],get_method_list:6,get_available_plugin:6,"default":[1,4,8],kwarg:6,set_torrent_stop_ratio:6,conf:1,incom:6,revis:8,"_statu":6,welcom:0,receiv:6,get_status_kei:6,same:[6,1,4],binari:6,epoch:8,document:[0,6],complet:[0,6],http:8,webserv:4,see:[1,4,8],upon:6,get_cache_statu:6,rais:[6,1],apply_set_funct:1,kib:8,resume_all_torr:6,exampl:1,thi:[0,1,6],plugin:6,show_zero_hit:6,protocol:6,paus:6,less:1,hide_cat:6,fpeer:8,human:8,sidebar:6,speed:[6,8],web:[0,4,3],run_convert:1,easi:8,except:6,param:1,desktop:8,add:[6,4],valid:8,register_change_callback:1,input:1,save:1,build:8,fname:8,xmlrpc:6,format:[6,1,5,8],read:6,piec:6,set_torrent_max_download_spe:6,know:6,get_item:1,daemon:[6,4],like:0,docutil:[1,8],get_session_statu:6,integ:6,server:6,page:0,depend:6,"function":[1,8],www:[],num_peer:8,set_torrent_max_upload_spe:6,some:[6,1],percentag:8,intern:1,"export":6,toctre:0,get_torr:6,save_dht_st:[],per:8,tracker:[6,8],total_p:8,core:[0,5,6],set_torrent_stop_at_ratio:6,run:[1,4],usag:[1,8],peer:8,after:1,plugin_fil:6,side:6,includ:8,input_rang:1,client:6,"float":8,encod:6,ensur:6,announc:8,your:[0,4],manag:6,span:[1,8],wai:[1,4],transfer:8,force_recheck:6,why:6,avail:[6,8],start:[],return_valu:6,gib:8,resum:6,pause_all_torr:6,torrent_id:6,form:8,forc:6,tupl:1,bundl:6,message_typ:6,keyerror:1,link:6,newer:1,renam:6,line:1,"true":[6,1,8],info:[6,8],made:6,possibl:6,whether:1,wish:4,displai:8,below:[6,1],fdate:8,similar:1,emit:6,featur:4,creat:[0,1,8,4,6],"int":[6,1,8],get_config_valu:6,repres:8,twist:4,exist:[6,8],file:[0,1,8,6],check:[6,8],vista:8,encrypt:4,set_torrent_opt:6,when:[6,1,4],detail:6,field:6,other:[6,4],bool:[1,8],test:[1,8],you:[0,1,4],node:6,junk:[],intend:4,svn:8,open_fil:8,longer:6,directori:[1,8],yatblog:[],time:8,get_path_s:[6,8]},titles:["Welcome to Deluge’s documentation!","deluge.config","Deluge Console UI","Deluge’s Interfaces","Deluge Web UI","The Deluge Core","Deluge RPC","Deluge GTK UI","deluge.common"],modules:{"deluge.config":1,"deluge.common":8},descrefs:{"deluge._rpcapi.RpcApi.core":{force_recheck:[6,0],rename_files:[6,0],get_upload_rate:[6,0],set_torrent_move_completed_path:[6,0],add_torrent_file:[6,0],set_torrent_stop_ratio:[6,0],get_enabled_plugins:[6,0],get_available_plugins:[6,0],get_torrents_status:[6,0],get_path_size:[6,0],rename_folder:[6,0],add_torrent_url:[6,0],set_torrent_prioritize_first_last:[6,0],set_torrent_trackers:[6,0],get_dht_nodes:[6,0],get_status_keys:[6,0],set_torrent_max_download_speed:[6,0],upload_plugin:[6,0],test_listen_port:[6,0],get_stats:[6,0],get_filter_tree:[6,0],set_torrent_stop_at_ratio:[6,0],get_config_values:[6,0],get_listen_port:[6,0],resume_all_torrents:[6,0],get_session_status:[6,0],pause_all_torrents:[6,0],get_health:[6,0],set_torrent_move_completed:[6,0],get_cache_status:[6,0],rescan_plugins:[6,0],get_num_connections:[6,0],set_torrent_max_upload_speed:[6,0],set_torrent_max_upload_slots:[6,0],get_config_value:[6,0],add_torrent_magnet:[6,0],set_torrent_options:[6,0],set_torrent_remove_at_ratio:[6,0],set_config:[6,0],set_torrent_max_connections:[6,0],get_config:[6,0],get_download_rate:[6,0],set_torrent_file_priorities:[6,0],get_session_state:[6,0],set_torrent_auto_managed:[6,0]},"deluge.config":{Config:[1,3]},"deluge._rpcapi":{RpcApi:[6,3]},"deluge._rpcapi.RpcApi.daemon":{get_method_list:[6,0],info:[6,0]},"deluge.config.Config":{load:[1,0],apply_all:[1,0],config_file:[1,1],"__getitem__":[1,0],apply_set_functions:[1,0],run_converter:[1,0],set_item:[1,0],"__setitem__":[1,0],register_change_callback:[1,0],register_set_function:[1,0],save:[1,0],config:[1,1],get_item:[1,0]},"deluge._rpcapi.RpcApi":{core:[6,3],daemon:[6,3]},"deluge.common":{is_ip:[8,2],get_pixmap:[8,2],get_default_download_dir:[8,2],fspeed:[8,2],fpeer:[8,2],get_revision:[8,2],is_url:[8,2],vista_check:[8,2],fetch_url:[8,2],open_file:[8,2],get_version:[8,2],fsize:[8,2],ftime:[8,2],get_default_config_dir:[8,2],open_url_in_browser:[8,2],get_path_size:[8,2],free_space:[8,2],windows_check:[8,2],fpcnt:[8,2],osx_check:[8,2],fdate:[8,2],create_magnet_uri:[8,2],is_magnet:[8,2]}},filenames:["index","modules/config","interfaces/console","interfaces/index","interfaces/web","core/index","core/rpc","interfaces/gtk","modules/common"]}) \ No newline at end of file diff --git a/docs/source/conf.py b/docs/source/conf.py index a77e2f4e0..250f33a4c 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -36,7 +36,7 @@ source_suffix = '.rst' master_doc = 'index' # General substitutions. -project = 'deluge' +project = 'Deluge' copyright = '2008, Andrew Resch' # The default replacements for |version| and |release|, also used in various diff --git a/docs/source/core/index.rst b/docs/source/core/index.rst index f276a1b2d..1a45bd549 100644 --- a/docs/source/core/index.rst +++ b/docs/source/core/index.rst @@ -1,2 +1,6 @@ The Deluge Core -=============== \ No newline at end of file +=============== + +.. toctree:: + + DelugeRPC \ No newline at end of file diff --git a/docs/source/core/rpc.rst b/docs/source/core/rpc.rst new file mode 100644 index 000000000..a229c1eb8 --- /dev/null +++ b/docs/source/core/rpc.rst @@ -0,0 +1,105 @@ +Deluge RPC +========== +--------------- +Message Formats +--------------- +DelugeRPC is a protocol used for daemon/client communication. There are four +types of messages involved in the protocol: RPC Request, RPC Response, +RPC Error and Event. All messages are zlib compressed rencoded strings and +their data formats are detailed below. + +""""""""""" +RPC Request +""""""""""" +This message is created and sent by the client to the server requesting that a +remote method be called. Multiple requests can be bundled in a list. + +**[[request_id, method, [args], {kwargs}], ...]** + +**request_id** (int) + An integer determined by the client that is used in replies from the server. + This is used to ensure the client knows which request the data is in + response to. Another alternative would be to respond in the same order the + requests come in, but this could cause lag if an earlier request takes + longer to process. + +**method** (str) + The name of the remote method to call. This name can be in dotted format to + call other objects or plugins methods. + +**args** (list) + The arguments to call the method with. + +**kwargs** (dict) + The keyword arguments to call the method with. + +"""""""""""" +RPC Response +"""""""""""" +This message is created and sent in response to a RPC Request from a client. It +will hold the return value of the requested method call. In the case of an +error, a RPC Error message will be sent instead. + +**[message_type, request_id, [return_value]]** + +**message_type** (int) + This will be a RPC_RESPONSE type id. This is used on the client side to + determine what kind of message is being received from the daemon. + +**request_id** (int) + The request_id is the same as the one sent by the client in the initial + request. It used on the client side to determine what message this is in + response to. + +**return_value** (list) + The return value of the method call. + +""""""""" +RPC Error +""""""""" +This message is created in response to an error generated while processing a +RPC Request and will serve as a replacement for a RPC Response message. + +**[message_type, request_id, exception_type, exception_msg, traceback]** + +**message_type** (int) + This will be a RPC_ERROR type id. + +**request_id** (int) + The request_id is the same as the one sent by the client in the initial + request. + +**exception_type** (str) + The type of exception raised. + +**exception_msg** (str) + The message as to why the exception was raised. + +**traceback** (str) + The traceback of the generated exception. + +""""" +Event +""""" +This message is created by the daemon and sent to the clients without being in +response to a RPC Request. Events are generally sent for changes in the +daemon's state that the clients need to be made aware of. + +**[message_type, event_name, data]** + +**message_type** (int) + This will be a RPC_EVENT type id. + +**event_name** (str) + This is the name of the event being emitted by the daemon. + +**data** (list) + Additional data to be sent with the event. This is dependent upon the event + being emitted. + +---------- +Remote API +---------- + +.. autoclass:: deluge._rpcapi.RpcApi + :members: \ No newline at end of file