blob: a1df6346b4cd0118f6626babb64bf0ece5bc918e [file] [log] [blame]
<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>ALE Library &mdash; UserAle 1.0.4 documentation</title>
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="top" title="UserAle 1.0.4 documentation" href="index.html"/>
<link rel="next" title="Authors" href="authors.html"/>
<link rel="prev" title="Quickstart Guide" href="quickstart.html"/>
<script src="_static/js/modernizr.min.js"></script>
</head>
<body class="wy-body-for-nav" role="document">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search">
<a href="index.html" class="icon icon-home"> UserAle
</a>
<div class="version">
1.0.4
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
<input type="text" name="q" placeholder="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<ul>
<li class="toctree-l1"><a class="reference internal" href="installation.html">Installation Guide</a></li>
<li class="toctree-l1"><a class="reference internal" href="quickstart.html">Quickstart Guide</a></li>
</ul>
<ul class="current">
<li class="toctree-l1 current"><a class="current reference internal" href="#">ALE Library</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#module-userale.ale">UserAle</a></li>
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="authors.html">Authors</a></li>
<li class="toctree-l1"><a class="reference internal" href="contributing.html">Contributing to UserAle.pyqt5</a></li>
<li class="toctree-l1"><a class="reference internal" href="changelog.html">Changelog</a></li>
<li class="toctree-l1"><a class="reference internal" href="license.html">License</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="index.html">UserAle</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="index.html">Docs</a> &raquo;</li>
<li>ALE Library</li>
<li class="wy-breadcrumbs-aside">
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="ale-library">
<span id="api"></span><h1>ALE Library<a class="headerlink" href="#ale-library" title="Permalink to this headline"></a></h1>
<p>UserALE intercepts all application events by letting the developer install an event filter in their PyQT5 application to generate detailed user logs. UserAle does not capture system level logs or events generated by a non-user (a.k.a. system and signals sent between QObjects).</p>
<div class="section" id="module-userale.ale">
<span id="userale"></span><h2>UserAle<a class="headerlink" href="#module-userale.ale" title="Permalink to this headline"></a></h2>
<dl class="class">
<dt id="userale.ale.Ale">
<em class="property">class </em><code class="descclassname">userale.ale.</code><code class="descname">Ale</code><span class="sig-paren">(</span><em>output='userale.log'</em>, <em>interval=5000</em>, <em>user=None</em>, <em>session=None</em>, <em>toolname=None</em>, <em>toolversion=None</em>, <em>keylog=False</em>, <em>resolution=500</em>, <em>shutoff=[]</em><span class="sig-paren">)</span><a class="headerlink" href="#userale.ale.Ale" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">PyQt5.QtCore.QObject</span></code></p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>output</strong> &#8211; [str] The file or url path to which logs will be sent</li>
<li><strong>interval</strong> &#8211; [int] The minimum time interval in ms betweeen batch transmission of logs</li>
<li><strong>user</strong> &#8211; [str] Identifier for the user of the application</li>
<li><strong>session</strong> &#8211; [str] Session tag to track same user with multiple sessions. If a session is not provided, one will be created</li>
<li><strong>toolname</strong> &#8211; [str] The application name</li>
<li><strong>toolversion</strong> &#8211; [str] The application version</li>
<li><strong>keylog</strong> &#8211; [bool] Should detailed key logs be recorded. Default is False</li>
<li><strong>resolution</strong> &#8211; [int] Delay in ms between instances of high frequency logs like movemoves, scrolls, etc</li>
<li><strong>shutoff</strong> &#8211; [list] Turn off logging for specific events</li>
</ul>
</td>
</tr>
</tbody>
</table>
<p>An example log will appear like this:</p>
<div class="highlight-python"><div class="highlight"><pre><span></span><span class="p">{</span>
<span class="s1">&#39;target&#39;</span><span class="p">:</span> <span class="s1">&#39;testLineEdit&#39;</span><span class="p">,</span>
<span class="s1">&#39;path&#39;</span><span class="p">:</span> <span class="p">[</span><span class="s1">&#39;Example&#39;</span><span class="p">,</span> <span class="s1">&#39;testLineEdit&#39;</span><span class="p">],</span>
<span class="s1">&#39;clientTime&#39;</span><span class="p">:</span> <span class="s1">&#39;2016-08-03 16:12:03.460573&#39;</span><span class="p">,</span>
<span class="s1">&#39;location&#39;</span><span class="p">:</span> <span class="p">{</span><span class="s1">&#39;x&#39;</span><span class="p">:</span> <span class="mi">82</span><span class="p">,</span> <span class="s1">&#39;y&#39;</span><span class="p">:</span> <span class="mi">0</span><span class="p">},</span>
<span class="s1">&#39;type&#39;</span><span class="p">:</span> <span class="s1">&#39;mousemove&#39;</span><span class="p">,</span>
<span class="s1">&#39;userAction&#39;</span><span class="p">:</span> <span class="s1">&#39;true&#39;</span><span class="p">,</span>
<span class="s1">&#39;details&#39;</span> <span class="p">:</span> <span class="p">{},</span>
<span class="s1">&#39;userId&#39;</span><span class="p">:</span> <span class="s1">&#39;userABC1234&#39;</span><span class="p">,</span>
<span class="s1">&#39;session&#39;</span><span class="p">:</span> <span class="s1">&#39;5ee42ccc-852c-44d9-a937-28d7901e4ead&#39;</span><span class="p">,</span>
<span class="s1">&#39;toolName&#39;</span><span class="p">:</span> <span class="s1">&#39;myApplication&#39;</span><span class="p">,</span>
<span class="s1">&#39;toolVersion&#39;</span><span class="p">:</span> <span class="s1">&#39;3.5.0&#39;</span><span class="p">,</span>
<span class="s1">&#39;useraleVersion&#39;</span><span class="p">:</span> <span class="s1">&#39;1.0.0&#39;</span>
<span class="p">}</span>
</pre></div>
</div>
<dl class="method">
<dt id="userale.ale.Ale.eventFilter">
<code class="descname">eventFilter</code><span class="sig-paren">(</span><em>object</em>, <em>event</em><span class="sig-paren">)</span><a class="headerlink" href="#userale.ale.Ale.eventFilter" title="Permalink to this definition"></a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>object</strong> &#8211; [QObject] The object being watched.</li>
<li><strong>event</strong> &#8211; [QEvent] The event triggered by a user action.</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">[bool] Return true in order to filter the event out (stop it from being handled further). Otherwise return false.</p>
</td>
</tr>
</tbody>
</table>
<p>Filters events for the watched object (in this case, QApplication)</p>
</dd></dl>
<dl class="method">
<dt id="userale.ale.Ale.getClientTime">
<code class="descname">getClientTime</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#userale.ale.Ale.getClientTime" title="Permalink to this definition"></a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">[str] String representation of the time the event was triggered.</td>
</tr>
</tbody>
</table>
<p>Capture the time the event was captured.</p>
</dd></dl>
<dl class="method">
<dt id="userale.ale.Ale.getLocation">
<code class="descname">getLocation</code><span class="sig-paren">(</span><em>event</em><span class="sig-paren">)</span><a class="headerlink" href="#userale.ale.Ale.getLocation" title="Permalink to this definition"></a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>event</strong> &#8211; [QEvent] The base class for all event classes.</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">[dict] A dictionary representation of the x and y positions of the mouse cursor.</td>
</tr>
</tbody>
</table>
<p>Grab the x and y position of the mouse cursor, relative to the widget that received the event.</p>
</dd></dl>
<dl class="method">
<dt id="userale.ale.Ale.getPath">
<code class="descname">getPath</code><span class="sig-paren">(</span><em>object</em><span class="sig-paren">)</span><a class="headerlink" href="#userale.ale.Ale.getPath" title="Permalink to this definition"></a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>object</strong> &#8211; [QObject] The base class for all Qt objects.</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">[list] List of QObjects up to the child object.</td>
</tr>
</tbody>
</table>
<p>Fetch the entire path up the root of the tree for a leaf node object.
Recursive operation.</p>
</dd></dl>
<dl class="method">
<dt id="userale.ale.Ale.getSelector">
<code class="descname">getSelector</code><span class="sig-paren">(</span><em>object</em><span class="sig-paren">)</span><a class="headerlink" href="#userale.ale.Ale.getSelector" title="Permalink to this definition"></a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>object</strong> &#8211; [QObject] The base class for all Qt objects.</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">[str] The Qt object&#8217;s name</td>
</tr>
</tbody>
</table>
<p>Get target object&#8217;s name (object defined by user or object&#8217;s meta class name)</p>
</dd></dl>
<dl class="method">
<dt id="userale.ale.Ale.handleDragEvents">
<code class="descname">handleDragEvents</code><span class="sig-paren">(</span><em>event_type</em>, <em>event</em>, <em>object</em><span class="sig-paren">)</span><a class="headerlink" href="#userale.ale.Ale.handleDragEvents" title="Permalink to this definition"></a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>event_type</strong> &#8211; [str] The string representation of the type of event being triggered by the user.</li>
<li><strong>event</strong> &#8211; [QEvent] The base class for all event classes.</li>
<li><strong>object</strong> &#8211; [QObject] The base class for all Qt objects.</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">[dict] A userale log describing a drag event.</p>
</td>
</tr>
</tbody>
</table>
<p>Returns the userale log representing all drag events.</p>
</dd></dl>
<dl class="method">
<dt id="userale.ale.Ale.handleKeyEvents">
<code class="descname">handleKeyEvents</code><span class="sig-paren">(</span><em>event_type</em>, <em>event</em>, <em>object</em><span class="sig-paren">)</span><a class="headerlink" href="#userale.ale.Ale.handleKeyEvents" title="Permalink to this definition"></a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>event_type</strong> &#8211; [str] The string representation of the type of event being triggered by the user.</li>
<li><strong>event</strong> &#8211; [QEvent] The base class for all event classes.</li>
<li><strong>object</strong> &#8211; [QObject] The base class for all Qt objects.</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">[dict] A userale log describing a key event.</p>
</td>
</tr>
</tbody>
</table>
<p>Returns the userale log representing all key events, including key name and key code.</p>
</dd></dl>
<dl class="method">
<dt id="userale.ale.Ale.handleMouseEvents">
<code class="descname">handleMouseEvents</code><span class="sig-paren">(</span><em>event_type</em>, <em>event</em>, <em>object</em><span class="sig-paren">)</span><a class="headerlink" href="#userale.ale.Ale.handleMouseEvents" title="Permalink to this definition"></a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>event_type</strong> &#8211; [str] The string representation of the type of event being triggered by the user.</li>
<li><strong>event</strong> &#8211; [QEvent] The base class for all event classes.</li>
<li><strong>object</strong> &#8211; [QObject] The base class for all Qt objects.</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">[dict] A userale log describing a mouse event.</p>
</td>
</tr>
</tbody>
</table>
<p>Returns the userale log representing all mouse event data.</p>
</dd></dl>
<dl class="method">
<dt id="userale.ale.Ale.handleMoveEvents">
<code class="descname">handleMoveEvents</code><span class="sig-paren">(</span><em>event_type</em>, <em>event</em>, <em>object</em><span class="sig-paren">)</span><a class="headerlink" href="#userale.ale.Ale.handleMoveEvents" title="Permalink to this definition"></a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>event_type</strong> &#8211; [str] The string representation of the type of event being triggered by the user.</li>
<li><strong>event</strong> &#8211; [QEvent] The base class for all event classes.</li>
<li><strong>object</strong> &#8211; [QObject] The base class for all Qt objects.</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">[dict] A userale log describing a drag event.</p>
</td>
</tr>
</tbody>
</table>
<p>Returns the userale log representing all move events.</p>
</dd></dl>
<dl class="method">
<dt id="userale.ale.Ale.handleResizeEvents">
<code class="descname">handleResizeEvents</code><span class="sig-paren">(</span><em>event_type</em>, <em>event</em>, <em>object</em><span class="sig-paren">)</span><a class="headerlink" href="#userale.ale.Ale.handleResizeEvents" title="Permalink to this definition"></a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>event_type</strong> &#8211; [str] The string representation of the type of event being triggered by the user.</li>
<li><strong>event</strong> &#8211; [QEvent] The base class for all event classes.</li>
<li><strong>object</strong> &#8211; [QObject] The base class for all Qt objects.</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">[dict] A userale log describing a resize event.</p>
</td>
</tr>
</tbody>
</table>
<p>Returns the userale log representing all resize events.</p>
</dd></dl>
<dl class="method">
<dt id="userale.ale.Ale.handleScrollEvents">
<code class="descname">handleScrollEvents</code><span class="sig-paren">(</span><em>event_type</em>, <em>event</em>, <em>object</em><span class="sig-paren">)</span><a class="headerlink" href="#userale.ale.Ale.handleScrollEvents" title="Permalink to this definition"></a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>event_type</strong> &#8211; [str] The string representation of the type of event being triggered by the user.</li>
<li><strong>event</strong> &#8211; [QEvent] The base class for all event classes.</li>
<li><strong>object</strong> &#8211; [QObject] The base class for all Qt objects.</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">[dict] A userale log describing a scroll event.</p>
</td>
</tr>
</tbody>
</table>
<p>Returns the userale log representing all scroll events.</p>
</dd></dl>
</dd></dl>
</div>
</div>
</div>
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="authors.html" class="btn btn-neutral float-right" title="Authors" accesskey="n">Next <span class="fa fa-arrow-circle-right"></span></a>
<a href="quickstart.html" class="btn btn-neutral" title="Quickstart Guide" accesskey="p"><span class="fa fa-arrow-circle-left"></span> Previous</a>
</div>
<hr/>
<div role="contentinfo">
<p>
&copy; Copyright 2016, The Charles Stark Draper Laboratory..
</p>
</div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'1.0.4',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="_static/js/theme.js"></script>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.StickyNav.enable();
});
</script>
</body>
</html>