aboutsummaryrefslogtreecommitdiff
path: root/wqflask/utility
AgeCommit message (Collapse)Author
2020-08-27Add global method to convert binary string to plain stringBonfaceKilz
* wqflask/utility/db_tools.py: escape_string returns a binary string which introduces a bug when composing sql query string. The escaped strings have to be converted to plain text.
2020-08-27Replace "string.split" & "string.join" with python's inbuilt methodsBonfaceKilz
2020-08-26Remove "from __future__ import new_feature" statementsBonfaceKilz
See: <https://docs.python.org/2/library/2to3.html#2to3fixer-future>
2020-08-26Replace calls to "basestring with "str""BonfaceKilz
See: <https://docs.python.org/2/library/2to3.html#2to3fixer-basestring>
2020-08-26Update corestats importBonfaceKilz
* wqflask/utility/Plot.py: import corestats from the utility module.
2020-08-26Merge branch 'testing' into build/python3-migrationBonfaceKilz
2020-08-24Remove unused importsBonfaceKilz
* wqflask/utility/Plot.py: Remove unused imports like "numarray". "numarray" is does not have py3 support so it's important to remove references to it.
2020-08-24The function draw_rotated_text_ was writing an image to /tmp, which GN2zsloan
user apparently doesn't have access to, so I replaced it with a link to the dynamically set TEMPDIR * wqflask/utility/pillow_utils.py - Replaced "/tmp/" in image location with TEMPDIR
2020-08-23Use Python3 string methodsBonfaceKilz
* wqflask/utility/webqtlUtil.py (genRandStr): Replace "string.letters" with "string.ascii_letters".
2020-08-20Handle module renames in the standard libraryBonfaceKilz
Run: ``` 2to3-3.8 -f imports -w . && \ 2to3-3.8 -f imports2 -w . ``` See: <https://docs.python.org/2/library/2to3.html#2to3fixer-imports> and <https://docs.python.org/2/library/2to3.html#2to3fixer-imports2>
2020-08-19Remove extra whitespace(or add it) from comma separated itemsBonfaceKilz
See: <https://docs.python.org/2/library/2to3.html#2to3fixer-urllib>
2020-08-19Make Python more idiomaticBonfaceKilz
Run `2to3-3.8 -f idioms -w .` See: <https://docs.python.org/2/library/2to3.html#2to3fixer-idioms>
2020-08-19Rename xrange() to range() and wrap existing range() calls with listBonfaceKilz
See: <https://docs.python.org/2/library/2to3.html#2to3fixer-xrange>
2020-08-19Wrap `raise` statements in parenthesisBonfaceKilz
Run `2to3-3.8 -f raise -w .` See: <https://docs.python.org/2/library/2to3.html#2to3fixer-raise>
2020-08-19Convert the old not-equal syntax, <>, to !=BonfaceKilz
Run `2to3-3.8 -f ne -w .` See: <https://docs.python.org/2/library/2to3.html#2to3fixer-ne>
2020-08-19Fix dictionary iteration methodsBonfaceKilz
Run `2to3-3.8 -f dict -w .` See: <https://docs.python.org/2/library/2to3.html#2to3fixer-dict> and <https://stackoverflow.com/questions/17695456/why-does-python-3-need-dict-items-to-be-wrapped-with-list>
2020-08-19Remove erroneous `if .. else` branchBonfaceKilz
* wqflask/utility/svg.py [roct, ellipse, SVGelement]: Raise only a single value error if either height or width is not defined. Fixes parsing error when running `2to3-3.8 -f apply -w .`
2020-08-19Wrap `map()` in a `list` callBonfaceKilz
Run `2to3-3.8 -f map -w .` See: <https://docs.python.org/2/library/2to3.html#2to3fixer-map>
2020-08-18Apply pep8BonfaceKilz
* wqflask/utility/svg.py: Apply pep8 to fix indentation error when running `2to3-3.8 -w .`: ```` RefactoringTool: Can't parse ./wqflask/utility/svg.py: IndentationError: unindent does not match any outer indentation level (<tokenize>, line 403) ````
2020-08-18Replace "<>" with "!="BonfaceKilz
* wqflask/utility/svg.py: Use "!=". The operator, "<>" is removed in Python3
2020-08-18Wrap print statements in parenthesesBonfaceKilz
2020-08-18Fix malformed docstringBonfaceKilz
* wqflask/utility/Plot.py: Update docstring.
2020-08-08Add draw_open_polygon() utilityMuriithi Frederick Muriuki
* wqflask/utility/pillow_utils.py: New method.
2020-08-08Use draw_rotated_text()Muriithi Frederick Muriuki
Use the new draw_rotated_text() function to draw the text rotated as was formerly done. * wqflask/utility/Plot.py (plotBar): Use draw_rotated_text(). * wqflask/wqflask/marker_regression/display_mapping_results.py: (DisplayMappingResults) Use draw_rotated_text().
2020-08-08Create new utility module for drawingMuriithi Frederick Muriuki
* wqflask/utility/pillow_utils.py: Create a module to hold some utility functions for drawing with Pillow. Initialise the module with a function to draw rotated text.
2020-08-08Fix font pathsMuriithi Frederick Muriuki
* wqflask/utility/Plot.py: Update font paths. * wqflask/fonts/ttf: Update font files.
2020-08-08Migrate code from Piddle to PillowMuriithi Frederick Muriuki
* wqflask/wqflask/marker_regression/display_mapping_results.py: Add font files (DisplayMappingResults): Update the code from the Piddle way of things to the Pillow way of things, for example, replace: - pid.drawRect(...) with im_drawer.rectangle(...) - pid.drawString(...) with im_drawer.text(...) - pid.drawPolygon(...) with im_drawer.polygon(...) etc. * wqflask/utility/Plot.py: Migrate code from the older, unsupported Piddle to the newer Pillow library.
2020-07-29Fixed error that occured for new resources in check_adminzsloan
* wqflask/utility/authentication_tools.py: the code forgot to get resource_info when a resource wasn't in Redis yet, causing an error when it was referenced, so I added a line getting the resource info (and also a couple comments for other lines related to authentication)
2020-07-25The variable is never defined, so let's default to "none"Pjotr Prins
2020-07-24Merge pull request #409 from BonfaceKilz/Build/add-testszsloan
Build/add tests
2020-07-24Revert "Add work-around for failed imports in unittest"BonfaceKilz
This reverts commit d5e87fa6fe7546b46790f512d984a5501223082f.
2020-07-24Add work-around for failed imports in unittestBonfaceKilz
* wqflask/utility/tools.py: Unittests will use `from wqflask.wqflask import app` and the gn2 script will use `from wqflask import app`
2020-07-24Apply autopep-8BonfaceKilz
* wqflask/utility/formatting.py: apply it
2020-07-24Add zero to num_repr dictionaryBonfaceKilz
* wqflask/utility/formatting.py(numify): Update `num_repr` to have a zero
2020-07-24Remove redundant variableBonfaceKilz
* wqflask/utility/corr_result_helpers.py(normalize_values_with_values): Remove `num_overlap`
2020-07-24Remove unused assertBonfaceKilz
* wqflask/utility/corr_result_helpers.py(normalize_values): At no one point will that assert be hit
2020-07-24Remove unused doc-testsBonfaceKilz
* wqflask/utility/corr_result_helpers.py: Delete doc-test
2020-07-24Simplify normalize_valuesBonfaceKilz
* wqflask/utility/corr_result_helpers.py(normalize_values): Replace loop with zip form
2020-07-24Remove unused doc-testsBonfaceKilz
* wqflask/utility/chunks.py: Remove test code from module
2020-07-24Revert "Add work-around for failed imports in unittest"BonfaceKilz
This reverts commit d5e87fa6fe7546b46790f512d984a5501223082f.
2020-07-24Add work-around for failed imports in unittestBonfaceKilz
* wqflask/utility/tools.py: Unittests will use `from wqflask.wqflask import app` and the gn2 script will use `from wqflask import app`
2020-07-22It should add new resources to Redis automatically nowzsloan
2020-07-16Expose elastic-search variables for tests to passBonfaceKilz
2020-07-08Removed remaining unused references to the old qtlreaperzsloan
2020-07-06Fixed some of the logic with how traits are authenticated to avoid situation ↵zsloan
where a trait is authenticated twice
2020-06-24Temporary partial fix to issue of resources without info; need to add ↵zsloan
something that automatically inserts resources with default privileges
2020-06-20Fixed ports for proxy (though I need to add the port to global variables) ↵zsloan
and also simplified the check_owner_or_admin function a little
2020-06-20Added some admin functionality and fixed issue with temp traitszsloan
2020-06-17A user's id is now set as a parameter if it doesn't already existauthentication_testzsloan
2020-06-17Adding all the authentication stuffzsloan