Source

py-pushnotify / docs / pushnotify-pysrc.html

Full commit
<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>pushnotify</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />
  <script type="text/javascript" src="epydoc.js"></script>
</head>

<body bgcolor="white" text="black" link="blue" vlink="#204080"
      alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th bgcolor="#70b0f0" class="navbar-select"
          >&nbsp;&nbsp;&nbsp;Home&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            ><a class="navbar" target="_top" href="https://bitbucket.org/jgoettsch/py-pushnotify/">pushnotify</a></th>
          </tr></table></th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <span class="breadcrumbs">
        Package&nbsp;pushnotify
      </span>
    </td>
    <td>
      <table cellpadding="0" cellspacing="0">
        <!-- hide/show private -->
        <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
    onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
        <tr><td align="right"><span class="options"
            >[<a href="frames.html" target="_top">frames</a
            >]&nbsp;|&nbsp;<a href="pushnotify-pysrc.html"
            target="_top">no&nbsp;frames</a>]</span></td></tr>
      </table>
    </td>
  </tr>
</table>
<h1 class="epydoc">Source Code for <a href="pushnotify-module.html">Package pushnotify</a></h1>
<pre class="py-src">
<a name="L1"></a><tt class="py-lineno"> 1</tt>  <tt class="py-line"><tt class="py-docstring">"""copyright: Copyright (c) Jeffrey Goettsch and other contributors.</tt> </tt>
<a name="L2"></a><tt class="py-lineno"> 2</tt>  <tt class="py-line"><tt class="py-docstring">license: BSD, see LICENSE for details.</tt> </tt>
<a name="L3"></a><tt class="py-lineno"> 3</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L4"></a><tt class="py-lineno"> 4</tt>  <tt class="py-line"><tt class="py-docstring">"""</tt> </tt>
<a name="L5"></a><tt class="py-lineno"> 5</tt>  <tt class="py-line"> </tt>
<a name="L6"></a><tt class="py-lineno"> 6</tt>  <tt class="py-line"><tt class="py-keyword">import</tt> <tt class="py-name">logging</tt> </tt>
<a name="L7"></a><tt class="py-lineno"> 7</tt>  <tt class="py-line"> </tt>
<a name="L8"></a><tt class="py-lineno"> 8</tt>  <tt class="py-line"><tt class="py-keyword">import</tt> <tt id="link-0" class="py-name" targets="Module pushnotify.nma=pushnotify.nma-module.html"><a title="pushnotify.nma" class="py-name" href="#" onclick="return doclink('link-0', 'nma', 'link-0');">nma</a></tt> </tt>
<a name="L9"></a><tt class="py-lineno"> 9</tt>  <tt class="py-line"><tt class="py-keyword">import</tt> <tt id="link-1" class="py-name" targets="Module pushnotify.prowl=pushnotify.prowl-module.html"><a title="pushnotify.prowl" class="py-name" href="#" onclick="return doclink('link-1', 'prowl', 'link-1');">prowl</a></tt> </tt>
<a name="L10"></a><tt class="py-lineno">10</tt>  <tt class="py-line"><tt class="py-keyword">import</tt> <tt id="link-2" class="py-name" targets="Module pushnotify.pushover=pushnotify.pushover-module.html"><a title="pushnotify.pushover" class="py-name" href="#" onclick="return doclink('link-2', 'pushover', 'link-2');">pushover</a></tt> </tt>
<a name="L11"></a><tt class="py-lineno">11</tt>  <tt class="py-line"> </tt>
<a name="L12"></a><tt class="py-lineno">12</tt>  <tt class="py-line"> </tt>
<a name="L13"></a><tt class="py-lineno">13</tt>  <tt class="py-line"><tt id="link-3" class="py-name" targets="Variable pushnotify.logger=pushnotify-module.html#logger"><a title="pushnotify.logger" class="py-name" href="#" onclick="return doclink('link-3', 'logger', 'link-3');">logger</a></tt> <tt class="py-op">=</tt> <tt class="py-name">logging</tt><tt class="py-op">.</tt><tt class="py-name">getLogger</tt><tt class="py-op">(</tt><tt id="link-4" class="py-name" targets="Variable pushnotify.__package__=pushnotify-module.html#__package__,Variable pushnotify.abstract.__package__=pushnotify.abstract-module.html#__package__,Variable pushnotify.exceptions.__package__=pushnotify.exceptions-module.html#__package__,Variable pushnotify.nma.__package__=pushnotify.nma-module.html#__package__,Variable pushnotify.prowl.__package__=pushnotify.prowl-module.html#__package__,Variable pushnotify.pushover.__package__=pushnotify.pushover-module.html#__package__,Variable pushnotify.tests.__package__=pushnotify.tests-module.html#__package__,Variable pushnotify.tests.tests.__package__=pushnotify.tests.tests-module.html#__package__"><a title="pushnotify.__package__
pushnotify.abstract.__package__
pushnotify.exceptions.__package__
pushnotify.nma.__package__
pushnotify.prowl.__package__
pushnotify.pushover.__package__
pushnotify.tests.__package__
pushnotify.tests.tests.__package__" class="py-name" href="#" onclick="return doclink('link-4', '__package__', 'link-4');">__package__</a></tt><tt class="py-op">)</tt> </tt>
<a name="L14"></a><tt class="py-lineno">14</tt>  <tt class="py-line"> </tt>
<a name="L15"></a><tt class="py-lineno">15</tt>  <tt class="py-line"> </tt>
<a name="get_client"></a><div id="get_client-def"><a name="L16"></a><tt class="py-lineno">16</tt> <a class="py-toggle" href="#" id="get_client-toggle" onclick="return toggle('get_client');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="pushnotify-module.html#get_client">get_client</a><tt class="py-op">(</tt><tt class="py-param">type_</tt><tt class="py-op">,</tt> <tt class="py-param">developerkey</tt><tt class="py-op">=</tt><tt class="py-string">''</tt><tt class="py-op">,</tt> <tt class="py-param">application</tt><tt class="py-op">=</tt><tt class="py-string">''</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="get_client-collapsed" style="display:none;" pad="++" indent="++++"></div><div id="get_client-expanded"><a name="L17"></a><tt class="py-lineno">17</tt>  <tt class="py-line">    <tt class="py-docstring">"""Get a pushnotify client of the specified type.</tt> </tt>
<a name="L18"></a><tt class="py-lineno">18</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L19"></a><tt class="py-lineno">19</tt>  <tt class="py-line"><tt class="py-docstring">    Args:</tt> </tt>
<a name="L20"></a><tt class="py-lineno">20</tt>  <tt class="py-line"><tt class="py-docstring">        type_: A string containing the type of client to get. Valid</tt> </tt>
<a name="L21"></a><tt class="py-lineno">21</tt>  <tt class="py-line"><tt class="py-docstring">            types are 'nma,' 'prowl,', and 'pushover,' for Notify My</tt> </tt>
<a name="L22"></a><tt class="py-lineno">22</tt>  <tt class="py-line"><tt class="py-docstring">            Android, Prowl, and Pushover clients, respectively.</tt> </tt>
<a name="L23"></a><tt class="py-lineno">23</tt>  <tt class="py-line"><tt class="py-docstring">        developerkey: A string containing a valid developer key for the</tt> </tt>
<a name="L24"></a><tt class="py-lineno">24</tt>  <tt class="py-line"><tt class="py-docstring">            given type_ of client.</tt> </tt>
<a name="L25"></a><tt class="py-lineno">25</tt>  <tt class="py-line"><tt class="py-docstring">        application: A string containing the name of the application on</tt> </tt>
<a name="L26"></a><tt class="py-lineno">26</tt>  <tt class="py-line"><tt class="py-docstring">            behalf of whom the client will be sending messages.</tt> </tt>
<a name="L27"></a><tt class="py-lineno">27</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L28"></a><tt class="py-lineno">28</tt>  <tt class="py-line"><tt class="py-docstring">    Returns:</tt> </tt>
<a name="L29"></a><tt class="py-lineno">29</tt>  <tt class="py-line"><tt class="py-docstring">        An nma.Client, prowl.Client, or pushover.Client.</tt> </tt>
<a name="L30"></a><tt class="py-lineno">30</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L31"></a><tt class="py-lineno">31</tt>  <tt class="py-line"><tt class="py-docstring">    """</tt> </tt>
<a name="L32"></a><tt class="py-lineno">32</tt>  <tt class="py-line"> </tt>
<a name="L33"></a><tt class="py-lineno">33</tt>  <tt class="py-line">    <tt class="py-name">type_</tt> <tt class="py-op">=</tt> <tt class="py-name">type_</tt><tt class="py-op">.</tt><tt class="py-name">lower</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L34"></a><tt class="py-lineno">34</tt>  <tt class="py-line"> </tt>
<a name="L35"></a><tt class="py-lineno">35</tt>  <tt class="py-line">    <tt class="py-keyword">if</tt> <tt class="py-name">type_</tt> <tt class="py-op">==</tt> <tt class="py-string">'nma'</tt><tt class="py-op">:</tt> </tt>
<a name="L36"></a><tt class="py-lineno">36</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt id="link-5" class="py-name"><a title="pushnotify.nma" class="py-name" href="#" onclick="return doclink('link-5', 'nma', 'link-0');">nma</a></tt><tt class="py-op">.</tt><tt id="link-6" class="py-name" targets="Class pushnotify.nma.Client=pushnotify.nma.Client-class.html,Class pushnotify.prowl.Client=pushnotify.prowl.Client-class.html,Class pushnotify.pushover.Client=pushnotify.pushover.Client-class.html"><a title="pushnotify.nma.Client
pushnotify.prowl.Client
pushnotify.pushover.Client" class="py-name" href="#" onclick="return doclink('link-6', 'Client', 'link-6');">Client</a></tt><tt class="py-op">(</tt><tt class="py-name">developerkey</tt><tt class="py-op">,</tt> <tt class="py-name">application</tt><tt class="py-op">)</tt> </tt>
<a name="L37"></a><tt class="py-lineno">37</tt>  <tt class="py-line">    <tt class="py-keyword">elif</tt> <tt class="py-name">type_</tt> <tt class="py-op">==</tt> <tt class="py-string">'prowl'</tt><tt class="py-op">:</tt> </tt>
<a name="L38"></a><tt class="py-lineno">38</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt id="link-7" class="py-name"><a title="pushnotify.prowl" class="py-name" href="#" onclick="return doclink('link-7', 'prowl', 'link-1');">prowl</a></tt><tt class="py-op">.</tt><tt id="link-8" class="py-name"><a title="pushnotify.nma.Client
pushnotify.prowl.Client
pushnotify.pushover.Client" class="py-name" href="#" onclick="return doclink('link-8', 'Client', 'link-6');">Client</a></tt><tt class="py-op">(</tt><tt class="py-name">developerkey</tt><tt class="py-op">,</tt> <tt class="py-name">application</tt><tt class="py-op">)</tt> </tt>
<a name="L39"></a><tt class="py-lineno">39</tt>  <tt class="py-line">    <tt class="py-keyword">elif</tt> <tt class="py-name">type_</tt> <tt class="py-op">==</tt> <tt class="py-string">'pushover'</tt><tt class="py-op">:</tt> </tt>
<a name="L40"></a><tt class="py-lineno">40</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt id="link-9" class="py-name"><a title="pushnotify.pushover" class="py-name" href="#" onclick="return doclink('link-9', 'pushover', 'link-2');">pushover</a></tt><tt class="py-op">.</tt><tt id="link-10" class="py-name"><a title="pushnotify.nma.Client
pushnotify.prowl.Client
pushnotify.pushover.Client" class="py-name" href="#" onclick="return doclink('link-10', 'Client', 'link-6');">Client</a></tt><tt class="py-op">(</tt><tt class="py-name">developerkey</tt><tt class="py-op">,</tt> <tt class="py-name">application</tt><tt class="py-op">)</tt> </tt>
</div><a name="L41"></a><tt class="py-lineno">41</tt>  <tt class="py-line"> </tt>
<a name="L42"></a><tt class="py-lineno">42</tt>  <tt class="py-line"> </tt>
<a name="L43"></a><tt class="py-lineno">43</tt>  <tt class="py-line"><tt class="py-keyword">if</tt> <tt class="py-name">__name__</tt> <tt class="py-op">==</tt> <tt class="py-string">'__main__'</tt><tt class="py-op">:</tt> </tt>
<a name="L44"></a><tt class="py-lineno">44</tt>  <tt class="py-line">    <tt class="py-keyword">pass</tt> </tt>
<a name="L45"></a><tt class="py-lineno">45</tt>  <tt class="py-line"> </tt><script type="text/javascript">
<!--
expandto(location.href);
// -->
</script>
</pre>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th bgcolor="#70b0f0" class="navbar-select"
          >&nbsp;&nbsp;&nbsp;Home&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            ><a class="navbar" target="_top" href="https://bitbucket.org/jgoettsch/py-pushnotify/">pushnotify</a></th>
          </tr></table></th>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
  <tr>
    <td align="left" class="footer">
    Generated by Epydoc 3.0.1 on Sat Jan 19 19:06:32 2013
    </td>
    <td align="right" class="footer">
      <a target="mainFrame" href="http://epydoc.sourceforge.net"
        >http://epydoc.sourceforge.net</a>
    </td>
  </tr>
</table>

<script type="text/javascript">
  <!--
  // Private objects are initially displayed (because if
  // javascript is turned off then we want them to be
  // visible); but by default, we want to hide them.  So hide
  // them unless we have a cookie that says to show them.
  checkCookie();
  // -->
</script>
</body>
</html>