From aab098882ac34ce3e6d6bf205903c0efe80efd58 Mon Sep 17 00:00:00 2001 From: Pete R Jemian Date: Fri, 16 Aug 2024 11:04:00 -0500 Subject: [PATCH] DOC overhaul --- CHANGES.rst | 1 + README.md | 9 +- docs/source/command_line.rst | 83 ++++--- docs/source/contents.rst | 2 +- docs/source/dependencies.rst | 48 ---- docs/source/glossary.rst | 6 +- docs/source/index.rst | 93 +++----- docs/source/info.rst | 19 +- docs/source/install.rst | 66 ++++++ docs/source/overview.rst | 45 ++++ docs/source/pvMail/email_model.rst | 12 + docs/source/pvMail/{modules.rst => index.rst} | 6 +- docs/source/pvMail/mailer.rst | 10 +- src/PvMail/__init__.py | 2 +- src/PvMail/resources/sampler.py | 38 ---- src/PvMail/resources/sampler.ui | 213 ------------------ 16 files changed, 229 insertions(+), 424 deletions(-) delete mode 100644 docs/source/dependencies.rst create mode 100644 docs/source/install.rst create mode 100644 docs/source/pvMail/email_model.rst rename docs/source/pvMail/{modules.rst => index.rst} (90%) delete mode 100644 src/PvMail/resources/sampler.py delete mode 100644 src/PvMail/resources/sampler.ui diff --git a/CHANGES.rst b/CHANGES.rst index 09e8d0b..9e94c52 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -27,6 +27,7 @@ History of user-visible changes between the versions. ---------------- * Documentation moved to GitHub Pages (from readthedocs). + * Documentation now uses 'pydata_sphinx_theme'. * Project moved to GitHub "BCDA-APS" organization. * Python 3.8 - 3.12 now supported (no Python 2 support). * Switch to use PyDM widgets (dropped bcdaqwidgets). diff --git a/README.md b/README.md index af29ec1..7671bdc 100644 --- a/README.md +++ b/README.md @@ -7,9 +7,8 @@ tag | release | PyPI | conda --- | --- | --- | --- [![image](https://img.shields.io/github/tag/prjemian/PvMail.svg)](https://github.com/prjemian/PvMail/tags) | [![image](https://img.shields.io/github/release/prjemian/PvMail.svg)](https://github.com/prjemian/PvMail/releases) | [![image](https://img.shields.io/pypi/v/PvMail.svg)](https://pypi.python.org/pypi/PvMail/) | --tba-- -- docs: -- git: -- author: Pete R. Jemian -- email: - copyright: (c) 2009-2024, UChicago Argonne, LLC -- license: ANL OPEN SOURCE LICENSE (see *LICENSE*) +- license: [ANL OPEN SOURCE LICENSE](./src/PvMail/LICENSE) +- documentation: [https://prjemian.github.io/pvMail/](https://prjemian.github.io/pvMail/) +- source: [https://github.com/prjemian/pvMail](https://github.com/prjemian/pvMail) +- authors: Pete R. Jemian, Kurt Goetze \ No newline at end of file diff --git a/docs/source/command_line.rst b/docs/source/command_line.rst index 3ed7c15..5a33868 100644 --- a/docs/source/command_line.rst +++ b/docs/source/command_line.rst @@ -1,4 +1,3 @@ - .. _cli: pvMail: command-line interface @@ -19,21 +18,21 @@ GUI:: pvMail triggerPV messagePV user1@email.domain,user2@host.server -g & -PvMail uses Matt Newville's `PyEpics `_ -package for EPICS CA connections and `PyQt4 `_ -package to manage the GUI. - .. tip:: Since *PvMail* creates a log file (by default in the current working directory), be sure you start the program from a directory to which you have write access or specify the absolute path to the log file as a command line argument:: - + pvMail -l /path/to/log_file.txt triggerPV messagePV user1@email.domain & +Starting PvMail ++++++++++++++++ + + Starting PvMail from the command-line -+++++++++++++++++++++++++++++++++++++ +------------------------------------- .. index:: example @@ -45,7 +44,7 @@ PvMail is started from the command line:: No program output is printed to the screen. Instead, the output is directed to a log file. Here is an example:: - + INFO:root:(pvMail.py,2011-11-27 19:03:23.072392) ############################################################ INFO:root:(pvMail.py,2011-11-27 19:03:23.072826) startup INFO:root:(pvMail.py,2011-11-27 19:03:23.072897) trigger PV = pvMail:trigger @@ -75,18 +74,18 @@ to a log file. Here is an example:: The program starts, reports its configurations, and connects with the EPICS PVs, and then goes into a background mode. A checkpoint (command-line option ``-i``) is reported periodically. The default is 5 seconds. This may -be changed to 10 minutes or longer for production use, but is always +be changed to 10 minutes or longer for production use, but is always specified in seconds. -Observe that, in the above example, the trigger PV changed from 0 to 1 at -19:03:27.373142 (and back to 0 at 19:03:29.440516). +Observe that, in the above example, the trigger PV changed from 0 to 1 at +19:03:27.373142 (and back to 0 at 19:03:29.440516). The change at ~19:03:27 triggered PvMail to send an email as configured. For now, the code writes the text of the email to a temporary file (command-line option ``-m``, default is "/tmp/pvmail_message.txt"). In this example, the message reads:: pvMail default message - + user: jemian host: como-ubuntu64 date: 2011-11-27 19:03:27.374135 @@ -117,9 +116,9 @@ The full message, as seen in the mail browser is:: Subject: pvMail.py: pvMail:trigger From: Pete R Jemian Date: Sun, 27 Nov 2011 19:03:27 -0600 - + pvMail default message - + user: jemian host: como-ubuntu64 date: 2011-11-27 19:03:27.374135 @@ -130,7 +129,7 @@ The full message, as seen in the mail browser is:: recipients: jemian Starting PvMail from the command-line at the APS -++++++++++++++++++++++++++++++++++++++++++++++++ +------------------------------------------------ At the APS, Enthought Python Distribution is installed on the /APSshare partition available to all beam lines. @@ -151,40 +150,40 @@ or the 32-bit version:: command-line parameters -======================= ++++++++++++++++++++++++ .. index:: command-line .. index:: usage usage -+++++ +----- .. index:: example When PvMail is started from the command line with no additional parameters:: $ pvMail - + usage: pvMail [-h] [-l LOG_FILE] [-i LOGGING_INTERVAL] [-r SLEEP_DURATION] [-g] [-v] trigger_PV message_PV email_addresses pvMail: error: too few arguments This is the *usage* message. -It tells us we must supply three :index:`positional arguments`: +It tells us we must supply three :index:`positional arguments`: ``trigger_PV message_PV email_addresses``. positional argument: ``trigger_PV`` -+++++++++++++++++++++++++++++++++++ +------------------------------------- -EPICS process variable name to watch using a CA monitor. +EPICS process variable name to watch using a CA monitor. When ``trigger_PV`` makes a transition from 0 (zero) to 1 (one), then get the string from the ``message_PV`` and send an email to all of the ``email_addresses`` on the list. positional argument: ``message_PV`` -+++++++++++++++++++++++++++++++++++ +------------------------------------- EPICS process variable name pointing to a (short) message that will be used as the first part of the email message to be sent. @@ -192,10 +191,10 @@ be used as the first part of the email message to be sent. .. Can this be a waveform of char acting as a string? Probably but test it. positional argument: ``email_addresses`` -++++++++++++++++++++++++++++++++++++++++ +---------------------------------------- List of email addresses, separated by commas if more than one. For example, -``user1@email.domain,user2@host.server`` will send one email to +``user1@email.domain,user2@host.server`` will send one email to ``user1@email.domain`` and another email to ``user2@host.server``. .. index:: email to a pager at APS @@ -203,13 +202,13 @@ List of email addresses, separated by commas if more than one. For example, .. note:: At Argonne, it is possible to send email to a pager using the email address ``####@pager.anl.gov`` and the pager number. - Be sure not to use a preceding ``4-`` or the email will not be + Be sure not to use a preceding ``4-`` or the email will not be deliverable. .. index:: optional arguments option: ``--version`` or ``-v`` -+++++++++++++++++++++++++++++++++ +----------------------------------- The current version of the program can always be printed using the ``-v`` or ``--version``. With this option, the program prints @@ -221,7 +220,7 @@ the version number and then quits. 3.0-663 option: ``--help`` or ``-h`` -++++++++++++++++++++++++++++++ +----------------------------------- It may be easier to review the short help instructions for command-line options:: @@ -229,14 +228,14 @@ It may be easier to review the short help instructions for command-line options: usage: pvMail [-h] [-l LOG_FILE] [-i LOGGING_INTERVAL] [-r SLEEP_DURATION] [-g] [-v] trigger_PV message_PV email_addresses - + Watch an EPICS PV. Send email when it changes from 0 to 1. - + positional arguments: trigger_PV EPICS trigger PV name message_PV EPICS message PV name email_addresses email address(es), comma-separated if more than one - + optional arguments: -h, --help show this help message and exit -l LOG_FILE for logging program progress and comments @@ -246,51 +245,51 @@ It may be easier to review the short help instructions for command-line options: -v, --version show program's version number and exit option: ``--gui`` or ``-g`` -++++++++++++++++++++++++++++ +----------------------------------- This command line option is used to start the GUI (see :ref:`GUI`). -If either GUI option is used, then the positional arguments +If either GUI option is used, then the positional arguments (``triggerPV messagePV email@address``) are optional. option: ``-l LOG_FILE`` -+++++++++++++++++++++++ +----------------------------------- Both the command-line and GUI versions of PvMail log all program output to a log file. If a LOG_FILE is not specified on the command -line, the default file will be ``pvMail-PID.log`` in the current directory +line, the default file will be ``pvMail-PID.log`` in the current directory where *PID* is the process identifier of the running ``pvMail`` program. .. note:: If the LOG_FILE already exists, new information will be appended. - It is up to the account owner to delete a LOG_FILE when it is no + It is up to the account owner to delete a LOG_FILE when it is no longer useful. -The PID number is useful when you wish to end a program that is running +The PID number is useful when you wish to end a program that is running as a background daemon. The UNIX/Linux command is:: kill PID option: ``-i LOGGING_INTERVAL`` -+++++++++++++++++++++++++++++++ +----------------------------------- :units: seconds When a program runs in the background, waiting for occasional activity, there is often some concern that the program is actually prepared to act -when needed. To offset this concern, PvMail will report a +when needed. To offset this concern, PvMail will report a *checkpoint* message periodically (every LOGGING_INTERVAL seconds, default is every 5 minutes) to the LOG_FILE. The program ensures that LOGGING_INTERVAL is no shorter than 5 seconds or longer than 1 hour. option: ``-r SLEEP_DURATION`` -+++++++++++++++++++++++++++++ +----------------------------------- :units: seconds For operation as a background daemon process, the command-line version -must check periodically for new EPICS CA events, using a call to +must check periodically for new EPICS CA events, using a call to :meth:`epics.ca.poll()`. In between calls, the application is told to sleep -for SLEEP_DURATION seconds. The default SLEEP_DURATION is 0.2 seconds and -is limited to values between 0.1 ms and 5 s. +for SLEEP_DURATION seconds. The default SLEEP_DURATION is 0.2 seconds and +is limited to values between 0.1 ms and 5 s. diff --git a/docs/source/contents.rst b/docs/source/contents.rst index 2d6aab6..1de84db 100644 --- a/docs/source/contents.rst +++ b/docs/source/contents.rst @@ -9,8 +9,8 @@ Contents command_line gui test_database - pvMail/modules info + pvMail/index changes license diff --git a/docs/source/dependencies.rst b/docs/source/dependencies.rst deleted file mode 100644 index 3f156af..0000000 --- a/docs/source/dependencies.rst +++ /dev/null @@ -1,48 +0,0 @@ - -Dependencies -============ - -This software was built with various standard Python packages -available in Python 2.7. Additionally, these packages were added: - - -.. index:: BcdaQWidgets - -*BcdaQWidgets* (EPICS-aware Qt widgets) - http://BcdaQWidgets.readthedocs.io - -.. index:: PyEpics - -*PyEpics* (EPICS interface) - http://cars9.uchicago.edu/software/python/pyepics3/ - -.. index:: PyQt4 - -*PyQt4* (Qt binding) - https://wiki.python.org/moin/PyQt - -All are available for installation -from the Python Package Index (http://pypi.python.org/pypi) -using `pip `_. - -Installation -************ - -.. index:: installation - -The most recent public release -of this software is available from the Python Package Index [#]_ -by either:: - - [joeuser] $ pip install PvMail - -or:: - - [joeuser] $ easy_install PvMail - -.. index:: source code - -while the source is available from GitHub: -https://github.com/prjemian/pvMail - -.. [#] https://pypi.python.org/pypi/PvMail diff --git a/docs/source/glossary.rst b/docs/source/glossary.rst index 95351b3..1a6cfd3 100644 --- a/docs/source/glossary.rst +++ b/docs/source/glossary.rst @@ -1,3 +1,4 @@ +.. _glossary: Glossary ======== @@ -27,6 +28,9 @@ Glossary :index:`PV` EPICS process variable +:index:`PVA` + EPICS PV Access protocol (not used here) + :index:`PvMail` Name of the Python package that provides the ``pvMail`` executable @@ -36,7 +40,7 @@ Glossary :index:`PyEpics` Python package to manage connections with PVs served by an EPICS IOC -:index:`PyQt4` +:index:`PyQt5` Python framework for GUI and other Qt components :index:`trigger PV` diff --git a/docs/source/index.rst b/docs/source/index.rst index 74bfac5..0301b6e 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -1,73 +1,52 @@ +====== PvMail -###### +====== -Watches an EPICS PV and sends email when value changes from 0 to 1. +Watches an EPICS PV and sends email when value changes from 0 to 1. -:author: Pete R. Jemian -:email: jemian@anl.gov -:copyright: 2009-2024, UChicago Argonne, LLC -:license: ANL OPEN SOURCE LICENSE (see *LICENSE*) -:docs: http://PvMail.readthedocs.io -:git: https://github.com/prjemian/pvMail -:PyPI: https://pypi.python.org/pypi/PvMail -:version: |version| -:release: |release| -:published: |today| +.. icons: https://fonts.google.com/icons -.. note:: While *PvMail* is the name of the Python package, - the executable installed in /bin is called - ``pvMail`` using a command line such as:: - - [user@host,518,~]$ pvMail +.. grid:: 2 -PvMail watches (monitor) an EPICS PV and send an email -when the value of that PV changes from 0 to 1. + .. grid-item-card:: :material-regular:`summarize;3em` :ref:`overview` + :link: overview + :link-type: doc -.. sidebar:: IMPORTANT: + .. grid-item-card:: :material-regular:`install_desktop;3em` :ref:`install` + :link: install + :link-type: doc - PvMail *only* triggers when the trigger_PV makes a transition from 0 to 1. - - * It ignores transitions (in floating-point PVs) to - 1.0000... that do not come directly from 0.0000... - If you wish to watch a PV that presents values other than 0 and 1, - then use a calculation PV as the trigger which results in a - transition from 0 to 1. - * Reset the value of the trigger_PV to 0 to resume watching - for the next triggered event. + .. grid-item-card:: :material-regular:`api;3em` :ref:`api` + :link: pvMail/index + :link-type: doc -The PV being watched (that *triggers* the sending of the email) -can be any EPICS record type or field -that results in a value of 0 (zero) that changes to 1 (one). This -includes these EPICS records (and possibly more): -*ai*, *ao*, *bi*, *bo*, *calcout*, *scalcout*, *swait*, ... + .. grid-item-card:: :material-regular:`school;3em` :ref:`glossary` + :link: glossary + :link-type: doc -When an event causes an email to be triggered, PvMail will retrieve -the value of another PV that is the first part of the message to be -sent. Additional metadata will be appended to the message. +.. note:: While *PvMail* is the name of the Python package, + the executable is ``pvMail``. Use a command line such as:: -.. note:: - Email is sent using either a call to a configured SMTP server or - the ``sendmail`` program on the native OS. - The sendmail protocol is only supported on Linux systems - that provide a ``sendmail`` program. - The SMTP protocol is more general but requires valid credentials - on the SMTP server and the credentials must be stored - in a local configuration file. + $ pvMail -PvMail provides either a command-line interface or a graphical user -interface. Both are accessed from the same command, using different -command-line options. The command-line version is intended to run -as a background program, it has no user interaction but logs all its -output into a log file. The GUI version provides a screen to edit -each of the parameters before the background process is started. -It also provides buttons to start and stop the background process. +About +##### -Overview of Contents -#################### +:author: Pete R. Jemian +:email: jemian@anl.gov +:copyright: 2009-2024, UChicago Argonne, LLC +:license: ANL OPEN SOURCE LICENSE (see *LICENSE*) +:docs: https://prjemian.github.io/pvMail/ +:git: https://github.com/prjemian/pvMail +:PyPI: https://pypi.python.org/pypi/PvMail +:version: |version| +:release: |release| +:published: |today| .. toctree:: - :maxdepth: 2 - + :hidden: + contents + overview glossary - dependencies + install diff --git a/docs/source/info.rst b/docs/source/info.rst index d267108..b627227 100644 --- a/docs/source/info.rst +++ b/docs/source/info.rst @@ -39,17 +39,17 @@ Documentation PvMail project Documentation for the PvMail project, -maintained using Sphinx (http://sphinx.pocoo.org), +maintained using Sphinx (http://www.sphinx-doc.org), is available from: -* http://PvMail.readthedocs.org +* https://prjemian.github.io/pvMail .. index:: TODO items .. _TODO: -TODO items for future releases +Items for future releases ############################## :see: https://github.com/prjemian/pvMail/issues @@ -60,17 +60,14 @@ Authors :author: Kurt Goetze (original version) :author: Pete Jemian (this version) -:organization: AES/BCDA, Advanced Photon Source, Argonne National Laboratory +:organization: BCDA, Advanced Photon Source, Argonne National Laboratory Requirements ############ -:requires: EPICS system (http://www.aps.anl.gov/epics) - with at least two process variables (PVs) - where the "Trigger PV" toggles between values of 0 and 1 - and the "SendMessage PV" contains a string to send as part of - the email message. -:requires: PyEpics (http://cars9.uchicago.edu/software/python/pyepics3/) -:requires: PyQt4 (https://wiki.python.org/moin/PyQt) +Requires these Python :ref:`packages ` and an `EPICS +`_ system with at least two process variables +(PVs) where the "Trigger PV" toggles between values of 0 and 1 and the +"SendMessage PV" contains a string to send as part of the email message. \ No newline at end of file diff --git a/docs/source/install.rst b/docs/source/install.rst new file mode 100644 index 0000000..5ed0f17 --- /dev/null +++ b/docs/source/install.rst @@ -0,0 +1,66 @@ +.. index:: installation + +.. _install: + +==================================== +Installation Guide +==================================== + +``PvMail`` is available for installation by ``pip`` or from source. Please +[report](https://github.com/prjemian/pvmail/issues/new) any issues you encounter +or feature requests, too. + +.. + .. _install.conda: + + conda + ----- + + Released versions of ``PvMail`` are available on `conda-forge + `_. + + If you have ``conda`` installed, then you can install:: + + $ conda install PvMail + +.. _install.pip: + +pip +--- + +Released versions of ``PvMail`` are available on `PyPI +`_. + +If you have ``pip`` installed, then you can install:: + + $ pip install PvMail + +.. index:: source code + +.. _install.source: + +source code +----------- + +The latest development version of ``PvMail`` can be downloaded from the +GitHub repository listed above:: + + $ git clone https://github.com/prjemian/pvmail + +To install from the source directory using ``pip`` in editable mode:: + + $ cd pvmail + $ python -m pip install -e . + +.. _install.dependencies: + +Dependencies +------------ + +This software was built with packages from the Python standard library and these +additional packages: + +- `PyQt5 `_ package to manage the GUI +- `PyEpics `_ for EPICS CA connections +- `PyDM `_ for EPICS-aware Qt widgets + diff --git a/docs/source/overview.rst b/docs/source/overview.rst index e02bb34..36edf67 100644 --- a/docs/source/overview.rst +++ b/docs/source/overview.rst @@ -4,6 +4,51 @@ Overview ======== +PvMail watches (monitor) an EPICS PV and send an email +when the value of that PV changes from 0 to 1. + +.. sidebar:: IMPORTANT: + + PvMail *only* triggers when the trigger_PV makes a transition from 0 to 1. + + * It ignores transitions (in floating-point PVs) to + 1.0000... that do not come directly from 0.0000... + If you wish to watch a PV that presents values other than 0 and 1, + then use a calculation PV as the trigger which results in a + transition from 0 to 1. + * Reset the value of the trigger_PV to 0 to resume watching + for the next triggered event. + +The PV being watched (that *triggers* the sending of the email) +can be any EPICS record type or field +that results in a value of 0 (zero) that changes to 1 (one). This +includes these EPICS records (and possibly more): +*ai*, *ao*, *bi*, *bo*, *calcout*, *scalcout*, *swait*, ... + +When an event causes an email to be triggered, PvMail will retrieve +the value of another PV that is the first part of the message to be +sent. Additional metadata will be appended to the message. + +.. note:: + Email is sent using either a call to a configured SMTP server or + the ``sendmail`` program on the native OS. + The sendmail protocol is only supported on Linux systems + that provide a ``sendmail`` program. + The SMTP protocol is more general but requires valid credentials + on the SMTP server and the credentials must be stored + in a local configuration file. + +PvMail provides either a command-line interface or a graphical user +interface. Both are accessed from the same command, using different +command-line options. The command-line version is intended to run +as a background program, it has no user interaction but logs all its +output into a log file. The GUI version provides a screen to edit +each of the parameters before the background process is started. +It also provides buttons to start and stop the background process. + +Details +------- + There are now several parts to the PvMail support package. .. index:: diff --git a/docs/source/pvMail/email_model.rst b/docs/source/pvMail/email_model.rst new file mode 100644 index 0000000..43880ea --- /dev/null +++ b/docs/source/pvMail/email_model.rst @@ -0,0 +1,12 @@ +.. _email_model: + +:mod:`email_model` Module +######################### + +Source Code Documentation +************************* + +.. automodule:: PvMail.email_model + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/pvMail/modules.rst b/docs/source/pvMail/index.rst similarity index 90% rename from docs/source/pvMail/modules.rst rename to docs/source/pvMail/index.rst index dfffec7..937de6b 100644 --- a/docs/source/pvMail/modules.rst +++ b/docs/source/pvMail/index.rst @@ -1,6 +1,7 @@ +.. _api: -PvMail as a Python package -========================== +Source Code Documentation +========================= This section provides the source code documentation. The documentation here may be of little or no use @@ -39,3 +40,4 @@ PvMail source code documentation uic_gui ini_config mailer + email_model diff --git a/docs/source/pvMail/mailer.rst b/docs/source/pvMail/mailer.rst index abd7776..3a11650 100644 --- a/docs/source/pvMail/mailer.rst +++ b/docs/source/pvMail/mailer.rst @@ -27,7 +27,7 @@ It is possible to test the email sending using the configuration file. (Alternatively, the GUI has a *File* menu item to send a test email.) First, the help message for the command:: - [joeuser] $ pvMail_mail_test --help + $ pvMail_mail_test --help usage: pvMail_mail_test [-h] recipient [recipient ...] @@ -42,7 +42,7 @@ First, the help message for the command:: To test the email sending using the configuration file:: - [joeuser] $ python ./mailer.py joeuser@example.com + $ python ./mailer.py joeuser@example.com An email message is sent from *joeuser* to joeuser@example.com: @@ -51,11 +51,11 @@ An email message is sent from *joeuser* to joeuser@example.com: To: joeuser@example.com Subject: PvMail mailer test message: sendmail - Date: Tue, 11 Nov 2014 13:17:31 -0600 (CST) + Date: Tue, 16 Aug 2024 13:17:31 -0600 (CDT) From: joeuser@example.com - This is a test of the PvMail mailer, v3.1.0 - For more help, see: http://PvMail.readthedocs.org + This is a test of the PvMail mailer, v4.0.0 + For more help, see: https://prjemian.github.io/pvMail Source Code Documentation diff --git a/src/PvMail/__init__.py b/src/PvMail/__init__.py index 05c60a9..169acd5 100644 --- a/src/PvMail/__init__.py +++ b/src/PvMail/__init__.py @@ -12,7 +12,7 @@ PROJECT = "PvMail" DESCRIPTION = "Watch an EPICS PV. Send email when it changes from 0 to 1." -DOCS_URL = "https://PvMail.readthedocs.io" +DOCS_URL = "https://prjemian.github.io/pvMail" AUTHORS = [ "Pete Jemian", "Kurt Goetze", diff --git a/src/PvMail/resources/sampler.py b/src/PvMail/resources/sampler.py deleted file mode 100644 index fad7d1e..0000000 --- a/src/PvMail/resources/sampler.py +++ /dev/null @@ -1,38 +0,0 @@ -"""PV controls to test the GUI: uses default database (test.db)""" - -import sys - -from PyQt4 import QtGui -from PyQt4 import uic - - -class DemoView(object): - """show the UI file""" - - def __init__(self, uifile): - self.ui = uic.loadUi(uifile) - self.ui.pop.released.connect(self.doPop) - self.counter = 0 - - def show(self): - self.ui.show() - - def doPop(self, *args, **kw): - # pop the top item from the vertical layout - layout = self.ui.vlayout - if layout is not None: - # layout.count() - item = layout.takeAt(0) - widget = item.widget() - if widget is not None: - widget.deleteLater() - self.counter += 1 - btn = QtGui.QPushButton("Pop " + str(self.counter), parent=self.ui) - btn.released.connect(self.doPop) - layout.addWidget(btn) - - -app = QtGui.QApplication(sys.argv) -view = DemoView("sampler.ui") -view.show() -sys.exit(app.exec_()) diff --git a/src/PvMail/resources/sampler.ui b/src/PvMail/resources/sampler.ui deleted file mode 100644 index d575777..0000000 --- a/src/PvMail/resources/sampler.ui +++ /dev/null @@ -1,213 +0,0 @@ - - - Dialog - - - - 0 - 0 - 400 - 300 - - - - Dialog - - - true - - - true - - - - - 30 - 240 - 341 - 32 - - - - Qt::Horizontal - - - QDialogButtonBox::Cancel|QDialogButtonBox::Ok - - - - - - 20 - 10 - 160 - 183 - - - - - - - true - - - meg - - - Qt::AlignCenter - - - - - - - true - - - yergoo - - - Qt::AlignCenter - - - - - - - true - - - yerek - - - Qt::AlignCenter - - - - - - - true - - - chors - - - Qt::AlignCenter - - - - - - - true - - - heeng - - - Qt::AlignCenter - - - - - - - true - - - vetz - - - Qt::AlignCenter - - - - - - - true - - - yote - - - Qt::AlignCenter - - - true - - - - - - - http://pvmail.readthedocs.org - - - true - - - Qt::TextBrowserInteraction - - - - - - - pop the stack - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - - buttonBox - accepted() - Dialog - accept() - - - 248 - 254 - - - 157 - 274 - - - - - buttonBox - rejected() - Dialog - reject() - - - 316 - 260 - - - 286 - 274 - - - - -