/pairwise

A web application and associated Windows desktop tools for doing pairwise comparisons of files

Primary LanguagePythonGNU General Public License v3.0GPL-3.0

pairwise

A web application and associated Windows desktop tools for doing pairwise comparisons of files.

desktop-tools

Windows desktop tools for pairwise comparisons of files

The main components of this program are: pwv_main.py - this is the main application for doing pairwise comparisons. It contains the main logic for both the judging panel and the settings panel. It uses the QT UI form classes - Ui_MainWindow and Ui_Settings - that are stored in the folder qt_forms.

pwv_main_en.py - is just a version of pwv_main that does not apply any translation and so is in English. This is needed because pwv_main.py is currently hard-coded to use the Portuguese translation (stored in pwv.ts and pwv.qm). A better solution will be to have a single application with a language setting.

comparisons_csv.py - a class that stores the information about the outcomes of judgements in a CSV file. Note that the application also uploads the same information to the server. The CSV file is mostly there as a back up in case the server transfer goes wrong and also as a quick way to check the judgements made so far. Used by pwv_main.py

shared_utilities.py - contains miscellaneous utilities for accessing data from the online application and for displaying warnings and messages in QT applications.

file_match.py - utilities for grabbing files that match set criteria in a folder and its subfolders. Used by folder_scanner.py

pwv_settings.json - the application saves its settings here.

folder_scanner.py - simple QT Windows application that can scan a folder and copy the list of file names (with complete paths) to the clipboard.

uploader.py - similar to folder_scanner, but can also upload the list of files to the server. I suggest it is actually simpler not to use this but just to use the folder_scanner application and copy-paste the files in to the online application.

qt_forms/ - contains forms for the QT applications, converted from .ui files using the pyuic4 tool - file_scanner_ui.py - for the file_scanner.py application - main.py - for the main pairwise application - settings.py - for the settings window in the main pairwise application - uploader.py - for the uploader application

qt_forms/ also contains the original .ui files automatically generated by the QT Designer; and some translation files that are currently not used.

dist/ - contains the windows executable files generated using PyInstaller For example the main application executable is at pairwise/desktop-tools/dist/pwv_main/pwv_main.exe. The folder pairwise/desktop-tools/dist/pwv_main/ can be copied onto another computer to allow the executable to run there.

dist/ also contains a folder platforms/ containing one file, qwindows.dll. py2exe sometimes fails to copy this folder and so it needs to be copied manually into the dist folders.

build/ - contains the files generated by py2exe during the build and is safe to delete.

The tools are written in Python 2.7. I made some initial untested efforts to make them Python 3-compatible.

web-app

A web application for administration of Pairwise comparisons. It allows admins to list and output the comparisons that have been made, set weights and other parameters determining the likelihood of two files being viewed together, create comparison sessions, and add or remove users from sessions. It also allows users to upload lists of file names using the uploader desktop tool (see above). Finally, the main pairwise comparisons app (pwv_main.py, see above) uploads the comparison information to this app which stores it in a database.

The app runs on Google App Engine (a Google Cloud service) and can currently be found at http://www.education-metrics.appspot.com/pwva (accessible only to users signed in as admins. It requires a google username and password). In the root directory, app.yaml, appengine_config.py and index.yaml are all standard GAE files. app.yaml tells it where to route each URL.

The entire server-side logic for the web app is contained in one long file web-app/pairwise/main.py. This includes database entity classes, functions returning the appropriate responses for each URL, and a few general utility functions.

The app uses flask templates to return web pages. The templates are stored in web-app/pairwise/templates/. admin_base.html is the basic template which the others are all based on.

The webpages rely on a series of JS files stored in web-app/pairwise/static/. These are written in vanilla JS with a simple library of commands stored in web-app/static/library.js

There is a single stylesheet for the entire app - web-app/style.css.