Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
Updated documentation.
  • Loading branch information
mooshu1x2 committed Jul 15, 2016
1 parent eea7049 commit 78019ad6e9571b4e8ed8eca8cfc1e1580fc1aa9a
Showing 16 changed files with 372 additions and 90 deletions.
@@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 24cee4276d2301953399f44f5dfb7cb5
config: fe0124fd78578c0b5125e09f2b846085
tags: 645f666f9bcd5a90fca523b33c5a78b7
@@ -1,4 +1,4 @@
Authors
-------

.. include:: ../../AUTHORS.txt
.. include:: ../../AUTHORS
@@ -3,4 +3,4 @@ UserAle Changelog

Here you can see the full list of changes between each UserAle.pyqt5 release.

.. include:: ../../CHANGELOG.txt
.. include:: ../../CHANGELOG
@@ -1,14 +1,5 @@
:orphan:

Apache UserAle's documentation!
===============================
.. include:: ../../README

.. include:: contents.rst.inc

Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`

@@ -2,3 +2,113 @@

Installation Guide
==================

Requirements
------------

* Python 3.5 or above
* PyQt5, version 5.3 or above
* pip3, see requirements.txt

Installing UserAle
------------------

The first step is to install UserAle. First, checkout the latest version of UserAle from our Github repository.

::

$ git clone https://github.com/draperlaboratory/userale.pyqt5.git

UserAle is a python3 project, so it can be installed like any other python library. Several operating systems (Mac OS X, Major Versions of Linux/BSD) have Python3 pre-installed, so you should just have to run

::

$ easy_install3 userale

or

::

$ pip3 install userale

Users are strongly recommended to install UserAle in a virtualenv. Instructions to setup an virtual environment will be explained below.

.. note ::

UserAle.pyqt5 requires that PyQt5 and the Qt5 bindings has been installed. Instructions to install PyQt5 and Qt5 in a virtual environment will be left to the user.

.. note ::

When the package is installed via ``easy_install3`` or ``pip3`` this function will be bound to the ``userale`` executable in the Python installation's ``bin`` directory (on Windows - the ``Scripts`` directory).

Installing UserAle in an Virtual Environment
--------------------------------------------

There are multiple ways to create virtual environments for a Python3 application. virtualenv is a one of those tools to create isolated Python environments. virtualenv creates a folder which contains all the necessary executables to use the packages that the UserAle project would need.


Start by changing directory into the root of UserAle's project directory, and then use the virtualenv command-line tool to create a new environment:

::

$ virtualenv --python=/usr/bin/python3 env


Optionally, Python3 has built in support for virtual environments.

::

$ mkdir env
$ python3 -m venv env

Activate environment:

::

$ source env/bin/activate

Install UserAle requirements:

::

$ env/bin/pip3 -r requirements.txt

To build the source code and run all unit tests.

::

$ env/bin/python3 setup.py develop test

Deactivate environment

::

$ deactivate

Installing Documentation
------------------------

To save yourself the trouble, all up to date documentation is available at https://draperlaboratory.github.io/userale.pyqt5/.

However, if you want to manully build the documentation, the instructions are below.

To build UserAle's documentation, create a directory at the root level of ``/userale.pyqt5`` called userale.pyqt5-docs.

::

$ mkdir userale.pyqt5-docs & cd userale.pyqt5/docs

Execute build command:

::

# Inside top-level docs/ directory.
$ make html

This should build the documentation in your shell, and output HTML. At then end, it should say something about documents being ready in ``userale.pyqt5-docs/html``.

You can now open them in your browser by typing

::

$ open userale.pyqt5-docs/html/index.html
@@ -1,4 +1,58 @@
.. _quickstart:

Quickstart Guide
================
================

Instrumenting Your Application with UserAle
-------------------------------------------

It's very simple to instrument a PyQ5 application with UserAle. Simply import the UserAle library and register it with your application.

Below is an example PyQt5 application taken from ZetCode PyQt5 tutorial instrumented with UserAle

::

import sys
from PyQt5.QtWidgets import QWidget, QLabel, QPushButton, QApplication, QMessageBox
from PyQt5.QtCore import QCoreApplication, QObject, QEvent

from userale.ale import Ale

class TestApplication (QWidget):

def __init__(self):
super().__init__()
self.initUI()

def initUI(self):
qbtn = QPushButton('Quit', self)
qbtn.setObjectName ("testApplicationButton")
qbtn.clicked.connect(QCoreApplication.instance().quit)
qbtn.resize(qbtn.sizeHint())
qbtn.move(50, 50)

self.setGeometry(300, 300, 250, 150)
self.setWindowTitle('Quit button')
self.show()

if __name__ == '__main__':
app = QApplication(sys.argv)
ex = TestApplication()
# Initiate UserAle
ale = Ale ()
# install globally
app.installEventFilter (ale)

sys.exit (app.exec_())



Before we enter the mainloop of the application, UserAle needs to register the application to be instrumented.
Simply instantiate UserAle and install it as an event filter in your application.

::

# Initiate UserAle
ale = Ale ()
# install globally
app.installEventFilter (ale)
@@ -8,7 +8,7 @@

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>Authors &mdash; Apache UserAle 1.0 documentation</title>
<title>Authors &mdash; UserAle 1.0 documentation</title>



@@ -30,7 +30,7 @@



<link rel="top" title="Apache UserAle 1.0 documentation" href="index.html"/>
<link rel="top" title="UserAle 1.0 documentation" href="index.html"/>
<link rel="next" title="UserAle Changelog" href="changelog.html"/>
<link rel="prev" title="API Documentation" href="userale.html"/>

@@ -50,7 +50,7 @@



<a href="index.html" class="icon icon-home"> Apache UserAle
<a href="index.html" class="icon icon-home"> UserAle



@@ -90,7 +90,7 @@
</ul>
<ul class="current">
<li class="toctree-l1 current"><a class="current reference internal" href="#">Authors</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#development-leads">Development Leads</a></li>
<li class="toctree-l2"><a class="reference internal" href="#development-lead">Development Lead</a></li>
<li class="toctree-l2"><a class="reference internal" href="#additional-staff">Additional Staff</a></li>
</ul>
</li>
@@ -109,7 +109,7 @@

<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">Apache UserAle</a>
<a href="index.html">UserAle</a>
</nav>


@@ -130,8 +130,6 @@
<li class="wy-breadcrumbs-aside">


<a href="_sources/authors.txt" rel="nofollow"> View page source</a>


</li>
</ul>
@@ -144,8 +142,8 @@
<h1>Authors<a class="headerlink" href="#authors" title="Permalink to this headline"></a></h1>
<p>UserAle.pyqt5 is written and maintained by Michelle Beard and
various contributors:</p>
<div class="section" id="development-leads">
<h2>Development Leads<a class="headerlink" href="#development-leads" title="Permalink to this headline"></a></h2>
<div class="section" id="development-lead">
<h2>Development Lead<a class="headerlink" href="#development-lead" title="Permalink to this headline"></a></h2>
<ul class="simple">
<li>Michelle Beard &lt;<a class="reference external" href="mailto:mbeard&#37;&#52;&#48;draper&#46;com">mbeard<span>&#64;</span>draper<span>&#46;</span>com</a>&gt;</li>
</ul>
@@ -181,7 +179,7 @@ <h2>Additional Staff<a class="headerlink" href="#additional-staff" title="Permal

<div role="contentinfo">
<p>
&copy; Copyright 2016, The Charles Stark Draper Laboratory Licensed under Apache Software License..
&copy; Copyright 2016, The Charles Stark Draper Laboratory..

</p>
</div>
@@ -8,7 +8,7 @@

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>UserAle Changelog &mdash; Apache UserAle 1.0 documentation</title>
<title>UserAle Changelog &mdash; UserAle 1.0 documentation</title>



@@ -30,7 +30,7 @@



<link rel="top" title="Apache UserAle 1.0 documentation" href="index.html"/>
<link rel="top" title="UserAle 1.0 documentation" href="index.html"/>
<link rel="next" title="License" href="license.html"/>
<link rel="prev" title="Authors" href="authors.html"/>

@@ -50,7 +50,7 @@



<a href="index.html" class="icon icon-home"> Apache UserAle
<a href="index.html" class="icon icon-home"> UserAle



@@ -108,7 +108,7 @@

<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">Apache UserAle</a>
<a href="index.html">UserAle</a>
</nav>


@@ -129,8 +129,6 @@
<li class="wy-breadcrumbs-aside">


<a href="_sources/changelog.txt" rel="nofollow"> View page source</a>


</li>
</ul>
@@ -171,7 +169,7 @@ <h2>Version 1.0<a class="headerlink" href="#version-1-0" title="Permalink to thi

<div role="contentinfo">
<p>
&copy; Copyright 2016, The Charles Stark Draper Laboratory Licensed under Apache Software License..
&copy; Copyright 2016, The Charles Stark Draper Laboratory..

</p>
</div>

0 comments on commit 78019ad

Please sign in to comment.