2008-11-06 07:55:38 +00:00
< !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2009-07-20 09:09:53 +00:00
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
< html xmlns = "http://www.w3.org/1999/xhtml" >
2008-11-06 07:55:38 +00:00
< head >
< meta http-equiv = "Content-Type" content = "text/html; charset=utf-8" / >
2009-07-20 09:09:53 +00:00
2009-07-20 09:36:16 +00:00
< title > deluge.common — deluge v1.2.0-dev documentation< / title >
2008-11-06 07:55:38 +00:00
< link rel = "stylesheet" href = "../_static/default.css" type = "text/css" / >
< link rel = "stylesheet" href = "../_static/pygments.css" type = "text/css" / >
< script type = "text/javascript" >
var DOCUMENTATION_OPTIONS = {
2009-07-20 09:09:53 +00:00
URL_ROOT: '../',
2009-07-20 09:36:16 +00:00
VERSION: '1.2.0-dev',
2009-07-20 09:09:53 +00:00
COLLAPSE_MODINDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
2008-11-06 07:55:38 +00:00
};
< / script >
< script type = "text/javascript" src = "../_static/jquery.js" > < / script >
< script type = "text/javascript" src = "../_static/doctools.js" > < / script >
2009-07-20 09:36:16 +00:00
< link rel = "top" title = "deluge v1.2.0-dev documentation" href = "../index.html" / >
2008-11-06 07:55:38 +00:00
< link rel = "next" title = "deluge.config" href = "config.html" / >
2009-07-20 09:36:16 +00:00
< link rel = "prev" title = "Deluge Console UI" href = "../interfaces/console.html" / >
2008-11-06 07:55:38 +00:00
< / head >
< body >
< div class = "related" >
< h3 > Navigation< / h3 >
< ul >
< li class = "right" style = "margin-right: 10px" >
< a href = "../genindex.html" title = "General Index"
accesskey="I">index< / a > < / li >
< li class = "right" >
< a href = "../modindex.html" title = "Global Module Index"
accesskey="M">modules< / a > |< / li >
< li class = "right" >
< a href = "config.html" title = "deluge.config"
accesskey="N">next< / a > |< / li >
< li class = "right" >
2009-07-20 09:36:16 +00:00
< a href = "../interfaces/console.html" title = "Deluge Console UI"
2008-11-06 07:55:38 +00:00
accesskey="P">previous< / a > |< / li >
2009-07-20 09:36:16 +00:00
< li > < a href = "../index.html" > deluge v1.2.0-dev documentation< / a > » < / li >
2008-11-06 07:55:38 +00:00
< / ul >
2009-07-20 09:09:53 +00:00
< / div >
2008-11-06 07:55:38 +00:00
< div class = "document" >
< div class = "documentwrapper" >
< div class = "bodywrapper" >
< div class = "body" >
2009-07-20 09:09:53 +00:00
< div class = "section" id = "module-deluge.common" >
< h1 > < tt class = "xref docutils literal" > < span class = "pre" > deluge.common< / span > < / tt > < a class = "headerlink" href = "#module-deluge.common" title = "Permalink to this headline" > ¶< / a > < / h1 >
2008-11-06 07:55:38 +00:00
< p > Common functions for various parts of Deluge to use.< / p >
< dl class = "function" >
< dt id = "deluge.common.create_magnet_uri" >
2009-07-20 09:09:53 +00:00
< tt class = "descclassname" > deluge.common.< / tt > < tt class = "descname" > create_magnet_uri< / tt > < big > (< / big > < em > infohash< / em > , < em > name=None< / em > , < em > trackers=< / em > < span class = "optional" > [< / span > < span class = "optional" > ]< / span > < big > )< / big > < a class = "headerlink" href = "#deluge.common.create_magnet_uri" title = "Permalink to this definition" > ¶< / a > < / dt >
2008-11-06 07:55:38 +00:00
< dd > < p > Creates a magnet uri< / p >
< table class = "docutils field-list" frame = "void" rules = "none" >
< col class = "field-name" / >
< col class = "field-body" / >
< tbody valign = "top" >
< tr class = "field" > < th class = "field-name" > Parameters:< / th > < td class = "field-body" > < ul class = "first simple" >
< li > < em > infohash< / em > – string, the info-hash of the torrent< / li >
< li > < em > name< / em > – string, the name of the torrent (optional)< / li >
< li > < em > trackers< / em > – list of strings, the trackers to announce to (optional)< / li >
< / ul >
< / td >
< / tr >
< tr class = "field" > < th class = "field-name" > Returns:< / th > < td class = "field-body" > < p class = "first" > a magnet uri string< / p >
< / td >
< / tr >
< tr class = "field" > < th class = "field-name" > Return type:< / th > < td class = "field-body" > < p class = "first last" > string< / p >
< / td >
< / tr >
< / tbody >
< / table >
< / dd > < / dl >
< dl class = "function" >
< dt id = "deluge.common.fdate" >
2009-07-20 09:09:53 +00:00
< tt class = "descclassname" > deluge.common.< / tt > < tt class = "descname" > fdate< / tt > < big > (< / big > < em > seconds< / em > < big > )< / big > < a class = "headerlink" href = "#deluge.common.fdate" title = "Permalink to this definition" > ¶< / a > < / dt >
< dd > < p > Formats a date string in the locale’ s date representation based on the systems timezone< / p >
2008-11-06 07:55:38 +00:00
< table class = "docutils field-list" frame = "void" rules = "none" >
< col class = "field-name" / >
< col class = "field-body" / >
< tbody valign = "top" >
2009-07-20 09:09:53 +00:00
< tr class = "field" > < th class = "field-name" > Parameter:< / th > < td class = "field-body" > < em > seconds< / em > – float, time in seconds since the Epoch< / td >
2008-11-06 07:55:38 +00:00
< / tr >
2009-07-20 09:09:53 +00:00
< tr class = "field" > < th class = "field-name" > Returns:< / th > < td class = "field-body" > a string in the locale’ s date representation or “ ” if seconds < 0< / td >
2008-11-06 07:55:38 +00:00
< / tr >
2009-07-20 09:09:53 +00:00
< tr class = "field" > < th class = "field-name" > Return type:< / th > < td class = "field-body" > string< / td >
2008-11-06 07:55:38 +00:00
< / tr >
< / tbody >
< / table >
< / dd > < / dl >
< dl class = "function" >
< dt id = "deluge.common.fetch_url" >
2009-07-20 09:09:53 +00:00
< tt class = "descclassname" > deluge.common.< / tt > < tt class = "descname" > fetch_url< / tt > < big > (< / big > < em > url< / em > < big > )< / big > < a class = "headerlink" href = "#deluge.common.fetch_url" title = "Permalink to this definition" > ¶< / a > < / dt >
2008-11-06 07:55:38 +00:00
< dd > < p > Downloads a torrent file from a given URL and checks the file’ s validity< / p >
< table class = "docutils field-list" frame = "void" rules = "none" >
< col class = "field-name" / >
< col class = "field-body" / >
< tbody valign = "top" >
2009-07-20 09:09:53 +00:00
< tr class = "field" > < th class = "field-name" > Parameter:< / th > < td class = "field-body" > < em > url< / em > – string, the url of the .torrent file to fetch< / td >
2008-11-06 07:55:38 +00:00
< / tr >
2009-07-20 09:09:53 +00:00
< tr class = "field" > < th class = "field-name" > Returns:< / th > < td class = "field-body" > the filepath to the downloaded file< / td >
2008-11-06 07:55:38 +00:00
< / tr >
2009-07-20 09:09:53 +00:00
< tr class = "field" > < th class = "field-name" > Return type:< / th > < td class = "field-body" > string< / td >
2008-11-06 07:55:38 +00:00
< / tr >
< / tbody >
< / table >
< / dd > < / dl >
< dl class = "function" >
< dt id = "deluge.common.fpcnt" >
2009-07-20 09:09:53 +00:00
< tt class = "descclassname" > deluge.common.< / tt > < tt class = "descname" > fpcnt< / tt > < big > (< / big > < em > dec< / em > < big > )< / big > < a class = "headerlink" href = "#deluge.common.fpcnt" title = "Permalink to this definition" > ¶< / a > < / dt >
2008-11-06 07:55:38 +00:00
< dd > < p > Formats a string to display a percentage with two decimal places< / p >
< table class = "docutils field-list" frame = "void" rules = "none" >
< col class = "field-name" / >
< col class = "field-body" / >
< tbody valign = "top" >
2009-07-20 09:09:53 +00:00
< tr class = "field" > < th class = "field-name" > Parameter:< / th > < td class = "field-body" > < em > dec< / em > – float, the ratio in the range [0.0, 1.0]< / td >
2008-11-06 07:55:38 +00:00
< / tr >
2009-07-20 09:09:53 +00:00
< tr class = "field" > < th class = "field-name" > Returns:< / th > < td class = "field-body" > a formatted string representing a percentage< / td >
2008-11-06 07:55:38 +00:00
< / tr >
2009-07-20 09:09:53 +00:00
< tr class = "field" > < th class = "field-name" > Return type:< / th > < td class = "field-body" > string< / td >
2008-11-06 07:55:38 +00:00
< / tr >
< / tbody >
< / table >
2008-11-08 06:13:40 +00:00
< p > < strong > Usage< / strong > < / p >
2009-07-20 09:09:53 +00:00
< div class = "highlight-python" > < div class = "highlight" > < pre > < span class = "gp" > > > > < / span > < span class = "n" > fpcnt< / span > < span class = "p" > (< / span > < span class = "mf" > 0.9311< / span > < span class = "p" > )< / span >
2008-11-06 07:55:38 +00:00
< span class = "go" > ' 93.11%' < / span >
< / pre > < / div >
2009-07-20 09:09:53 +00:00
< / div >
2008-11-06 07:55:38 +00:00
< / dd > < / dl >
< dl class = "function" >
< dt id = "deluge.common.fpeer" >
2009-07-20 09:09:53 +00:00
< tt class = "descclassname" > deluge.common.< / tt > < tt class = "descname" > fpeer< / tt > < big > (< / big > < em > num_peers< / em > , < em > total_peers< / em > < big > )< / big > < a class = "headerlink" href = "#deluge.common.fpeer" title = "Permalink to this definition" > ¶< / a > < / dt >
2008-11-06 07:55:38 +00:00
< dd > < p > Formats a string to show ‘ num_peers’ (‘ total_peers’ )< / p >
< table class = "docutils field-list" frame = "void" rules = "none" >
< col class = "field-name" / >
< col class = "field-body" / >
< tbody valign = "top" >
< tr class = "field" > < th class = "field-name" > Parameters:< / th > < td class = "field-body" > < ul class = "first simple" >
< li > < em > num_peers< / em > – int, the number of connected peers< / li >
< li > < em > total_peers< / em > – int, the total number of peers< / li >
< / ul >
< / td >
< / tr >
< tr class = "field" > < th class = "field-name" > Returns:< / th > < td class = "field-body" > < p class = "first" > a formatted string: num_peers (total_peers), if total_peers < 0, then it will not be shown< / p >
< / td >
< / tr >
< tr class = "field" > < th class = "field-name" > Return type:< / th > < td class = "field-body" > < p class = "first last" > string< / p >
< / td >
< / tr >
< / tbody >
< / table >
2008-11-08 06:13:40 +00:00
< p > < strong > Usage< / strong > < / p >
2009-07-20 09:09:53 +00:00
< div class = "highlight-python" > < div class = "highlight" > < pre > < span class = "gp" > > > > < / span > < span class = "n" > fpeer< / span > < span class = "p" > (< / span > < span class = "mf" > 10< / span > < span class = "p" > ,< / span > < span class = "mf" > 20< / span > < span class = "p" > )< / span >
2008-11-06 07:55:38 +00:00
< span class = "go" > ' 10 (20)' < / span >
< span class = "gp" > > > > < / span > < span class = "n" > fpeer< / span > < span class = "p" > (< / span > < span class = "mf" > 10< / span > < span class = "p" > ,< / span > < span class = "o" > -< / span > < span class = "mf" > 1< / span > < span class = "p" > )< / span >
< span class = "go" > ' 10' < / span >
< / pre > < / div >
2009-07-20 09:09:53 +00:00
< / div >
2008-11-06 07:55:38 +00:00
< / dd > < / dl >
< dl class = "function" >
< dt id = "deluge.common.free_space" >
2009-07-20 09:09:53 +00:00
< tt class = "descclassname" > deluge.common.< / tt > < tt class = "descname" > free_space< / tt > < big > (< / big > < em > path< / em > < big > )< / big > < a class = "headerlink" href = "#deluge.common.free_space" title = "Permalink to this definition" > ¶< / a > < / dt >
2008-11-06 07:55:38 +00:00
< dd > < p > Gets the free space available at ‘ path’ < / p >
< table class = "docutils field-list" frame = "void" rules = "none" >
< col class = "field-name" / >
< col class = "field-body" / >
< tbody valign = "top" >
2009-07-20 09:09:53 +00:00
< tr class = "field" > < th class = "field-name" > Parameter:< / th > < td class = "field-body" > < em > path< / em > – string, the path to check< / td >
2008-11-06 07:55:38 +00:00
< / tr >
2009-07-20 09:09:53 +00:00
< tr class = "field" > < th class = "field-name" > Returns:< / th > < td class = "field-body" > the free space at path in bytes< / td >
2008-11-06 07:55:38 +00:00
< / tr >
2009-07-20 09:09:53 +00:00
< tr class = "field" > < th class = "field-name" > Return type:< / th > < td class = "field-body" > int< / td >
2008-11-06 07:55:38 +00:00
< / tr >
< / tbody >
< / table >
< / dd > < / dl >
< dl class = "function" >
< dt id = "deluge.common.fsize" >
2009-07-20 09:09:53 +00:00
< tt class = "descclassname" > deluge.common.< / tt > < tt class = "descname" > fsize< / tt > < big > (< / big > < em > fsize_b< / em > < big > )< / big > < a class = "headerlink" href = "#deluge.common.fsize" title = "Permalink to this definition" > ¶< / a > < / dt >
2008-11-06 07:55:38 +00:00
< dd > < p > Formats the bytes value into a string with KiB, MiB or GiB units< / p >
< table class = "docutils field-list" frame = "void" rules = "none" >
< col class = "field-name" / >
< col class = "field-body" / >
< tbody valign = "top" >
2009-07-20 09:09:53 +00:00
< tr class = "field" > < th class = "field-name" > Parameter:< / th > < td class = "field-body" > < em > fsize_b< / em > – int, the filesize in bytes< / td >
2008-11-06 07:55:38 +00:00
< / tr >
2009-07-20 09:09:53 +00:00
< tr class = "field" > < th class = "field-name" > Returns:< / th > < td class = "field-body" > formatted string in KiB, MiB or GiB units< / td >
2008-11-06 07:55:38 +00:00
< / tr >
2009-07-20 09:09:53 +00:00
< tr class = "field" > < th class = "field-name" > Return type:< / th > < td class = "field-body" > string< / td >
2008-11-06 07:55:38 +00:00
< / tr >
< / tbody >
< / table >
2008-11-08 06:13:40 +00:00
< p > < strong > Usage< / strong > < / p >
2009-07-20 09:09:53 +00:00
< div class = "highlight-python" > < div class = "highlight" > < pre > < span class = "gp" > > > > < / span > < span class = "n" > fsize< / span > < span class = "p" > (< / span > < span class = "mf" > 112245< / span > < span class = "p" > )< / span >
2008-11-06 07:55:38 +00:00
< span class = "go" > ' 109.6 KiB' < / span >
< / pre > < / div >
2009-07-20 09:09:53 +00:00
< / div >
2008-11-06 07:55:38 +00:00
< / dd > < / dl >
< dl class = "function" >
< dt id = "deluge.common.fspeed" >
2009-07-20 09:09:53 +00:00
< tt class = "descclassname" > deluge.common.< / tt > < tt class = "descname" > fspeed< / tt > < big > (< / big > < em > bps< / em > < big > )< / big > < a class = "headerlink" href = "#deluge.common.fspeed" title = "Permalink to this definition" > ¶< / a > < / dt >
< dd > < p > Formats a string to display a transfer speed utilizing < a title = "deluge.common.fsize" class = "reference internal" href = "#deluge.common.fsize" > < tt class = "xref docutils literal" > < span class = "pre" > fsize()< / span > < / tt > < / a > < / p >
2008-11-06 07:55:38 +00:00
< table class = "docutils field-list" frame = "void" rules = "none" >
< col class = "field-name" / >
< col class = "field-body" / >
< tbody valign = "top" >
2009-07-20 09:09:53 +00:00
< tr class = "field" > < th class = "field-name" > Parameter:< / th > < td class = "field-body" > < em > bps< / em > – int, bytes per second< / td >
2008-11-06 07:55:38 +00:00
< / tr >
2009-07-20 09:09:53 +00:00
< tr class = "field" > < th class = "field-name" > Returns:< / th > < td class = "field-body" > a formatted string representing transfer speed< / td >
2008-11-06 07:55:38 +00:00
< / tr >
2009-07-20 09:09:53 +00:00
< tr class = "field" > < th class = "field-name" > Return type:< / th > < td class = "field-body" > string< / td >
2008-11-06 07:55:38 +00:00
< / tr >
< / tbody >
< / table >
2008-11-08 06:13:40 +00:00
< p > < strong > Usage< / strong > < / p >
2009-07-20 09:09:53 +00:00
< div class = "highlight-python" > < div class = "highlight" > < pre > < span class = "gp" > > > > < / span > < span class = "n" > fspeed< / span > < span class = "p" > (< / span > < span class = "mf" > 43134< / span > < span class = "p" > )< / span >
2008-11-06 07:55:38 +00:00
< span class = "go" > ' 42.1 KiB/s' < / span >
< / pre > < / div >
2009-07-20 09:09:53 +00:00
< / div >
2008-11-06 07:55:38 +00:00
< / dd > < / dl >
< dl class = "function" >
< dt id = "deluge.common.ftime" >
2009-07-20 09:09:53 +00:00
< tt class = "descclassname" > deluge.common.< / tt > < tt class = "descname" > ftime< / tt > < big > (< / big > < em > seconds< / em > < big > )< / big > < a class = "headerlink" href = "#deluge.common.ftime" title = "Permalink to this definition" > ¶< / a > < / dt >
2008-11-06 07:55:38 +00:00
< dd > < p > Formats a string to show time in a human readable form< / p >
< table class = "docutils field-list" frame = "void" rules = "none" >
< col class = "field-name" / >
< col class = "field-body" / >
< tbody valign = "top" >
2009-07-20 09:09:53 +00:00
< tr class = "field" > < th class = "field-name" > Parameter:< / th > < td class = "field-body" > < em > seconds< / em > – int, the number of seconds< / td >
2008-11-06 07:55:38 +00:00
< / tr >
2009-07-20 09:09:53 +00:00
< tr class = "field" > < th class = "field-name" > Returns:< / th > < td class = "field-body" > a formatted time string, will return ‘ ’ if seconds == 0< / td >
2008-11-06 07:55:38 +00:00
< / tr >
2009-07-20 09:09:53 +00:00
< tr class = "field" > < th class = "field-name" > Return type:< / th > < td class = "field-body" > string< / td >
2008-11-06 07:55:38 +00:00
< / tr >
< / tbody >
< / table >
2008-11-08 06:13:40 +00:00
< p > < strong > Usage< / strong > < / p >
2009-07-20 09:09:53 +00:00
< div class = "highlight-python" > < div class = "highlight" > < pre > < span class = "gp" > > > > < / span > < span class = "n" > ftime< / span > < span class = "p" > (< / span > < span class = "mf" > 23011< / span > < span class = "p" > )< / span >
2008-11-06 07:55:38 +00:00
< span class = "go" > ' 6h 23m' < / span >
< / pre > < / div >
2009-07-20 09:09:53 +00:00
< / div >
2008-11-06 07:55:38 +00:00
< / dd > < / dl >
< dl class = "function" >
< dt id = "deluge.common.get_default_config_dir" >
2009-07-20 09:09:53 +00:00
< tt class = "descclassname" > deluge.common.< / tt > < tt class = "descname" > get_default_config_dir< / tt > < big > (< / big > < em > filename=None< / em > < big > )< / big > < a class = "headerlink" href = "#deluge.common.get_default_config_dir" title = "Permalink to this definition" > ¶< / a > < / dt >
2008-11-06 07:55:38 +00:00
< dd > < table class = "docutils field-list" frame = "void" rules = "none" >
< col class = "field-name" / >
< col class = "field-body" / >
< tbody valign = "top" >
2009-07-20 09:09:53 +00:00
< tr class = "field" > < th class = "field-name" > Parameter:< / th > < td class = "field-body" > < em > filename< / em > – if None, only the config path is returned, if provided, a path including the filename will be returned< / td >
2008-11-06 07:55:38 +00:00
< / tr >
2009-07-20 09:09:53 +00:00
< tr class = "field" > < th class = "field-name" > Returns:< / th > < td class = "field-body" > a file path to the config directory and optional filename< / td >
2008-11-06 07:55:38 +00:00
< / tr >
2009-07-20 09:09:53 +00:00
< tr class = "field" > < th class = "field-name" > Return type:< / th > < td class = "field-body" > string< / td >
2008-11-06 07:55:38 +00:00
< / tr >
< / tbody >
< / table >
< / dd > < / dl >
< dl class = "function" >
< dt id = "deluge.common.get_default_download_dir" >
2009-07-20 09:09:53 +00:00
< tt class = "descclassname" > deluge.common.< / tt > < tt class = "descname" > get_default_download_dir< / tt > < big > (< / big > < big > )< / big > < a class = "headerlink" href = "#deluge.common.get_default_download_dir" title = "Permalink to this definition" > ¶< / a > < / dt >
2008-11-06 07:55:38 +00:00
< dd > < table class = "docutils field-list" frame = "void" rules = "none" >
< col class = "field-name" / >
< col class = "field-body" / >
< tbody valign = "top" >
< tr class = "field" > < th class = "field-name" > Returns:< / th > < td class = "field-body" > the default download directory< / td >
< / tr >
< tr class = "field" > < th class = "field-name" > Return type:< / th > < td class = "field-body" > string< / td >
< / tr >
< / tbody >
< / table >
< / dd > < / dl >
< dl class = "function" >
< dt id = "deluge.common.get_path_size" >
2009-07-20 09:09:53 +00:00
< tt class = "descclassname" > deluge.common.< / tt > < tt class = "descname" > get_path_size< / tt > < big > (< / big > < em > path< / em > < big > )< / big > < a class = "headerlink" href = "#deluge.common.get_path_size" title = "Permalink to this definition" > ¶< / a > < / dt >
2008-11-06 07:55:38 +00:00
< dd > < p > Gets the size in bytes of ‘ path’ < / p >
< table class = "docutils field-list" frame = "void" rules = "none" >
< col class = "field-name" / >
< col class = "field-body" / >
< tbody valign = "top" >
2009-07-20 09:09:53 +00:00
< tr class = "field" > < th class = "field-name" > Parameter:< / th > < td class = "field-body" > < em > path< / em > – string, the path to check for size< / td >
2008-11-06 07:55:38 +00:00
< / tr >
2009-07-20 09:09:53 +00:00
< tr class = "field" > < th class = "field-name" > Returns:< / th > < td class = "field-body" > the size in bytes of the path or -1 if the path does not exist< / td >
2008-11-06 07:55:38 +00:00
< / tr >
2009-07-20 09:09:53 +00:00
< tr class = "field" > < th class = "field-name" > Return type:< / th > < td class = "field-body" > int< / td >
2008-11-06 07:55:38 +00:00
< / tr >
< / tbody >
< / table >
< / dd > < / dl >
< dl class = "function" >
< dt id = "deluge.common.get_pixmap" >
2009-07-20 09:09:53 +00:00
< tt class = "descclassname" > deluge.common.< / tt > < tt class = "descname" > get_pixmap< / tt > < big > (< / big > < em > fname< / em > < big > )< / big > < a class = "headerlink" href = "#deluge.common.get_pixmap" title = "Permalink to this definition" > ¶< / a > < / dt >
2008-11-06 07:55:38 +00:00
< dd > < p > Provides easy access to files in the deluge/data/pixmaps folder within the Deluge egg< / p >
< table class = "docutils field-list" frame = "void" rules = "none" >
< col class = "field-name" / >
< col class = "field-body" / >
< tbody valign = "top" >
2009-07-20 09:09:53 +00:00
< tr class = "field" > < th class = "field-name" > Parameter:< / th > < td class = "field-body" > < em > fname< / em > – the filename to look for< / td >
2008-11-06 07:55:38 +00:00
< / tr >
2009-07-20 09:09:53 +00:00
< tr class = "field" > < th class = "field-name" > Returns:< / th > < td class = "field-body" > a path to a pixmap file included with Deluge< / td >
2008-11-06 07:55:38 +00:00
< / tr >
2009-07-20 09:09:53 +00:00
< tr class = "field" > < th class = "field-name" > Return type:< / th > < td class = "field-body" > string< / td >
2008-11-06 07:55:38 +00:00
< / tr >
< / tbody >
< / table >
< / dd > < / dl >
< dl class = "function" >
< dt id = "deluge.common.get_revision" >
2009-07-20 09:09:53 +00:00
< tt class = "descclassname" > deluge.common.< / tt > < tt class = "descname" > get_revision< / tt > < big > (< / big > < big > )< / big > < a class = "headerlink" href = "#deluge.common.get_revision" title = "Permalink to this definition" > ¶< / a > < / dt >
2008-11-06 07:55:38 +00:00
< dd > < p > The svn revision of the build if available< / p >
< table class = "docutils field-list" frame = "void" rules = "none" >
< col class = "field-name" / >
< col class = "field-body" / >
< tbody valign = "top" >
< tr class = "field" > < th class = "field-name" > Returns:< / th > < td class = "field-body" > the svn revision, or “ ” < / td >
< / tr >
< tr class = "field" > < th class = "field-name" > Return type:< / th > < td class = "field-body" > string< / td >
< / tr >
< / tbody >
< / table >
< / dd > < / dl >
< dl class = "function" >
< dt id = "deluge.common.get_version" >
2009-07-20 09:09:53 +00:00
< tt class = "descclassname" > deluge.common.< / tt > < tt class = "descname" > get_version< / tt > < big > (< / big > < big > )< / big > < a class = "headerlink" href = "#deluge.common.get_version" title = "Permalink to this definition" > ¶< / a > < / dt >
2008-11-06 07:55:38 +00:00
< dd > < p > Returns the program version from the egg metadata< / p >
< table class = "docutils field-list" frame = "void" rules = "none" >
< col class = "field-name" / >
< col class = "field-body" / >
< tbody valign = "top" >
< tr class = "field" > < th class = "field-name" > Returns:< / th > < td class = "field-body" > the version of Deluge< / td >
< / tr >
< tr class = "field" > < th class = "field-name" > Return type:< / th > < td class = "field-body" > string< / td >
< / tr >
< / tbody >
< / table >
< / dd > < / dl >
< dl class = "function" >
< dt id = "deluge.common.is_ip" >
2009-07-20 09:09:53 +00:00
< tt class = "descclassname" > deluge.common.< / tt > < tt class = "descname" > is_ip< / tt > < big > (< / big > < em > ip< / em > < big > )< / big > < a class = "headerlink" href = "#deluge.common.is_ip" title = "Permalink to this definition" > ¶< / a > < / dt >
2008-11-06 07:55:38 +00:00
< dd > < p > A simple test to see if ‘ ip’ is valid< / p >
< table class = "docutils field-list" frame = "void" rules = "none" >
< col class = "field-name" / >
< col class = "field-body" / >
< tbody valign = "top" >
2009-07-20 09:09:53 +00:00
< tr class = "field" > < th class = "field-name" > Parameter:< / th > < td class = "field-body" > < em > ip< / em > – string, the ip to check< / td >
2008-11-06 07:55:38 +00:00
< / tr >
2009-07-20 09:09:53 +00:00
< tr class = "field" > < th class = "field-name" > Returns:< / th > < td class = "field-body" > True or False< / td >
2008-11-06 07:55:38 +00:00
< / tr >
2009-07-20 09:09:53 +00:00
< tr class = "field" > < th class = "field-name" > Return type:< / th > < td class = "field-body" > bool< / td >
2008-11-06 07:55:38 +00:00
< / tr >
< / tbody >
< / table >
< p > ** Usage **< / p >
2009-07-20 09:09:53 +00:00
< div class = "highlight-python" > < div class = "highlight" > < pre > < span class = "gp" > > > > < / span > < span class = "n" > is_ip< / span > < span class = "p" > (< / span > < span class = "s" > " 127.0.0.1" < / span > < span class = "p" > )< / span >
2008-11-06 07:55:38 +00:00
< span class = "go" > True< / span >
< / pre > < / div >
2009-07-20 09:09:53 +00:00
< / div >
2008-11-06 07:55:38 +00:00
< / dd > < / dl >
< dl class = "function" >
< dt id = "deluge.common.is_magnet" >
2009-07-20 09:09:53 +00:00
< tt class = "descclassname" > deluge.common.< / tt > < tt class = "descname" > is_magnet< / tt > < big > (< / big > < em > uri< / em > < big > )< / big > < a class = "headerlink" href = "#deluge.common.is_magnet" title = "Permalink to this definition" > ¶< / a > < / dt >
2008-11-06 07:55:38 +00:00
< dd > < p > A check to determine if a uri is a valid bittorrent magnet uri< / p >
< table class = "docutils field-list" frame = "void" rules = "none" >
< col class = "field-name" / >
< col class = "field-body" / >
< tbody valign = "top" >
2009-07-20 09:09:53 +00:00
< tr class = "field" > < th class = "field-name" > Parameter:< / th > < td class = "field-body" > < em > uri< / em > – string, the uri to check< / td >
2008-11-06 07:55:38 +00:00
< / tr >
2009-07-20 09:09:53 +00:00
< tr class = "field" > < th class = "field-name" > Returns:< / th > < td class = "field-body" > True or False< / td >
2008-11-06 07:55:38 +00:00
< / tr >
2009-07-20 09:09:53 +00:00
< tr class = "field" > < th class = "field-name" > Return type:< / th > < td class = "field-body" > bool< / td >
2008-11-06 07:55:38 +00:00
< / tr >
< / tbody >
< / table >
2008-11-08 06:13:40 +00:00
< p > < strong > Usage< / strong > < / p >
2009-07-20 09:09:53 +00:00
< div class = "highlight-python" > < div class = "highlight" > < pre > < span class = "gp" > > > > < / span > < span class = "n" > is_magnet< / span > < span class = "p" > (< / span > < span class = "s" > " magnet:?xt=urn:btih:SU5225URMTUEQLDXQWRB2EQWN6KLTYKN" < / span > < span class = "p" > )< / span >
2008-11-06 07:55:38 +00:00
< span class = "go" > True< / span >
< / pre > < / div >
2009-07-20 09:09:53 +00:00
< / div >
2008-11-06 07:55:38 +00:00
< / dd > < / dl >
< dl class = "function" >
< dt id = "deluge.common.is_url" >
2009-07-20 09:09:53 +00:00
< tt class = "descclassname" > deluge.common.< / tt > < tt class = "descname" > is_url< / tt > < big > (< / big > < em > url< / em > < big > )< / big > < a class = "headerlink" href = "#deluge.common.is_url" title = "Permalink to this definition" > ¶< / a > < / dt >
2008-11-06 07:55:38 +00:00
< dd > < p > A simple regex test to check if the URL is valid< / p >
< table class = "docutils field-list" frame = "void" rules = "none" >
< col class = "field-name" / >
< col class = "field-body" / >
< tbody valign = "top" >
2009-07-20 09:09:53 +00:00
< tr class = "field" > < th class = "field-name" > Parameter:< / th > < td class = "field-body" > < em > url< / em > – string, the url to test< / td >
2008-11-06 07:55:38 +00:00
< / tr >
2009-07-20 09:09:53 +00:00
< tr class = "field" > < th class = "field-name" > Returns:< / th > < td class = "field-body" > True or False< / td >
2008-11-06 07:55:38 +00:00
< / tr >
2009-07-20 09:09:53 +00:00
< tr class = "field" > < th class = "field-name" > Return type:< / th > < td class = "field-body" > bool< / td >
2008-11-06 07:55:38 +00:00
< / tr >
< / tbody >
< / table >
2008-11-08 06:13:40 +00:00
< p > < strong > Usage< / strong > < / p >
2009-07-20 09:09:53 +00:00
< div class = "highlight-python" > < div class = "highlight" > < pre > < span class = "gp" > > > > < / span > < span class = "n" > is_url< / span > < span class = "p" > (< / span > < span class = "s" > " http://deluge-torrent.org" < / span > < span class = "p" > )< / span >
2008-11-06 07:55:38 +00:00
< span class = "go" > True< / span >
< / pre > < / div >
2009-07-20 09:09:53 +00:00
< / div >
2008-11-06 07:55:38 +00:00
< / dd > < / dl >
< dl class = "function" >
< dt id = "deluge.common.open_file" >
2009-07-20 09:09:53 +00:00
< tt class = "descclassname" > deluge.common.< / tt > < tt class = "descname" > open_file< / tt > < big > (< / big > < em > path< / em > < big > )< / big > < a class = "headerlink" href = "#deluge.common.open_file" title = "Permalink to this definition" > ¶< / a > < / dt >
2008-11-06 07:55:38 +00:00
< dd > < p > Opens a file or folder using the system configured program< / p >
< table class = "docutils field-list" frame = "void" rules = "none" >
< col class = "field-name" / >
< col class = "field-body" / >
< tbody valign = "top" >
2009-07-20 09:09:53 +00:00
< tr class = "field" > < th class = "field-name" > Parameter:< / th > < td class = "field-body" > < em > path< / em > – the path to the file or folder to open< / td >
2008-11-06 07:55:38 +00:00
< / tr >
< / tbody >
< / table >
< / dd > < / dl >
< dl class = "function" >
< dt id = "deluge.common.open_url_in_browser" >
2009-07-20 09:09:53 +00:00
< tt class = "descclassname" > deluge.common.< / tt > < tt class = "descname" > open_url_in_browser< / tt > < big > (< / big > < em > url< / em > < big > )< / big > < a class = "headerlink" href = "#deluge.common.open_url_in_browser" title = "Permalink to this definition" > ¶< / a > < / dt >
2008-11-06 07:55:38 +00:00
< dd > < p > Opens a url in the desktop’ s default browser< / p >
< table class = "docutils field-list" frame = "void" rules = "none" >
< col class = "field-name" / >
< col class = "field-body" / >
< tbody valign = "top" >
2009-07-20 09:09:53 +00:00
< tr class = "field" > < th class = "field-name" > Parameter:< / th > < td class = "field-body" > < em > url< / em > – the url to open< / td >
2008-11-06 07:55:38 +00:00
< / tr >
< / tbody >
< / table >
< / dd > < / dl >
< dl class = "function" >
< dt id = "deluge.common.osx_check" >
2009-07-20 09:09:53 +00:00
< tt class = "descclassname" > deluge.common.< / tt > < tt class = "descname" > osx_check< / tt > < big > (< / big > < big > )< / big > < a class = "headerlink" href = "#deluge.common.osx_check" title = "Permalink to this definition" > ¶< / a > < / dt >
2008-11-06 07:55:38 +00:00
< dd > < p > Checks if the current platform is Mac OS X< / p >
< table class = "docutils field-list" frame = "void" rules = "none" >
< col class = "field-name" / >
< col class = "field-body" / >
< tbody valign = "top" >
< tr class = "field" > < th class = "field-name" > Returns:< / th > < td class = "field-body" > True or False< / td >
< / tr >
< tr class = "field" > < th class = "field-name" > Return type:< / th > < td class = "field-body" > bool< / td >
< / tr >
< / tbody >
< / table >
< / dd > < / dl >
< dl class = "function" >
< dt id = "deluge.common.vista_check" >
2009-07-20 09:09:53 +00:00
< tt class = "descclassname" > deluge.common.< / tt > < tt class = "descname" > vista_check< / tt > < big > (< / big > < big > )< / big > < a class = "headerlink" href = "#deluge.common.vista_check" title = "Permalink to this definition" > ¶< / a > < / dt >
2008-11-06 07:55:38 +00:00
< dd > < p > Checks if the current platform is Windows Vista< / p >
< table class = "docutils field-list" frame = "void" rules = "none" >
< col class = "field-name" / >
< col class = "field-body" / >
< tbody valign = "top" >
< tr class = "field" > < th class = "field-name" > Returns:< / th > < td class = "field-body" > True or False< / td >
< / tr >
< tr class = "field" > < th class = "field-name" > Return type:< / th > < td class = "field-body" > bool< / td >
< / tr >
< / tbody >
< / table >
< / dd > < / dl >
< dl class = "function" >
< dt id = "deluge.common.windows_check" >
2009-07-20 09:09:53 +00:00
< tt class = "descclassname" > deluge.common.< / tt > < tt class = "descname" > windows_check< / tt > < big > (< / big > < big > )< / big > < a class = "headerlink" href = "#deluge.common.windows_check" title = "Permalink to this definition" > ¶< / a > < / dt >
2008-11-06 07:55:38 +00:00
< dd > < p > Checks if the current platform is Windows< / p >
< table class = "docutils field-list" frame = "void" rules = "none" >
< col class = "field-name" / >
< col class = "field-body" / >
< tbody valign = "top" >
< tr class = "field" > < th class = "field-name" > Returns:< / th > < td class = "field-body" > True or False< / td >
< / tr >
< tr class = "field" > < th class = "field-name" > Return type:< / th > < td class = "field-body" > bool< / td >
< / tr >
< / tbody >
< / table >
< / dd > < / dl >
< / div >
< / div >
< / div >
< / div >
< div class = "sphinxsidebar" >
< div class = "sphinxsidebarwrapper" >
< h4 > Previous topic< / h4 >
2009-07-20 09:36:16 +00:00
< p class = "topless" > < a href = "../interfaces/console.html"
title="previous chapter">Deluge Console UI< / a > < / p >
2008-11-06 07:55:38 +00:00
< h4 > Next topic< / h4 >
2009-07-20 09:09:53 +00:00
< p class = "topless" > < a href = "config.html"
title="next chapter">< tt class = "docutils literal" > < span class = "pre" > deluge.config< / span > < / tt > < / a > < / p >
2008-11-06 07:55:38 +00:00
< h3 > This Page< / h3 >
< ul class = "this-page-menu" >
2009-07-20 09:09:53 +00:00
< li > < a href = "../_sources/modules/common.txt"
rel="nofollow">Show Source< / a > < / li >
2008-11-06 07:55:38 +00:00
< / ul >
2009-07-20 09:09:53 +00:00
< div id = "searchbox" style = "display: none" >
2008-11-06 07:55:38 +00:00
< h3 > Quick search< / h3 >
2009-07-20 09:09:53 +00:00
< form class = "search" action = "../search.html" method = "get" >
< input type = "text" name = "q" size = "18" / >
< input type = "submit" value = "Go" / >
< input type = "hidden" name = "check_keywords" value = "yes" / >
< input type = "hidden" name = "area" value = "default" / >
< / form >
< p class = "searchtip" style = "font-size: 90%" >
Enter search terms or a module, class or function name.
< / p >
< / div >
< script type = "text/javascript" > $ ( '#searchbox' ) . show ( 0 ) ; < / script >
2008-11-06 07:55:38 +00:00
< / div >
< / div >
< div class = "clearer" > < / div >
< / div >
< div class = "related" >
< h3 > Navigation< / h3 >
< ul >
< li class = "right" style = "margin-right: 10px" >
< a href = "../genindex.html" title = "General Index"
2009-07-20 09:09:53 +00:00
>index< / a > < / li >
2008-11-06 07:55:38 +00:00
< li class = "right" >
< a href = "../modindex.html" title = "Global Module Index"
2009-07-20 09:09:53 +00:00
>modules< / a > |< / li >
2008-11-06 07:55:38 +00:00
< li class = "right" >
< a href = "config.html" title = "deluge.config"
2009-07-20 09:09:53 +00:00
>next< / a > |< / li >
2008-11-06 07:55:38 +00:00
< li class = "right" >
2009-07-20 09:36:16 +00:00
< a href = "../interfaces/console.html" title = "Deluge Console UI"
2009-07-20 09:09:53 +00:00
>previous< / a > |< / li >
2009-07-20 09:36:16 +00:00
< li > < a href = "../index.html" > deluge v1.2.0-dev documentation< / a > » < / li >
2008-11-06 07:55:38 +00:00
< / ul >
< / div >
< div class = "footer" >
© Copyright 2008, Andrew Resch.
2009-07-20 09:09:53 +00:00
Last updated on Jul 20, 2009.
Created using < a href = "http://sphinx.pocoo.org/" > Sphinx< / a > 0.6.1.
2008-11-06 07:55:38 +00:00
< / div >
< / body >
< / html >