From 0872f8c462ba632eafa05dcb6b56edff8368f6ea Mon Sep 17 00:00:00 2001 From: BonfaceKilz Date: Tue, 14 Jul 2020 14:22:14 +0300 Subject: Remove stale comments --- test/requests/test-website.py | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'test') diff --git a/test/requests/test-website.py b/test/requests/test-website.py index b2e09bc4..74057e7f 100755 --- a/test/requests/test-website.py +++ b/test/requests/test-website.py @@ -104,16 +104,7 @@ parser.add_argument("-i", "--integration-tests", dest="accumulate" , action="store_const", const=integration_tests, default=print_help , help="Runs integration tests.") -# Navigation tests deactivated since system relies on Javascript -# parser.add_argument("-n", "--navigation", dest="accumulate" -# , action="store_const", const=check_navigation, default=print_help -# , help="Checks for navigation.") - -# parser.add_argument("-s", "--skip-broken", dest="accumulate" -# , action="store_const", const=dummy, default=print_help -# , help="Skip tests that are known to be broken.") - args = parser.parse_args() -# print("The arguments object: ", args) + args.accumulate(args, parser) -- cgit v1.2.3 From d9bd69a8bd2e92d4aac078d936917929f2e5ca8e Mon Sep 17 00:00:00 2001 From: BonfaceKilz Date: Thu, 16 Jul 2020 16:14:50 +0300 Subject: Check for specific text in response and then assert a 200 code "/show_trait?trait_id=1435395_s_at&dataset=HC_M2_0606_P" is missing in the response code. At one point the html structure changed. --- test/requests/main_web_functionality.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/requests/main_web_functionality.py b/test/requests/main_web_functionality.py index 7b89b833..d070dab9 100644 --- a/test/requests/main_web_functionality.py +++ b/test/requests/main_web_functionality.py @@ -20,8 +20,9 @@ def check_search_page(host): , search_terms_or="" , search_terms_and="MEAN=(15 16) LRS=(23 46)") result = requests.get(host+"/search", params=data) - found = result.text.find("/show_trait?trait_id=1435395_s_at&dataset=HC_M2_0606_P") + found = result.text.find("records are shown below") assert(found >= 0) + assert(result.status_code == 200) print("OK") check_traits_page(host, "/show_trait?trait_id=1435395_s_at&dataset=HC_M2_0606_P") -- cgit v1.2.3 From 704294fae6ea6a744006451eb1672dbb1645ff53 Mon Sep 17 00:00:00 2001 From: BonfaceKilz Date: Thu, 16 Jul 2020 16:17:01 +0300 Subject: Replace mapping endpoint to "/loading" At one point, "/marker_regression" got replaced, and the html structure changed. --- test/requests/mapping_tests.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'test') diff --git a/test/requests/mapping_tests.py b/test/requests/mapping_tests.py index 6de81bfe..5748a2a3 100644 --- a/test/requests/mapping_tests.py +++ b/test/requests/mapping_tests.py @@ -15,9 +15,9 @@ def check_R_qtl_tool_selection(host, data): print("") print("R/qtl mapping tool selection") headers = {"Content-Type": "application/x-www-form-urlencoded"} - page = requests.post(host+"/marker_regression", data=data, headers=headers) + page = requests.post(host+"/loading", data=data, headers=headers) doc = fromstring(page.text) - form = doc.forms[1] + form = doc.forms[0] assert form.fields["dataset"] == "HC_M2_0606_P" assert form.fields["value:BXD1"] == "15.034" @@ -25,9 +25,9 @@ def check_CIM_tool_selection(host, data): print("") print("CIM mapping tool selection (using reaper)") data["method"] = "reaper" - page = requests.post(host+"/marker_regression", data=data) + page = requests.post(host+"/loading", data=data) doc = fromstring(page.text) - form = doc.forms[1] + form = doc.forms[0] assert form.fields["dataset"] == "HC_M2_0606_P" assert form.fields["value:BXD1"] == "15.034" @@ -37,6 +37,6 @@ def check_mapping(args_obj, parser): host = args_obj.host data = load_data_from_file() - check_pylmm_tool_selection(host, copy.deepcopy(data)) - check_R_qtl_tool_selection(host, copy.deepcopy(data)) ## Why does this fail? + # check_pylmm_tool_selection(host, copy.deepcopy(data)) ## Not defined + check_R_qtl_tool_selection(host, copy.deepcopy(data)) check_CIM_tool_selection(host, copy.deepcopy(data)) -- cgit v1.2.3 From 82929468a0769766cc874b18dbbf5acaa15bc6fc Mon Sep 17 00:00:00 2001 From: BonfaceKilz Date: Thu, 16 Jul 2020 17:32:13 +0300 Subject: Remove unused test --- test/unittest/test_registration.py | 27 --------------------------- 1 file changed, 27 deletions(-) delete mode 100644 test/unittest/test_registration.py (limited to 'test') diff --git a/test/unittest/test_registration.py b/test/unittest/test_registration.py deleted file mode 100644 index 98d0cdff..00000000 --- a/test/unittest/test_registration.py +++ /dev/null @@ -1,27 +0,0 @@ -# Run test with something like -# -# env GN2_PROFILE=~/opt/gn-latest GENENETWORK_FILES=$HOME/gn2_data ./bin/genenetwork2 ./etc/default_settings.py -c ../test/unittest/test_registration.py -# - -import unittest -import mock.es_double as es -from wqflask.user_manager import RegisterUser - -class TestRegisterUser(unittest.TestCase): - def setUp(self): - self.es = es.ESDouble() - - def testRegisterUserWithCorrectData(self): - data = { - "email_address": "user@example.com" - , "full_name": "A.N. Other" - , "organization": "Some Organisation" - , "password": "testing" - , "password_confirm": "testing" - , "es_connection": self.es - } - result = RegisterUser(data) - self.assertEqual(len(result.errors), 0, "Errors were not expected") - -if __name__ == "__main__": - unittest.main() -- cgit v1.2.3 From 64c0c61ee3842ea63921ebb73827333d91cf99cc Mon Sep 17 00:00:00 2001 From: BonfaceKilz Date: Fri, 17 Jul 2020 02:47:31 +0300 Subject: Add basic unittests --- test/unittest/__init__.py | 0 test/unittest/base/__init__.py | 0 test/unittest/base/test_data_set.py | 8 ++++++++ test/unittest/base/test_general_object.py | 21 +++++++++++++++++++++ 4 files changed, 29 insertions(+) create mode 100644 test/unittest/__init__.py create mode 100644 test/unittest/base/__init__.py create mode 100644 test/unittest/base/test_data_set.py create mode 100644 test/unittest/base/test_general_object.py (limited to 'test') diff --git a/test/unittest/__init__.py b/test/unittest/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/test/unittest/base/__init__.py b/test/unittest/base/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/test/unittest/base/test_data_set.py b/test/unittest/base/test_data_set.py new file mode 100644 index 00000000..6537efa6 --- /dev/null +++ b/test/unittest/base/test_data_set.py @@ -0,0 +1,8 @@ +import unittest + +import wqflask.base.data_set +print dir() + +class TestDataSet(unittest.TestCase): + def test_add(self): + self.assertEqual(3, 4) diff --git a/test/unittest/base/test_general_object.py b/test/unittest/base/test_general_object.py new file mode 100644 index 00000000..eaefdec9 --- /dev/null +++ b/test/unittest/base/test_general_object.py @@ -0,0 +1,21 @@ +import unittest + +from wqflask.base.GeneralObject import GeneralObject + + +class TestGeneralObjectTests(unittest.TestCase): + """ + Test the GeneralObject base class + """ + + def test_object_contents(self): + """Test whether base contents are stored properly""" + test_obj = GeneralObject("a", "b", "c") + self.assertEqual("abc", ''.join(test_obj.contents)) + + def test_object_dict(self): + """Test whether the base class is printed properly""" + test_obj = GeneralObject("a", name="test", value=1) + self.assertEqual(str(test_obj), "value = 1\nname = test\n") + self.assertEqual( + repr(test_obj), "value = 1\nname = test\ncontents = ['a']\n") -- cgit v1.2.3 From 244761531dd6f4f019add26d837b6b79530e0f17 Mon Sep 17 00:00:00 2001 From: BonfaceKilz Date: Tue, 21 Jul 2020 12:42:52 +0300 Subject: Make test file a module * test/__init__.py: Add it. Makes the test folder discoverable by unittest --- test/__init__.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 test/__init__.py (limited to 'test') diff --git a/test/__init__.py b/test/__init__.py new file mode 100644 index 00000000..e69de29b -- cgit v1.2.3 From 3d6483e8fd59d2e77149aa5d78ec32448be7338c Mon Sep 17 00:00:00 2001 From: BonfaceKilz Date: Tue, 21 Jul 2020 22:46:49 +0300 Subject: Move tests to module * test/unittest/: Move to wqflask/tests/ --- test/unittest/__init__.py | 0 test/unittest/base/__init__.py | 0 test/unittest/base/test_data_set.py | 8 -------- test/unittest/base/test_general_object.py | 21 --------------------- wqflask/tests/__init__.py | 0 wqflask/tests/base/__init__.py | 0 wqflask/tests/base/test_general_object.py | 21 +++++++++++++++++++++ 7 files changed, 21 insertions(+), 29 deletions(-) delete mode 100644 test/unittest/__init__.py delete mode 100644 test/unittest/base/__init__.py delete mode 100644 test/unittest/base/test_data_set.py delete mode 100644 test/unittest/base/test_general_object.py create mode 100644 wqflask/tests/__init__.py create mode 100644 wqflask/tests/base/__init__.py create mode 100644 wqflask/tests/base/test_general_object.py (limited to 'test') diff --git a/test/unittest/__init__.py b/test/unittest/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/test/unittest/base/__init__.py b/test/unittest/base/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/test/unittest/base/test_data_set.py b/test/unittest/base/test_data_set.py deleted file mode 100644 index 6537efa6..00000000 --- a/test/unittest/base/test_data_set.py +++ /dev/null @@ -1,8 +0,0 @@ -import unittest - -import wqflask.base.data_set -print dir() - -class TestDataSet(unittest.TestCase): - def test_add(self): - self.assertEqual(3, 4) diff --git a/test/unittest/base/test_general_object.py b/test/unittest/base/test_general_object.py deleted file mode 100644 index eaefdec9..00000000 --- a/test/unittest/base/test_general_object.py +++ /dev/null @@ -1,21 +0,0 @@ -import unittest - -from wqflask.base.GeneralObject import GeneralObject - - -class TestGeneralObjectTests(unittest.TestCase): - """ - Test the GeneralObject base class - """ - - def test_object_contents(self): - """Test whether base contents are stored properly""" - test_obj = GeneralObject("a", "b", "c") - self.assertEqual("abc", ''.join(test_obj.contents)) - - def test_object_dict(self): - """Test whether the base class is printed properly""" - test_obj = GeneralObject("a", name="test", value=1) - self.assertEqual(str(test_obj), "value = 1\nname = test\n") - self.assertEqual( - repr(test_obj), "value = 1\nname = test\ncontents = ['a']\n") diff --git a/wqflask/tests/__init__.py b/wqflask/tests/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/wqflask/tests/base/__init__.py b/wqflask/tests/base/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/wqflask/tests/base/test_general_object.py b/wqflask/tests/base/test_general_object.py new file mode 100644 index 00000000..699cb079 --- /dev/null +++ b/wqflask/tests/base/test_general_object.py @@ -0,0 +1,21 @@ +import unittest + +from base.GeneralObject import GeneralObject + + +class TestGeneralObjectTests(unittest.TestCase): + """ + Test the GeneralObject base class + """ + + def test_object_contents(self): + """Test whether base contents are stored properly""" + test_obj = GeneralObject("a", "b", "c") + self.assertEqual("abc", ''.join(test_obj.contents)) + + def test_object_dict(self): + """Test whether the base class is printed properly""" + test_obj = GeneralObject("a", name="test", value=1) + self.assertEqual(str(test_obj), "value = 1\nname = test\n") + self.assertEqual( + repr(test_obj), "value = 1\nname = test\ncontents = ['a']\n") -- cgit v1.2.3 From 8e3756b8b8094c5d025da31c54c1d0d95a55b0dc Mon Sep 17 00:00:00 2001 From: BonfaceKilz Date: Fri, 17 Jul 2020 02:47:31 +0300 Subject: Add basic unittests --- test/unittest/__init__.py | 0 test/unittest/base/__init__.py | 0 test/unittest/base/test_general_object.py | 21 +++++++++++++++++++++ 3 files changed, 21 insertions(+) create mode 100644 test/unittest/__init__.py create mode 100644 test/unittest/base/__init__.py create mode 100644 test/unittest/base/test_general_object.py (limited to 'test') diff --git a/test/unittest/__init__.py b/test/unittest/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/test/unittest/base/__init__.py b/test/unittest/base/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/test/unittest/base/test_general_object.py b/test/unittest/base/test_general_object.py new file mode 100644 index 00000000..eaefdec9 --- /dev/null +++ b/test/unittest/base/test_general_object.py @@ -0,0 +1,21 @@ +import unittest + +from wqflask.base.GeneralObject import GeneralObject + + +class TestGeneralObjectTests(unittest.TestCase): + """ + Test the GeneralObject base class + """ + + def test_object_contents(self): + """Test whether base contents are stored properly""" + test_obj = GeneralObject("a", "b", "c") + self.assertEqual("abc", ''.join(test_obj.contents)) + + def test_object_dict(self): + """Test whether the base class is printed properly""" + test_obj = GeneralObject("a", name="test", value=1) + self.assertEqual(str(test_obj), "value = 1\nname = test\n") + self.assertEqual( + repr(test_obj), "value = 1\nname = test\ncontents = ['a']\n") -- cgit v1.2.3 From 5eb26c5a209f3a3c54cf6fe623e5372188bdd1bc Mon Sep 17 00:00:00 2001 From: BonfaceKilz Date: Sat, 25 Jul 2020 00:59:46 +0300 Subject: Update import statement in test_general_object.py * test/unittest/base/test_general_object.py: replace the import statement to use the module path instead of the path referenced from PYTHONPATH --- test/unittest/base/test_general_object.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test') diff --git a/test/unittest/base/test_general_object.py b/test/unittest/base/test_general_object.py index eaefdec9..699cb079 100644 --- a/test/unittest/base/test_general_object.py +++ b/test/unittest/base/test_general_object.py @@ -1,6 +1,6 @@ import unittest -from wqflask.base.GeneralObject import GeneralObject +from base.GeneralObject import GeneralObject class TestGeneralObjectTests(unittest.TestCase): -- cgit v1.2.3 From 5a63137af7e383bbae867c4385c42cacf0d78b8e Mon Sep 17 00:00:00 2001 From: BonfaceKilz Date: Sun, 26 Jul 2020 23:04:29 +0300 Subject: Delete tests/unittests folder * tests/unittests: Delete it. All unittests were moved to wqflask/tests in 3d6483e8 --- test/unittest/__init__.py | 0 test/unittest/base/__init__.py | 0 test/unittest/base/test_general_object.py | 21 --------------------- 3 files changed, 21 deletions(-) delete mode 100644 test/unittest/__init__.py delete mode 100644 test/unittest/base/__init__.py delete mode 100644 test/unittest/base/test_general_object.py (limited to 'test') diff --git a/test/unittest/__init__.py b/test/unittest/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/test/unittest/base/__init__.py b/test/unittest/base/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/test/unittest/base/test_general_object.py b/test/unittest/base/test_general_object.py deleted file mode 100644 index 699cb079..00000000 --- a/test/unittest/base/test_general_object.py +++ /dev/null @@ -1,21 +0,0 @@ -import unittest - -from base.GeneralObject import GeneralObject - - -class TestGeneralObjectTests(unittest.TestCase): - """ - Test the GeneralObject base class - """ - - def test_object_contents(self): - """Test whether base contents are stored properly""" - test_obj = GeneralObject("a", "b", "c") - self.assertEqual("abc", ''.join(test_obj.contents)) - - def test_object_dict(self): - """Test whether the base class is printed properly""" - test_obj = GeneralObject("a", name="test", value=1) - self.assertEqual(str(test_obj), "value = 1\nname = test\n") - self.assertEqual( - repr(test_obj), "value = 1\nname = test\ncontents = ['a']\n") -- cgit v1.2.3 From 06edbb8455f1e85a3818c33c4ef4d42e6a061d43 Mon Sep 17 00:00:00 2001 From: BonfaceKilz Date: Wed, 19 Aug 2020 02:00:11 +0300 Subject: Wrap `map()` in a `list` call Run `2to3-3.8 -f map -w .` See: --- scripts/maintenance/QTL_Reaper_v6.py | 2 +- scripts/maintenance/readProbeSetMean_v7.py | 16 ++++++++-------- scripts/maintenance/readProbeSetSE_v7.py | 16 ++++++++-------- test/requests/link_checker.py | 3 +-- wqflask/utility/webqtlUtil.py | 2 +- wqflask/wqflask/api/router.py | 2 +- wqflask/wqflask/correlation_matrix/show_corr_matrix.py | 4 ++-- wqflask/wqflask/export_traits.py | 2 +- wqflask/wqflask/interval_analyst/GeneUtil.py | 2 +- .../wqflask/marker_regression/display_mapping_results.py | 10 +++++----- wqflask/wqflask/marker_regression/plink_mapping.py | 4 ++-- wqflask/wqflask/pbkdf2.py | 2 +- wqflask/wqflask/snp_browser/snp_browser.py | 6 +++--- 13 files changed, 35 insertions(+), 36 deletions(-) (limited to 'test') diff --git a/scripts/maintenance/QTL_Reaper_v6.py b/scripts/maintenance/QTL_Reaper_v6.py index 7fb56eca..2fbeb53b 100755 --- a/scripts/maintenance/QTL_Reaper_v6.py +++ b/scripts/maintenance/QTL_Reaper_v6.py @@ -23,7 +23,7 @@ for item in results: ProbeSetFreezeIds=sys.argv[1:] if ProbeSetFreezeIds: #####convert the Ids to integer - ProbeSetFreezeIds=map(int, ProbeSetFreezeIds) + ProbeSetFreezeIds=list(map(int, ProbeSetFreezeIds)) else: #####get all of the dataset that need be updated diff --git a/scripts/maintenance/readProbeSetMean_v7.py b/scripts/maintenance/readProbeSetMean_v7.py index fea26731..97767715 100755 --- a/scripts/maintenance/readProbeSetMean_v7.py +++ b/scripts/maintenance/readProbeSetMean_v7.py @@ -61,14 +61,14 @@ GeneList = [] isCont = 1 header = fp.readline() header = string.split(string.strip(header),'\t') -header = map(string.strip, header) +header = list(map(string.strip, header)) nfield = len(header) line = fp.readline() kj=0 while line: line2 = string.split(string.strip(line),'\t') - line2 = map(string.strip, line2) + line2 = list(map(string.strip, line2)) if len(line2) != nfield: print(("Error : " + line)) isCont = 0 @@ -80,7 +80,7 @@ while line: if kj%100000 == 0: print(('checked ',kj,' lines')) -GeneList = map(string.lower, GeneList) +GeneList = list(map(string.lower, GeneList)) GeneList.sort() if isCont==0: @@ -100,8 +100,8 @@ isCont = 1 fp.seek(0) header = fp.readline() header = string.split(string.strip(header),'\t') -header = map(string.strip, header) -header = map(translateAlias, header) +header = list(map(string.strip, header)) +header = list(map(translateAlias, header)) header = header[dataStart:] Ids = [] for item in header: @@ -128,7 +128,7 @@ print('Check if each ProbeSet exist in database') line = fp.readline() line = fp.readline() line2 = string.split(string.strip(line),'\t') -line2 = map(string.strip, line2) +line2 = list(map(string.strip, line2)) PId = line2[0] db.execute('select Id from ProbeSet where Name="%s" and ChipId=%d' % (PId, GeneChipId) ) @@ -148,7 +148,7 @@ for item in results: print(Names) -Names = map(string.lower, Names) +Names = list(map(string.lower, Names)) Names.sort() # -- Fixed the lower case problem of ProbeSets affx-mur_b2_at doesn't exist --# @@ -223,7 +223,7 @@ values1 = [] values2 = [] while line: line2 = string.split(string.strip(line),'\t') - line2 = map(string.strip, line2) + line2 = list(map(string.strip, line2)) PId = line2[0] recordId = NameIds[PId] diff --git a/scripts/maintenance/readProbeSetSE_v7.py b/scripts/maintenance/readProbeSetSE_v7.py index 79ed455f..7b2fee87 100755 --- a/scripts/maintenance/readProbeSetSE_v7.py +++ b/scripts/maintenance/readProbeSetSE_v7.py @@ -72,14 +72,14 @@ GeneList = [] isCont = 1 header = fp.readline() header = string.split(string.strip(header), '\t') -header = map(string.strip, header) +header = list(map(string.strip, header)) nfield = len(header) line = fp.readline() kj = 0 while line: line2 = string.split(string.strip(line), '\t') - line2 = map(string.strip, line2) + line2 = list(map(string.strip, line2)) if len(line2) != nfield: isCont = 0 print(("Error : " + line)) @@ -91,7 +91,7 @@ while line: if kj % 100000 == 0: print(('checked ', kj, ' lines')) -GeneList = map(string.lower, GeneList) +GeneList = list(map(string.lower, GeneList)) GeneList.sort() if isCont == 0: @@ -111,8 +111,8 @@ isCont = 1 fp.seek(0) header = fp.readline() header = string.split(string.strip(header), '\t') -header = map(string.strip, header) -header = map(translateAlias, header) +header = list(map(string.strip, header)) +header = list(map(translateAlias, header)) header = header[dataStart:] Ids = [] for item in header: @@ -139,7 +139,7 @@ print('Check if each ProbeSet exist in database') line = fp.readline() line = fp.readline() line2 = string.split(string.strip(line), '\t') -line2 = map(string.strip, line2) +line2 = list(map(string.strip, line2)) PId = line2[0] db.execute('select Id from ProbeSet where Name="%s" and ChipId=%d' % @@ -158,7 +158,7 @@ results = db.fetchall() Names = [] for item in results: Names.append(item[0]) - Names = map(string.lower, Names) + Names = list(map(string.lower, Names)) Names.sort() # -- Fixed the lower case problem of ProbeSets affx-mur_b2_at doesn't exist --# ##---- compare genelist with names ----## @@ -220,7 +220,7 @@ line = fp.readline() kj = 0 while line: line2 = string.split(string.strip(line), '\t') - line2 = map(string.strip, line2) + line2 = list(map(string.strip, line2)) CellId = line2[0] if not ProbeNameId.has_key(CellId): diff --git a/test/requests/link_checker.py b/test/requests/link_checker.py index 715f330c..df4d32d8 100644 --- a/test/requests/link_checker.py +++ b/test/requests/link_checker.py @@ -27,8 +27,7 @@ def get_links(doc): lambda x: not ( is_root_link(x) or is_mailto_link(x)) - , map(lambda y: y.get("href") - , doc.cssselect("a"))) + , [y.get("href") for y in doc.cssselect("a")]) def verify_link(link): if link[0] == "#": diff --git a/wqflask/utility/webqtlUtil.py b/wqflask/utility/webqtlUtil.py index 53661ae4..79991149 100644 --- a/wqflask/utility/webqtlUtil.py +++ b/wqflask/utility/webqtlUtil.py @@ -107,7 +107,7 @@ def hasAccessToConfidentialPhenotypeTrait(privilege, userName, authorized_users) if webqtlConfig.USERDICT[privilege] > webqtlConfig.USERDICT['user']: access_to_confidential_phenotype_trait = 1 else: - AuthorizedUsersList=map(string.strip, string.split(authorized_users, ',')) + AuthorizedUsersList=list(map(string.strip, string.split(authorized_users, ','))) if AuthorizedUsersList.__contains__(userName): access_to_confidential_phenotype_trait = 1 return access_to_confidential_phenotype_trait \ No newline at end of file diff --git a/wqflask/wqflask/api/router.py b/wqflask/wqflask/api/router.py index 6324cabe..3fa1d5ba 100644 --- a/wqflask/wqflask/api/router.py +++ b/wqflask/wqflask/api/router.py @@ -517,7 +517,7 @@ def all_sample_data(dataset_name, file_format = "csv"): line_list.append("x") results_list.append(line_list) - results_list = map(list, zip(*results_list)) + results_list = list(map(list, zip(*results_list))) si = StringIO.StringIO() csv_writer = csv.writer(si) diff --git a/wqflask/wqflask/correlation_matrix/show_corr_matrix.py b/wqflask/wqflask/correlation_matrix/show_corr_matrix.py index 0ac94139..a912344f 100644 --- a/wqflask/wqflask/correlation_matrix/show_corr_matrix.py +++ b/wqflask/wqflask/correlation_matrix/show_corr_matrix.py @@ -278,7 +278,7 @@ def zScore(trait_data_array): stdev = math.sqrt(var/(N-1)) if stdev == 0: stdev = 1e-100 - data2 = map(lambda x:(x-mean)/stdev,data) + data2 = [(x-mean)/stdev for x in data] trait_data_array[i] = data2 i += 1 return trait_data_array @@ -299,7 +299,7 @@ def sortEigenVectors(vector): A.append(item[0]) B.append(item[1]) sum = reduce(lambda x,y: x+y, A, 0.0) - A = map(lambda x:x*100.0/sum, A) + A = [x*100.0/sum for x in A] return [A, B] except: return [] \ No newline at end of file diff --git a/wqflask/wqflask/export_traits.py b/wqflask/wqflask/export_traits.py index 3272c03d..6646cc36 100644 --- a/wqflask/wqflask/export_traits.py +++ b/wqflask/wqflask/export_traits.py @@ -122,7 +122,7 @@ def export_search_results_csv(targs): csv_rows.append(row_contents) - csv_rows = map(list, itertools.izip_longest(*[row for row in csv_rows])) + csv_rows = list(map(list, itertools.izip_longest(*[row for row in csv_rows]))) writer.writerows(csv_rows) csv_data = buff.getvalue() buff.close() diff --git a/wqflask/wqflask/interval_analyst/GeneUtil.py b/wqflask/wqflask/interval_analyst/GeneUtil.py index 2c60dd70..273168a8 100644 --- a/wqflask/wqflask/interval_analyst/GeneUtil.py +++ b/wqflask/wqflask/interval_analyst/GeneUtil.py @@ -24,7 +24,7 @@ def loadGenes(chrName, diffCol, startMb, endMb, species='mouse'): ##List current Species and other Species speciesId = speciesDict[species] - otherSpecies = map(lambda X: [X, speciesDict[X]], speciesDict.keys()) + otherSpecies = [[X, speciesDict[X]] for X in speciesDict.keys()] otherSpecies.remove([species, speciesId]) results = g.db.execute(""" diff --git a/wqflask/wqflask/marker_regression/display_mapping_results.py b/wqflask/wqflask/marker_regression/display_mapping_results.py index bda899fb..7b6e70d2 100644 --- a/wqflask/wqflask/marker_regression/display_mapping_results.py +++ b/wqflask/wqflask/marker_regression/display_mapping_results.py @@ -389,9 +389,9 @@ class DisplayMappingResults(object): Chr_Length.Name in (%s) Order by Chr_Length.OrderId - """ % (self.dataset.group.name, string.join(map(lambda X: "'%s'" % X[0], self.ChrList[1:]), ", "))) + """ % (self.dataset.group.name, string.join(["'%s'" % X[0] for X in self.ChrList[1:]], ", "))) - self.ChrLengthMbList = map(lambda x: x[0]/1000000.0, self.ChrLengthMbList) + self.ChrLengthMbList = [x[0]/1000000.0 for x in self.ChrLengthMbList] self.ChrLengthMbSum = reduce(lambda x, y:x+y, self.ChrLengthMbList, 0.0) if self.ChrLengthMbList: self.MbGraphInterval = self.ChrLengthMbSum/(len(self.ChrLengthMbList)*12) #Empirical Mb interval @@ -1147,8 +1147,8 @@ class DisplayMappingResults(object): tenPercentLength = geneLength*0.0001 SNPdensity = theGO["snpCount"]/geneLength - exonStarts = map(float, theGO['exonStarts'].split(",")[:-1]) - exonEnds = map(float, theGO['exonEnds'].split(",")[:-1]) + exonStarts = list(map(float, theGO['exonStarts'].split(",")[:-1])) + exonEnds = list(map(float, theGO['exonEnds'].split(",")[:-1])) cdsStart = theGO['cdsStart'] cdsEnd = theGO['cdsEnd'] accession = theGO['NM_ID'] @@ -2145,7 +2145,7 @@ class DisplayMappingResults(object): lrsEdgeWidth = 1 else: if self.additiveChecked: - additiveMax = max(map(lambda X : abs(X['additive']), self.qtlresults)) + additiveMax = max([abs(X['additive']) for X in self.qtlresults]) lrsEdgeWidth = 3 if zoom == 2: diff --git a/wqflask/wqflask/marker_regression/plink_mapping.py b/wqflask/wqflask/marker_regression/plink_mapping.py index 2f327faf..9571015e 100644 --- a/wqflask/wqflask/marker_regression/plink_mapping.py +++ b/wqflask/wqflask/marker_regression/plink_mapping.py @@ -84,7 +84,7 @@ def get_samples_from_ped_file(dataset): while line: lineList = string.split(string.strip(line), '\t') - lineList = map(string.strip, lineList) + lineList = list(map(string.strip, lineList)) sample_name = lineList[0] sample_list.append(sample_name) @@ -157,6 +157,6 @@ def parse_plink_output(output_filename, species): def build_line_list(line=None): line_list = string.split(string.strip(line),' ')# irregular number of whitespaces between columns line_list = [item for item in line_list if item <>''] - line_list = map(string.strip, line_list) + line_list = list(map(string.strip, line_list)) return line_list \ No newline at end of file diff --git a/wqflask/wqflask/pbkdf2.py b/wqflask/wqflask/pbkdf2.py index 811c83b0..731c8843 100644 --- a/wqflask/wqflask/pbkdf2.py +++ b/wqflask/wqflask/pbkdf2.py @@ -66,7 +66,7 @@ def pbkdf2_bin(data, salt, iterations=1000, keylen=24, hashfunc=None): def _pseudorandom(x, mac=mac): h = mac.copy() h.update(x) - return map(ord, h.digest()) + return list(map(ord, h.digest())) buf = [] for block in xrange(1, -(-keylen // mac.digest_size) + 1): rv = u = _pseudorandom(salt + _pack_int(block)) diff --git a/wqflask/wqflask/snp_browser/snp_browser.py b/wqflask/wqflask/snp_browser/snp_browser.py index 1d28d76a..b18bfc62 100644 --- a/wqflask/wqflask/snp_browser/snp_browser.py +++ b/wqflask/wqflask/snp_browser/snp_browser.py @@ -459,7 +459,7 @@ class SnpBrowser(object): function_list = [] if function_details: function_list = string.split(string.strip(function_details), ",") - function_list = map(string.strip, function_list) + function_list = list(map(string.strip, function_list)) function_list[0] = function_list[0].title() function_details = ", ".join(item for item in function_list) function_details = function_details.replace("_", " ") @@ -725,11 +725,11 @@ def get_effect_details_by_category(effect_name = None, effect_value = None): codon_effect_group_list = ['Start Lost', 'Stop Gained', 'Stop Lost', 'Nonsynonymous', 'Synonymous'] effect_detail_list = string.split(string.strip(effect_value), '|') - effect_detail_list = map(string.strip, effect_detail_list) + effect_detail_list = list(map(string.strip, effect_detail_list)) for index, item in enumerate(effect_detail_list): item_list = string.split(string.strip(item), ',') - item_list = map(string.strip, item_list) + item_list = list(map(string.strip, item_list)) gene_id = item_list[0] gene_name = item_list[1] -- cgit v1.2.3 From 28e75b1c96819eab1e8052a3045ece26e5f35c42 Mon Sep 17 00:00:00 2001 From: BonfaceKilz Date: Wed, 19 Aug 2020 02:38:15 +0300 Subject: Wrap `filter()` usage in a `list` call Run `2to3-3.8 -f filter -w .` See --- test/requests/link_checker.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'test') diff --git a/test/requests/link_checker.py b/test/requests/link_checker.py index df4d32d8..fa70747d 100644 --- a/test/requests/link_checker.py +++ b/test/requests/link_checker.py @@ -23,11 +23,9 @@ def is_in_page_link(link): return pattern.match(link) def get_links(doc): - return filter( - lambda x: not ( + return [x for x in [y.get("href") for y in doc.cssselect("a")] if not ( is_root_link(x) - or is_mailto_link(x)) - , [y.get("href") for y in doc.cssselect("a")]) + or is_mailto_link(x))] def verify_link(link): if link[0] == "#": @@ -56,9 +54,9 @@ def check_page(host, start_url): print("Checking links host "+host+" in page `"+start_url+"`") doc = parse(start_url).getroot() links = get_links(doc) - in_page_links = filter(is_in_page_link, links) - internal_links = filter(is_internal_link, links) - external_links = filter(lambda x: not (is_internal_link(x) or is_in_page_link(x)), links) + in_page_links = list(filter(is_in_page_link, links)) + internal_links = list(filter(is_internal_link, links)) + external_links = [x for x in links if not (is_internal_link(x) or is_in_page_link(x))] for link in internal_links: verify_link(host+link) -- cgit v1.2.3 From 81c720fe8fa424ab21aab63363228fd60f4a52b7 Mon Sep 17 00:00:00 2001 From: BonfaceKilz Date: Thu, 20 Aug 2020 14:44:27 +0300 Subject: Check the availability of datatables extension files from guix * test/requests/link_checker.py (check_packaged_js_files): Add it. * test/requests/test-website.py: Use above method. --- test/requests/link_checker.py | 21 +++++++++++++++++++++ test/requests/test-website.py | 2 ++ 2 files changed, 23 insertions(+) (limited to 'test') diff --git a/test/requests/link_checker.py b/test/requests/link_checker.py index 715f330c..0e333f43 100644 --- a/test/requests/link_checker.py +++ b/test/requests/link_checker.py @@ -79,3 +79,24 @@ def check_links(args_obj, parser): check_page( host, host+"/show_trait?trait_id=1435395_s_at&dataset=HC_M2_0606_P") + + +def check_packaged_js_files(args_obj, parser): + host = args_obj.host + js_files = [ + # Datatables Extensions: + "/DataTablesExtensions/buttonsBootstrap/css/buttons.bootstrap.css", + "/DataTablesExtensions/buttons/js/dataTables.buttons.min.js", + "/DataTablesExtensions/buttonStyles/css/buttons.dataTables.min.css", + "/DataTablesExtensions/buttons/js/dataTables.buttons.min.js", + "/DataTablesExtensions/plugins/sorting/natural.js", + "/DataTablesExtensions/colResize/dataTables.colResize.js", + "/DataTablesExtensions/colReorder/js/dataTables.colReorder.js", + "/DataTablesExtensions/buttons/js/buttons.colVis.min.js", + "/DataTables/js/jquery.dataTables.js", + "/DataTablesExtensions/scroller/css/scroller.dataTables.min.css", + ] + + print("Checking links") + for link in js_files: + verify_link(host+link) diff --git a/test/requests/test-website.py b/test/requests/test-website.py index 74057e7f..f90d1843 100755 --- a/test/requests/test-website.py +++ b/test/requests/test-website.py @@ -6,6 +6,7 @@ from __future__ import print_function import argparse from link_checker import check_links +from link_checker import check_packaged_js_files from mapping_tests import check_mapping from navigation_tests import check_navigation from main_web_functionality import check_main_web_functionality @@ -30,6 +31,7 @@ def run_all(args_obj, parser): link_checker.DO_FAIL = args_obj.fail check_main_web_functionality(args_obj, parser) check_links(args_obj, parser) + check_packaged_js_files(args_obj, parser) check_mapping(args_obj, parser) # TODO: Add other functions as they are created. -- cgit v1.2.3 From 1bd50f33e351f4e71736406e5c3846fe10f2226c Mon Sep 17 00:00:00 2001 From: BonfaceKilz Date: Mon, 24 Aug 2020 23:52:17 +0300 Subject: Add check for "natural.js" in Mechanical Rob * test/requests/link_checker.py (check_packaged_file): Add it. --- test/requests/link_checker.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'test') diff --git a/test/requests/link_checker.py b/test/requests/link_checker.py index 0e333f43..f9f85793 100644 --- a/test/requests/link_checker.py +++ b/test/requests/link_checker.py @@ -95,6 +95,8 @@ def check_packaged_js_files(args_obj, parser): "/DataTablesExtensions/buttons/js/buttons.colVis.min.js", "/DataTables/js/jquery.dataTables.js", "/DataTablesExtensions/scroller/css/scroller.dataTables.min.css", + # natural.js [Datatables plugin] + "/DataTablesExtensions/plugins/sorting/natural.js", ] print("Checking links") -- cgit v1.2.3 From cddb7b32e31e1750191f5146836b5026b68f2bf9 Mon Sep 17 00:00:00 2001 From: BonfaceKilz Date: Wed, 26 Aug 2020 00:16:53 +0300 Subject: Add check for "scientific.js" dataTables extension plugin * test/requests/link_checker.py (check_packaged_file): Add it. --- test/requests/link_checker.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test') diff --git a/test/requests/link_checker.py b/test/requests/link_checker.py index f9f85793..12057203 100644 --- a/test/requests/link_checker.py +++ b/test/requests/link_checker.py @@ -89,14 +89,14 @@ def check_packaged_js_files(args_obj, parser): "/DataTablesExtensions/buttons/js/dataTables.buttons.min.js", "/DataTablesExtensions/buttonStyles/css/buttons.dataTables.min.css", "/DataTablesExtensions/buttons/js/dataTables.buttons.min.js", - "/DataTablesExtensions/plugins/sorting/natural.js", "/DataTablesExtensions/colResize/dataTables.colResize.js", "/DataTablesExtensions/colReorder/js/dataTables.colReorder.js", "/DataTablesExtensions/buttons/js/buttons.colVis.min.js", "/DataTables/js/jquery.dataTables.js", "/DataTablesExtensions/scroller/css/scroller.dataTables.min.css", - # natural.js [Datatables plugin] + # Datatables plugins: "/DataTablesExtensions/plugins/sorting/natural.js", + "/DataTablesExtensions/plugins/sorting/scientific.js", ] print("Checking links") -- cgit v1.2.3 From 303e4b71c2172da5be19c84d4be5a062329ac013 Mon Sep 17 00:00:00 2001 From: BonfaceKilz Date: Wed, 26 Aug 2020 19:12:33 +0300 Subject: Remove "from __future__ import new_feature" statements See: --- test/requests/link_checker.py | 1 - test/requests/main_web_functionality.py | 22 ++++++++++++---------- test/requests/mapping_tests.py | 1 - test/requests/navigation_tests.py | 1 - test/requests/test-website.py | 2 +- webtests/browser_run.py | 4 +--- webtests/correlation_matrix_test.py | 2 -- webtests/correlation_test.py | 2 -- webtests/marker_regression_test.py | 2 -- webtests/show_trait_js_test.py | 2 -- webtests/test_runner.py | 4 +--- wqflask/base/data_set.py | 1 - wqflask/base/mrna_assay_tissue_data.py | 4 +--- wqflask/base/species.py | 4 +--- wqflask/base/trait.py | 2 -- wqflask/maintenance/convert_dryad_to_bimbam.py | 3 +-- wqflask/maintenance/convert_geno_to_bimbam.py | 3 +-- wqflask/maintenance/gen_select_dataset.py | 10 +--------- .../maintenance/generate_kinship_from_bimbam.py | 3 +-- .../maintenance/generate_probesetfreeze_file.py | 2 -- wqflask/maintenance/geno_to_json.py | 3 +-- wqflask/maintenance/get_group_samplelists.py | 2 -- wqflask/maintenance/print_benchmark.py | 4 +--- wqflask/maintenance/quantile_normalize.py | 7 +------ wqflask/maintenance/set_resource_defaults.py | 4 +--- wqflask/utility/Plot.py | 2 -- wqflask/utility/after.py | 4 +--- wqflask/utility/authentication_tools.py | 2 -- wqflask/utility/benchmark.py | 2 -- wqflask/utility/chunks.py | 2 -- wqflask/utility/db_tools.py | 2 -- wqflask/utility/gen_geno_ob.py | 4 +--- wqflask/utility/genofile_parser.py | 1 - wqflask/utility/helper_functions.py | 2 -- wqflask/utility/hmac.py | 4 +--- wqflask/utility/redis_tools.py | 4 +--- wqflask/utility/temp_data.py | 1 - wqflask/wqflask/__init__.py | 2 -- wqflask/wqflask/api/correlation.py | 4 +--- wqflask/wqflask/api/gen_menu.py | 2 -- wqflask/wqflask/api/mapping.py | 2 -- wqflask/wqflask/api/router.py | 4 +--- wqflask/wqflask/collect.py | 3 --- .../comparison_bar_chart/comparison_bar_chart.py | 1 - wqflask/wqflask/correlation/corr_scatter_plot.py | 4 +--- .../wqflask/correlation/correlation_functions.py | 4 +--- wqflask/wqflask/correlation/show_corr_results.py | 2 -- .../wqflask/correlation_matrix/show_corr_matrix.py | 2 -- wqflask/wqflask/do_search.py | 2 -- wqflask/wqflask/docs.py | 4 +--- wqflask/wqflask/export_traits.py | 4 +--- wqflask/wqflask/external_tools/send_to_bnw.py | 4 +--- .../wqflask/external_tools/send_to_geneweaver.py | 4 +--- .../wqflask/external_tools/send_to_webgestalt.py | 4 +--- wqflask/wqflask/group_manager.py | 5 +---- wqflask/wqflask/gsearch.py | 2 -- wqflask/wqflask/heatmap/heatmap.py | 2 -- wqflask/wqflask/interval_analyst/GeneUtil.py | 2 -- wqflask/wqflask/marker_regression/run_mapping.py | 4 +--- wqflask/wqflask/model.py | 4 +--- wqflask/wqflask/network_graph/network_graph.py | 2 -- wqflask/wqflask/news.py | 1 - wqflask/wqflask/parser.py | 2 -- wqflask/wqflask/resource_manager.py | 4 +--- wqflask/wqflask/search_results.py | 2 -- wqflask/wqflask/send_mail.py | 2 -- wqflask/wqflask/show_trait/SampleList.py | 2 -- wqflask/wqflask/show_trait/export_trait_data.py | 4 +--- wqflask/wqflask/show_trait/show_trait.py | 2 -- wqflask/wqflask/snp_browser/snp_browser.py | 2 -- wqflask/wqflask/submit_bnw.py | 4 +--- wqflask/wqflask/update_search_results.py | 2 -- wqflask/wqflask/user_login.py | 4 +--- wqflask/wqflask/user_manager.py | 2 -- wqflask/wqflask/user_session.py | 2 -- wqflask/wqflask/views.py | 2 -- 76 files changed, 45 insertions(+), 190 deletions(-) (limited to 'test') diff --git a/test/requests/link_checker.py b/test/requests/link_checker.py index 5e16a5cd..949a33c8 100644 --- a/test/requests/link_checker.py +++ b/test/requests/link_checker.py @@ -1,4 +1,3 @@ -from __future__ import print_function import re import requests from lxml.html import parse diff --git a/test/requests/main_web_functionality.py b/test/requests/main_web_functionality.py index d070dab9..78030307 100644 --- a/test/requests/main_web_functionality.py +++ b/test/requests/main_web_functionality.py @@ -1,9 +1,7 @@ -from __future__ import print_function -import re import requests from lxml.html import parse from link_checker import check_page -from requests.exceptions import ConnectionError + def check_home(url): doc = parse(url).getroot() @@ -11,20 +9,23 @@ def check_home(url): assert(search_button[0].value == "Search") print("OK") + def check_search_page(host): data = dict( - species="mouse" - , group="BXD" - , type="Hippocampus mRNA" - , dataset="HC_M2_0606_P" - , search_terms_or="" - , search_terms_and="MEAN=(15 16) LRS=(23 46)") + species="mouse", + group="BXD", + type="Hippocampus mRNA", + dataset="HC_M2_0606_P", + search_terms_or="", + search_terms_and="MEAN=(15 16) LRS=(23 46)") result = requests.get(host+"/search", params=data) found = result.text.find("records are shown below") assert(found >= 0) assert(result.status_code == 200) print("OK") - check_traits_page(host, "/show_trait?trait_id=1435395_s_at&dataset=HC_M2_0606_P") + check_traits_page(host, ("/show_trait?trait_id=1435395_" + "s_at&dataset=HC_M2_0606_P")) + def check_traits_page(host, traits_url): doc = parse(host+traits_url).getroot() @@ -33,6 +34,7 @@ def check_traits_page(host, traits_url): print("OK") check_page(host, host+traits_url) + def check_main_web_functionality(args_obj, parser): print("") print("Checking main web functionality...") diff --git a/test/requests/mapping_tests.py b/test/requests/mapping_tests.py index 5748a2a3..19b22c21 100644 --- a/test/requests/mapping_tests.py +++ b/test/requests/mapping_tests.py @@ -1,4 +1,3 @@ -from __future__ import print_function import re import copy import json diff --git a/test/requests/navigation_tests.py b/test/requests/navigation_tests.py index eda27324..6b91c1fd 100644 --- a/test/requests/navigation_tests.py +++ b/test/requests/navigation_tests.py @@ -1,4 +1,3 @@ -from __future__ import print_function import re import requests from lxml.html import parse diff --git a/test/requests/test-website.py b/test/requests/test-website.py index f90d1843..8bfb47c2 100755 --- a/test/requests/test-website.py +++ b/test/requests/test-website.py @@ -3,7 +3,7 @@ # env GN2_PROFILE=/home/wrk/opt/gn-latest ./bin/genenetwork2 ./etc/default_settings.py -c ../test/requests/test-website.py http://localhost:5003 # # Mostly to pick up the Guix GN2_PROFILE and python modules -from __future__ import print_function + import argparse from link_checker import check_links from link_checker import check_packaged_js_files diff --git a/webtests/browser_run.py b/webtests/browser_run.py index 2ec299c5..7ee540b7 100644 --- a/webtests/browser_run.py +++ b/webtests/browser_run.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import, division, print_function - __all__ = ('sleep', 'testmod', 'test') from doctest import testmod @@ -71,4 +69,4 @@ class Test(object): -test = Test() \ No newline at end of file +test = Test() diff --git a/webtests/correlation_matrix_test.py b/webtests/correlation_matrix_test.py index 8529c265..97114890 100644 --- a/webtests/correlation_matrix_test.py +++ b/webtests/correlation_matrix_test.py @@ -65,8 +65,6 @@ text: 0.608\n71 """ -from __future__ import absolute_import, division, print_function - from browser_run import * testmod() diff --git a/webtests/correlation_test.py b/webtests/correlation_test.py index aad3a69f..311bb847 100644 --- a/webtests/correlation_test.py +++ b/webtests/correlation_test.py @@ -44,8 +44,6 @@ text: 1.000 """ -from __future__ import absolute_import, division, print_function - from browser_run import * testmod() diff --git a/webtests/marker_regression_test.py b/webtests/marker_regression_test.py index c4f76f53..9b4a4acb 100644 --- a/webtests/marker_regression_test.py +++ b/webtests/marker_regression_test.py @@ -48,8 +48,6 @@ text: 11.511 """ -from __future__ import absolute_import, division, print_function - from browser_run import * testmod() diff --git a/webtests/show_trait_js_test.py b/webtests/show_trait_js_test.py index 0fd2c16c..34ffd3b7 100644 --- a/webtests/show_trait_js_test.py +++ b/webtests/show_trait_js_test.py @@ -35,8 +35,6 @@ style: display: none; """ -from __future__ import absolute_import, division, print_function - from browser_run import * testmod() diff --git a/webtests/test_runner.py b/webtests/test_runner.py index ef6d0d69..b5b590a6 100644 --- a/webtests/test_runner.py +++ b/webtests/test_runner.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import, division, print_function - import unittest import doctest import glob @@ -25,4 +23,4 @@ def main(): runner.run(suite) if __name__ == '__main__': - main() \ No newline at end of file + main() diff --git a/wqflask/base/data_set.py b/wqflask/base/data_set.py index 39a8a2ed..8ac7a279 100644 --- a/wqflask/base/data_set.py +++ b/wqflask/base/data_set.py @@ -18,7 +18,6 @@ # # This module is used by GeneNetwork project (www.genenetwork.org) -from __future__ import absolute_import, print_function, division from db.call import fetchall, fetchone, fetch1 from utility.logger import getLogger from utility.tools import USE_GN_SERVER, USE_REDIS, flat_files, flat_file_exists, GN2_BASE_URL diff --git a/wqflask/base/mrna_assay_tissue_data.py b/wqflask/base/mrna_assay_tissue_data.py index 6fec5dcd..33ce12bd 100644 --- a/wqflask/base/mrna_assay_tissue_data.py +++ b/wqflask/base/mrna_assay_tissue_data.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import, print_function, division - import collections from flask import g @@ -92,4 +90,4 @@ class MrnaAssayTissueData(object): else: symbol_values_dict[result.Symbol.lower()].append(result.value) - return symbol_values_dict \ No newline at end of file + return symbol_values_dict diff --git a/wqflask/base/species.py b/wqflask/base/species.py index 6d99af65..e3f1bc4a 100644 --- a/wqflask/base/species.py +++ b/wqflask/base/species.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import, print_function, division - import collections from flask import Flask, g @@ -59,4 +57,4 @@ class Chromosomes(object): results = g.db.execute(query).fetchall() for item in results: - self.chromosomes[item.OrderId] = IndChromosome(item.Name, item.Length) \ No newline at end of file + self.chromosomes[item.OrderId] = IndChromosome(item.Name, item.Length) diff --git a/wqflask/base/trait.py b/wqflask/base/trait.py index 09c41fa7..b20efd2a 100644 --- a/wqflask/base/trait.py +++ b/wqflask/base/trait.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import, division, print_function - import os import string import resource diff --git a/wqflask/maintenance/convert_dryad_to_bimbam.py b/wqflask/maintenance/convert_dryad_to_bimbam.py index e833b395..12ce35e9 100644 --- a/wqflask/maintenance/convert_dryad_to_bimbam.py +++ b/wqflask/maintenance/convert_dryad_to_bimbam.py @@ -6,7 +6,6 @@ Convert data dryad files to a BIMBAM _geno and _snps file """ -from __future__ import print_function, division, absolute_import import sys sys.path.append("..") @@ -67,4 +66,4 @@ def convert_dryad_to_bimbam(filename): if __name__=="__main__": input_filename = "/home/zas1024/cfw_data/" + sys.argv[1] + ".txt" - convert_dryad_to_bimbam(input_filename) \ No newline at end of file + convert_dryad_to_bimbam(input_filename) diff --git a/wqflask/maintenance/convert_geno_to_bimbam.py b/wqflask/maintenance/convert_geno_to_bimbam.py index 528b98cf..d49742f2 100644 --- a/wqflask/maintenance/convert_geno_to_bimbam.py +++ b/wqflask/maintenance/convert_geno_to_bimbam.py @@ -9,7 +9,6 @@ code """ -from __future__ import print_function, division, absolute_import import sys sys.path.append("..") import os @@ -187,4 +186,4 @@ if __name__=="__main__": #convertob = ConvertGenoFile("/home/zas1024/gene/genotype_files/genotypes/SRxSHRSPF2.geno", "/home/zas1024/gene/genotype_files/new_genotypes/SRxSHRSPF2.json") #convertob.convert() ConvertGenoFile.process_all(Old_Geno_Directory, New_Geno_Directory) - #ConvertGenoFiles(Geno_Directory) \ No newline at end of file + #ConvertGenoFiles(Geno_Directory) diff --git a/wqflask/maintenance/gen_select_dataset.py b/wqflask/maintenance/gen_select_dataset.py index fd65a52a..544e2fd1 100644 --- a/wqflask/maintenance/gen_select_dataset.py +++ b/wqflask/maintenance/gen_select_dataset.py @@ -30,14 +30,6 @@ It needs to be run manually when database has been changed. Run it as # # This module is used by GeneNetwork project (www.genenetwork.org) -from __future__ import print_function, division - -#from flask import config -# -#cdict = {} -#config = config.Config(cdict).from_envvar('WQFLASK_SETTINGS') -#print("cdict is:", cdict) - import sys # NEW: Note we prepend the current path - otherwise a guix instance of GN2 may be used instead @@ -319,4 +311,4 @@ def _test_it(): if __name__ == '__main__': Conn = MySQLdb.Connect(**parse_db_uri()) Cursor = Conn.cursor() - main() \ No newline at end of file + main() diff --git a/wqflask/maintenance/generate_kinship_from_bimbam.py b/wqflask/maintenance/generate_kinship_from_bimbam.py index b53f5dda..60257b28 100644 --- a/wqflask/maintenance/generate_kinship_from_bimbam.py +++ b/wqflask/maintenance/generate_kinship_from_bimbam.py @@ -8,7 +8,6 @@ and uses GEMMA to generate their corresponding kinship/relatedness matrix file """ -from __future__ import print_function, division, absolute_import import sys sys.path.append("..") import os @@ -58,4 +57,4 @@ if __name__=="__main__": Bimbam_Directory = """/export/local/home/zas1024/genotype_files/genotype/bimbam/""" GenerateKinshipMatrices.process_all(Geno_Directory, Bimbam_Directory) - #./gemma -g /home/zas1024/genotype_files/genotype/bimbam/BXD_geno.txt -p /home/zas1024/genotype_files/genotype/bimbam/BXD_pheno.txt -gk 1 -o BXD \ No newline at end of file + #./gemma -g /home/zas1024/genotype_files/genotype/bimbam/BXD_geno.txt -p /home/zas1024/genotype_files/genotype/bimbam/BXD_pheno.txt -gk 1 -o BXD diff --git a/wqflask/maintenance/generate_probesetfreeze_file.py b/wqflask/maintenance/generate_probesetfreeze_file.py index 4231cc7c..b1e41e9a 100644 --- a/wqflask/maintenance/generate_probesetfreeze_file.py +++ b/wqflask/maintenance/generate_probesetfreeze_file.py @@ -1,7 +1,5 @@ #!/usr/bin/python -from __future__ import absolute_import, print_function, division - import sys # sys.path.insert(0, "..") - why? diff --git a/wqflask/maintenance/geno_to_json.py b/wqflask/maintenance/geno_to_json.py index 9579812a..7e7fd241 100644 --- a/wqflask/maintenance/geno_to_json.py +++ b/wqflask/maintenance/geno_to_json.py @@ -9,7 +9,6 @@ code """ -from __future__ import print_function, division, absolute_import import sys sys.path.append("..") import os @@ -194,4 +193,4 @@ if __name__=="__main__": ConvertGenoFile.process_all(Old_Geno_Directory, New_Geno_Directory) #ConvertGenoFiles(Geno_Directory) - #process_csv(Input_File, Output_File) \ No newline at end of file + #process_csv(Input_File, Output_File) diff --git a/wqflask/maintenance/get_group_samplelists.py b/wqflask/maintenance/get_group_samplelists.py index fb22898a..3f9d0278 100644 --- a/wqflask/maintenance/get_group_samplelists.py +++ b/wqflask/maintenance/get_group_samplelists.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import, print_function, division - import os import glob import gzip diff --git a/wqflask/maintenance/print_benchmark.py b/wqflask/maintenance/print_benchmark.py index ae327cf3..b24ce4f1 100644 --- a/wqflask/maintenance/print_benchmark.py +++ b/wqflask/maintenance/print_benchmark.py @@ -1,7 +1,5 @@ #!/usr/bin/python -from __future__ import absolute_import, print_function, division - import time from pprint import pformat as pf @@ -40,4 +38,4 @@ def new_main(): print(pf(TheCounter.Counters)) if __name__ == '__main__': - new_main() \ No newline at end of file + new_main() diff --git a/wqflask/maintenance/quantile_normalize.py b/wqflask/maintenance/quantile_normalize.py index 4d6e03bf..701b2b50 100644 --- a/wqflask/maintenance/quantile_normalize.py +++ b/wqflask/maintenance/quantile_normalize.py @@ -1,10 +1,5 @@ -from __future__ import absolute_import, print_function, division - import sys sys.path.insert(0, './') - - - import MySQLdb import urllib.parse @@ -126,4 +121,4 @@ if __name__ == '__main__': } ) - print(response) \ No newline at end of file + print(response) diff --git a/wqflask/maintenance/set_resource_defaults.py b/wqflask/maintenance/set_resource_defaults.py index abd5416c..4177c124 100644 --- a/wqflask/maintenance/set_resource_defaults.py +++ b/wqflask/maintenance/set_resource_defaults.py @@ -16,8 +16,6 @@ To run: """ -from __future__ import print_function, division - import sys import json @@ -163,4 +161,4 @@ def main(): if __name__ == '__main__': Conn = MySQLdb.Connect(**parse_db_uri()) Cursor = Conn.cursor() - main() \ No newline at end of file + main() diff --git a/wqflask/utility/Plot.py b/wqflask/utility/Plot.py index 48a5c7ba..61f408d2 100644 --- a/wqflask/utility/Plot.py +++ b/wqflask/utility/Plot.py @@ -24,8 +24,6 @@ # # Last updated by GeneNetwork Core Team 2010/10/20 -from __future__ import print_function - from PIL import ImageColor from PIL import ImageDraw from PIL import ImageFont diff --git a/wqflask/utility/after.py b/wqflask/utility/after.py index b628a0a4..06091ecb 100644 --- a/wqflask/utility/after.py +++ b/wqflask/utility/after.py @@ -1,5 +1,3 @@ -from __future__ import print_function, division, absolute_import - """ See: http://flask.pocoo.org/docs/patterns/deferredcallbacks/#deferred-callbacks @@ -13,4 +11,4 @@ def after_this_request(f): if not hasattr(g, 'after_request_callbacks'): g.after_request_callbacks = [] g.after_request_callbacks.append(f) - return f \ No newline at end of file + return f diff --git a/wqflask/utility/authentication_tools.py b/wqflask/utility/authentication_tools.py index bc03eb55..0e499180 100644 --- a/wqflask/utility/authentication_tools.py +++ b/wqflask/utility/authentication_tools.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import, print_function, division - import json import requests diff --git a/wqflask/utility/benchmark.py b/wqflask/utility/benchmark.py index 221e5151..ea5a0ab6 100644 --- a/wqflask/utility/benchmark.py +++ b/wqflask/utility/benchmark.py @@ -1,5 +1,3 @@ -from __future__ import print_function, division, absolute_import - import collections import inspect import time diff --git a/wqflask/utility/chunks.py b/wqflask/utility/chunks.py index d91b9bf4..9a7db102 100644 --- a/wqflask/utility/chunks.py +++ b/wqflask/utility/chunks.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import, print_function, division - import math import time diff --git a/wqflask/utility/db_tools.py b/wqflask/utility/db_tools.py index 4034f39c..92bde505 100644 --- a/wqflask/utility/db_tools.py +++ b/wqflask/utility/db_tools.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import, print_function, division - from MySQLdb import escape_string as escape def create_in_clause(items): diff --git a/wqflask/utility/gen_geno_ob.py b/wqflask/utility/gen_geno_ob.py index ae42f834..81085ffe 100644 --- a/wqflask/utility/gen_geno_ob.py +++ b/wqflask/utility/gen_geno_ob.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import, division, print_function - import utility.logger logger = utility.logger.getLogger(__name__ ) @@ -178,4 +176,4 @@ class Locus(object): if allele in list(geno_table.keys()): self.genotype.append(geno_table[allele]) else: #ZS: Some genotype appears that isn't specified in the metadata, make it unknown - self.genotype.append("U") \ No newline at end of file + self.genotype.append("U") diff --git a/wqflask/utility/genofile_parser.py b/wqflask/utility/genofile_parser.py index af306731..0b736176 100644 --- a/wqflask/utility/genofile_parser.py +++ b/wqflask/utility/genofile_parser.py @@ -1,7 +1,6 @@ # CTL analysis for GN2 # Author / Maintainer: Danny Arends -from __future__ import print_function, division, absolute_import import sys import os import glob diff --git a/wqflask/utility/helper_functions.py b/wqflask/utility/helper_functions.py index 107c9ec6..7eb7f013 100644 --- a/wqflask/utility/helper_functions.py +++ b/wqflask/utility/helper_functions.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import, print_function, division - from base import data_set from base.trait import create_trait from base.species import TheSpecies diff --git a/wqflask/utility/hmac.py b/wqflask/utility/hmac.py index b08be97e..73e28790 100644 --- a/wqflask/utility/hmac.py +++ b/wqflask/utility/hmac.py @@ -1,5 +1,3 @@ -from __future__ import print_function, division, absolute_import - import hmac import hashlib @@ -37,4 +35,4 @@ def url_for_hmac(endpoint, **values): return url + combiner + "hm=" + hm app.jinja_env.globals.update(url_for_hmac=url_for_hmac, - data_hmac=data_hmac) \ No newline at end of file + data_hmac=data_hmac) diff --git a/wqflask/utility/redis_tools.py b/wqflask/utility/redis_tools.py index 1377a564..13ac5cfe 100644 --- a/wqflask/utility/redis_tools.py +++ b/wqflask/utility/redis_tools.py @@ -1,5 +1,3 @@ -from __future__ import print_function, division, absolute_import - import uuid import simplejson as json import datetime @@ -306,4 +304,4 @@ def change_resource_owner(resource_id, new_owner_id): the_resource['owner_id'] = new_owner_id Redis.delete("resource") - Redis.hset("resources", resource_id, json.dumps(the_resource)) \ No newline at end of file + Redis.hset("resources", resource_id, json.dumps(the_resource)) diff --git a/wqflask/utility/temp_data.py b/wqflask/utility/temp_data.py index 2f2726c6..4144ae00 100644 --- a/wqflask/utility/temp_data.py +++ b/wqflask/utility/temp_data.py @@ -1,4 +1,3 @@ -from __future__ import print_function, division, absolute_import from redis import Redis import simplejson as json diff --git a/wqflask/wqflask/__init__.py b/wqflask/wqflask/__init__.py index d729aef5..e73f833f 100644 --- a/wqflask/wqflask/__init__.py +++ b/wqflask/wqflask/__init__.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import, division, print_function - import sys import jinja2 diff --git a/wqflask/wqflask/api/correlation.py b/wqflask/wqflask/api/correlation.py index eb05645e..7da13121 100644 --- a/wqflask/wqflask/api/correlation.py +++ b/wqflask/wqflask/api/correlation.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import, division, print_function - import collections import scipy @@ -234,4 +232,4 @@ def init_corr_params(start_vars): 'return_count' : return_count } - return corr_params \ No newline at end of file + return corr_params diff --git a/wqflask/wqflask/api/gen_menu.py b/wqflask/wqflask/api/gen_menu.py index 41966f78..1dcafe1f 100644 --- a/wqflask/wqflask/api/gen_menu.py +++ b/wqflask/wqflask/api/gen_menu.py @@ -1,5 +1,3 @@ -from __future__ import print_function, division - from flask import g diff --git a/wqflask/wqflask/api/mapping.py b/wqflask/wqflask/api/mapping.py index 92c27c9b..d59a69df 100644 --- a/wqflask/wqflask/api/mapping.py +++ b/wqflask/wqflask/api/mapping.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import, division, print_function - import string from base import data_set diff --git a/wqflask/wqflask/api/router.py b/wqflask/wqflask/api/router.py index 5f9b81b8..acf7ce4a 100644 --- a/wqflask/wqflask/api/router.py +++ b/wqflask/wqflask/api/router.py @@ -1,7 +1,5 @@ # GN2 API -from __future__ import absolute_import, division, print_function - import os, io, csv, json, datetime, requests, yaml import zlib from zipfile import ZipFile, ZIP_DEFLATED @@ -966,4 +964,4 @@ def get_group_id(group_name): if group_id: return group_id[0] else: - return None \ No newline at end of file + return None diff --git a/wqflask/wqflask/collect.py b/wqflask/wqflask/collect.py index 06c00930..15383603 100644 --- a/wqflask/wqflask/collect.py +++ b/wqflask/wqflask/collect.py @@ -1,6 +1,3 @@ -from __future__ import print_function, division, absolute_import - - import os import hashlib import datetime diff --git a/wqflask/wqflask/comparison_bar_chart/comparison_bar_chart.py b/wqflask/wqflask/comparison_bar_chart/comparison_bar_chart.py index 16832621..92de6073 100644 --- a/wqflask/wqflask/comparison_bar_chart/comparison_bar_chart.py +++ b/wqflask/wqflask/comparison_bar_chart/comparison_bar_chart.py @@ -18,7 +18,6 @@ # # This module is used by GeneNetwork project (www.genenetwork.org) -from __future__ import absolute_import, print_function, division from pprint import pformat as pf from base.trait import create_trait diff --git a/wqflask/wqflask/correlation/corr_scatter_plot.py b/wqflask/wqflask/correlation/corr_scatter_plot.py index 57a8d85f..929cd2c9 100644 --- a/wqflask/wqflask/correlation/corr_scatter_plot.py +++ b/wqflask/wqflask/correlation/corr_scatter_plot.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import, print_function, division - import math from flask import g @@ -130,4 +128,4 @@ def get_intercept_coords(slope, intercept, x_range, y_range): intercept_coords.append([x1, y1]) intercept_coords.append([x2, y2]) - return intercept_coords \ No newline at end of file + return intercept_coords diff --git a/wqflask/wqflask/correlation/correlation_functions.py b/wqflask/wqflask/correlation/correlation_functions.py index abaa212f..b883e361 100644 --- a/wqflask/wqflask/correlation/correlation_functions.py +++ b/wqflask/wqflask/correlation/correlation_functions.py @@ -24,8 +24,6 @@ # # Last updated by NL 2011/03/23 -from __future__ import absolute_import, print_function, division - import math import rpy2.robjects import string @@ -114,4 +112,4 @@ def get_trait_symbol_and_tissue_values(symbol_list=None): tissue_data = MrnaAssayTissueData(gene_symbols=symbol_list) if len(tissue_data.gene_symbols): - return tissue_data.get_symbol_values_pairs() \ No newline at end of file + return tissue_data.get_symbol_values_pairs() diff --git a/wqflask/wqflask/correlation/show_corr_results.py b/wqflask/wqflask/correlation/show_corr_results.py index 5ced30b6..e5b87c6a 100644 --- a/wqflask/wqflask/correlation/show_corr_results.py +++ b/wqflask/wqflask/correlation/show_corr_results.py @@ -18,8 +18,6 @@ # # This module is used by GeneNetwork project (www.genenetwork.org) -from __future__ import absolute_import, print_function, division - import collections import json import scipy diff --git a/wqflask/wqflask/correlation_matrix/show_corr_matrix.py b/wqflask/wqflask/correlation_matrix/show_corr_matrix.py index bd5aca1f..7b4bda31 100644 --- a/wqflask/wqflask/correlation_matrix/show_corr_matrix.py +++ b/wqflask/wqflask/correlation_matrix/show_corr_matrix.py @@ -18,8 +18,6 @@ # # This module is used by GeneNetwork project (www.genenetwork.org) -from __future__ import absolute_import, print_function, division - import datetime import math import numpy as np diff --git a/wqflask/wqflask/do_search.py b/wqflask/wqflask/do_search.py index cc9c1860..de8e1e78 100644 --- a/wqflask/wqflask/do_search.py +++ b/wqflask/wqflask/do_search.py @@ -1,5 +1,3 @@ -from __future__ import print_function, division - import string import requests import json diff --git a/wqflask/wqflask/docs.py b/wqflask/wqflask/docs.py index 78407e22..8628b81d 100644 --- a/wqflask/wqflask/docs.py +++ b/wqflask/wqflask/docs.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import, print_function, division - import codecs from flask import g @@ -42,4 +40,4 @@ def update_text(start_vars): sql = "UPDATE Docs SET content='{0}' WHERE entry='{1}';".format(content, start_vars['entry_type']) g.db.execute(sql) except: - pass \ No newline at end of file + pass diff --git a/wqflask/wqflask/export_traits.py b/wqflask/wqflask/export_traits.py index 2f4e9aac..3a886537 100644 --- a/wqflask/wqflask/export_traits.py +++ b/wqflask/wqflask/export_traits.py @@ -1,5 +1,3 @@ -from __future__ import print_function, division - import csv import xlsxwriter import io @@ -140,4 +138,4 @@ def sort_traits_by_group(trait_list=[]): traits_by_group[trait.dataset.group.name].append(trait) - return traits_by_group \ No newline at end of file + return traits_by_group diff --git a/wqflask/wqflask/external_tools/send_to_bnw.py b/wqflask/wqflask/external_tools/send_to_bnw.py index 68efd10d..efa17f05 100644 --- a/wqflask/wqflask/external_tools/send_to_bnw.py +++ b/wqflask/wqflask/external_tools/send_to_bnw.py @@ -18,8 +18,6 @@ # # This module is used by GeneNetwork project (www.genenetwork.org) -from __future__ import absolute_import, print_function, division - from base.trait import GeneralTrait from utility import helper_functions, corr_result_helpers @@ -69,4 +67,4 @@ class SendToBNW(object): if has_none: continue self.form_value += ",".join(str(cell) for cell in row) - self.form_value += ";" \ No newline at end of file + self.form_value += ";" diff --git a/wqflask/wqflask/external_tools/send_to_geneweaver.py b/wqflask/wqflask/external_tools/send_to_geneweaver.py index 9844bab4..93164233 100644 --- a/wqflask/wqflask/external_tools/send_to_geneweaver.py +++ b/wqflask/wqflask/external_tools/send_to_geneweaver.py @@ -18,8 +18,6 @@ # # This module is used by GeneNetwork project (www.genenetwork.org) -from __future__ import absolute_import, print_function, division - import string from flask import Flask, g @@ -109,4 +107,4 @@ def test_chip(trait_list): chip_name = '%s_NA' % result[0] return chip_name - return chip_name \ No newline at end of file + return chip_name diff --git a/wqflask/wqflask/external_tools/send_to_webgestalt.py b/wqflask/wqflask/external_tools/send_to_webgestalt.py index 30ca024f..b255ba95 100644 --- a/wqflask/wqflask/external_tools/send_to_webgestalt.py +++ b/wqflask/wqflask/external_tools/send_to_webgestalt.py @@ -18,8 +18,6 @@ # # This module is used by GeneNetwork project (www.genenetwork.org) -from __future__ import absolute_import, print_function, division - import string from flask import Flask, g @@ -123,4 +121,4 @@ def gen_gene_id_list(trait_list): trait_name_list.append(trait.name) retrieve_trait_info(trait, trait.dataset) gene_id_list.append(str(trait.geneid)) - return trait_name_list, gene_id_list \ No newline at end of file + return trait_name_list, gene_id_list diff --git a/wqflask/wqflask/group_manager.py b/wqflask/wqflask/group_manager.py index 24848ed8..e6079c3e 100644 --- a/wqflask/wqflask/group_manager.py +++ b/wqflask/wqflask/group_manager.py @@ -1,6 +1,3 @@ - -from __future__ import print_function, division, absolute_import - from flask import (Flask, g, render_template, url_for, request, make_response, redirect, flash) @@ -142,4 +139,4 @@ def send_group_invites(group_id, user_email_list = [], user_type="members"): else: send_verification_email(user_details, template_name = "email/group_verification.txt", key_prefix = "verification_code", subject = "You've been invited to join a GeneNetwork user group") -#@app.route() \ No newline at end of file +#@app.route() diff --git a/wqflask/wqflask/gsearch.py b/wqflask/wqflask/gsearch.py index c65a1415..6d797a29 100644 --- a/wqflask/wqflask/gsearch.py +++ b/wqflask/wqflask/gsearch.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import, print_function, division - import json from flask import Flask, g diff --git a/wqflask/wqflask/heatmap/heatmap.py b/wqflask/wqflask/heatmap/heatmap.py index 1f1cdb90..cca5a4fc 100644 --- a/wqflask/wqflask/heatmap/heatmap.py +++ b/wqflask/wqflask/heatmap/heatmap.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import, print_function, division - import string import os import random diff --git a/wqflask/wqflask/interval_analyst/GeneUtil.py b/wqflask/wqflask/interval_analyst/GeneUtil.py index a39e5d0f..17c8ccbf 100644 --- a/wqflask/wqflask/interval_analyst/GeneUtil.py +++ b/wqflask/wqflask/interval_analyst/GeneUtil.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import, print_function, division - import string from flask import Flask, g diff --git a/wqflask/wqflask/marker_regression/run_mapping.py b/wqflask/wqflask/marker_regression/run_mapping.py index 67512bc6..7ae84b16 100644 --- a/wqflask/wqflask/marker_regression/run_mapping.py +++ b/wqflask/wqflask/marker_regression/run_mapping.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import, print_function, division - from base.trait import GeneralTrait from base import data_set #import create_dataset @@ -711,4 +709,4 @@ def get_perm_strata(this_trait, sample_list, categorical_vars, used_samples): list_to_numbers = [d[x] for x in perm_strata_strings] perm_strata = list_to_numbers - return perm_strata \ No newline at end of file + return perm_strata diff --git a/wqflask/wqflask/model.py b/wqflask/wqflask/model.py index a135761c..772f74e4 100644 --- a/wqflask/wqflask/model.py +++ b/wqflask/wqflask/model.py @@ -1,5 +1,3 @@ -from __future__ import print_function, division, absolute_import - import uuid import datetime @@ -168,4 +166,4 @@ def display_collapsible(number): def user_uuid(): """Unique cookie for a user""" - user_uuid = request.cookies.get('user_uuid') \ No newline at end of file + user_uuid = request.cookies.get('user_uuid') diff --git a/wqflask/wqflask/network_graph/network_graph.py b/wqflask/wqflask/network_graph/network_graph.py index 2a4c4a93..70e5dd58 100644 --- a/wqflask/wqflask/network_graph/network_graph.py +++ b/wqflask/wqflask/network_graph/network_graph.py @@ -18,8 +18,6 @@ # # This module is used by GeneNetwork project (www.genenetwork.org) -from __future__ import absolute_import, print_function, division - import scipy import simplejson as json from pprint import pformat as pf diff --git a/wqflask/wqflask/news.py b/wqflask/wqflask/news.py index 20319756..0675ec4b 100644 --- a/wqflask/wqflask/news.py +++ b/wqflask/wqflask/news.py @@ -1,4 +1,3 @@ -from __future__ import absolute_import, print_function, division from flask import g class News(object): diff --git a/wqflask/wqflask/parser.py b/wqflask/wqflask/parser.py index 1ca5ecff..472dd30e 100644 --- a/wqflask/wqflask/parser.py +++ b/wqflask/wqflask/parser.py @@ -17,8 +17,6 @@ be acceptable.] """ -from __future__ import print_function, division - import re from pprint import pformat as pf diff --git a/wqflask/wqflask/resource_manager.py b/wqflask/wqflask/resource_manager.py index 6b3e00fb..e883d5da 100644 --- a/wqflask/wqflask/resource_manager.py +++ b/wqflask/wqflask/resource_manager.py @@ -1,5 +1,3 @@ -from __future__ import print_function, division, absolute_import - import json from flask import (Flask, g, render_template, url_for, request, make_response, @@ -131,4 +129,4 @@ def get_group_names(group_masks): this_mask['name'] = group_name group_masks_with_names[group_id] = this_mask - return group_masks_with_names \ No newline at end of file + return group_masks_with_names diff --git a/wqflask/wqflask/search_results.py b/wqflask/wqflask/search_results.py index c07a7670..f6c677a8 100644 --- a/wqflask/wqflask/search_results.py +++ b/wqflask/wqflask/search_results.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import, print_function, division - import re import uuid from math import * diff --git a/wqflask/wqflask/send_mail.py b/wqflask/wqflask/send_mail.py index bf5d0dd8..86e8a558 100644 --- a/wqflask/wqflask/send_mail.py +++ b/wqflask/wqflask/send_mail.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import, division, print_function - import datetime import time diff --git a/wqflask/wqflask/show_trait/SampleList.py b/wqflask/wqflask/show_trait/SampleList.py index f17e825e..6fcf7cec 100644 --- a/wqflask/wqflask/show_trait/SampleList.py +++ b/wqflask/wqflask/show_trait/SampleList.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import, print_function, division - from flask import Flask, g from base import webqtlCaseData diff --git a/wqflask/wqflask/show_trait/export_trait_data.py b/wqflask/wqflask/show_trait/export_trait_data.py index 68c3ad7d..2d76b935 100644 --- a/wqflask/wqflask/show_trait/export_trait_data.py +++ b/wqflask/wqflask/show_trait/export_trait_data.py @@ -1,5 +1,3 @@ -from __future__ import print_function, division - import simplejson as json from pprint import pformat as pf @@ -71,4 +69,4 @@ def cmp_samples(a, b): else: return 1 else: - return -1 \ No newline at end of file + return -1 diff --git a/wqflask/wqflask/show_trait/show_trait.py b/wqflask/wqflask/show_trait/show_trait.py index 6a74cada..e93b0289 100644 --- a/wqflask/wqflask/show_trait/show_trait.py +++ b/wqflask/wqflask/show_trait/show_trait.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import, print_function, division - import string import os import datetime diff --git a/wqflask/wqflask/snp_browser/snp_browser.py b/wqflask/wqflask/snp_browser/snp_browser.py index b3d26caf..0db7e1fe 100644 --- a/wqflask/wqflask/snp_browser/snp_browser.py +++ b/wqflask/wqflask/snp_browser/snp_browser.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import, print_function, division - from flask import Flask, g, url_for import string diff --git a/wqflask/wqflask/submit_bnw.py b/wqflask/wqflask/submit_bnw.py index 59e60dfd..a0e84c8c 100644 --- a/wqflask/wqflask/submit_bnw.py +++ b/wqflask/wqflask/submit_bnw.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import, print_function, division - from base.trait import GeneralTrait from base import data_set from utility import helper_functions @@ -8,4 +6,4 @@ import utility.logger logger = utility.logger.getLogger(__name__ ) def get_bnw_input(start_vars): - logger.debug("BNW VARS:", start_vars) \ No newline at end of file + logger.debug("BNW VARS:", start_vars) diff --git a/wqflask/wqflask/update_search_results.py b/wqflask/wqflask/update_search_results.py index 68bea9d6..672f95b1 100644 --- a/wqflask/wqflask/update_search_results.py +++ b/wqflask/wqflask/update_search_results.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import, print_function, division - import json from flask import Flask, g diff --git a/wqflask/wqflask/user_login.py b/wqflask/wqflask/user_login.py index 04672b45..10cb7319 100644 --- a/wqflask/wqflask/user_login.py +++ b/wqflask/wqflask/user_login.py @@ -1,5 +1,3 @@ -from __future__ import print_function, division, absolute_import - import os import hashlib import datetime @@ -470,4 +468,4 @@ def register(): @app.errorhandler(401) def unauthorized(error): - return redirect(url_for('login')) \ No newline at end of file + return redirect(url_for('login')) diff --git a/wqflask/wqflask/user_manager.py b/wqflask/wqflask/user_manager.py index 3c41e2b8..24191a15 100644 --- a/wqflask/wqflask/user_manager.py +++ b/wqflask/wqflask/user_manager.py @@ -1,5 +1,3 @@ -from __future__ import print_function, division, absolute_import - import os import hashlib import datetime diff --git a/wqflask/wqflask/user_session.py b/wqflask/wqflask/user_session.py index 71c31c57..c1f38396 100644 --- a/wqflask/wqflask/user_session.py +++ b/wqflask/wqflask/user_session.py @@ -1,5 +1,3 @@ -from __future__ import print_function, division, absolute_import - import datetime import time import uuid diff --git a/wqflask/wqflask/views.py b/wqflask/wqflask/views.py index 83d5202e..b0489e64 100644 --- a/wqflask/wqflask/views.py +++ b/wqflask/wqflask/views.py @@ -2,8 +2,6 @@ # # Main routing table for GN2 -from __future__ import absolute_import, division, print_function - import traceback # for error page import os # for error gifs import random # for random error gif -- cgit v1.2.3 From 7e989aca00de3d259d8d7f6a5b11c300ead7e3d2 Mon Sep 17 00:00:00 2001 From: BonfaceKilz Date: Mon, 31 Aug 2020 14:14:17 +0300 Subject: Add check for "chroma.js" dataTables extension plugin * test/requests/link_checker.py (check_packaged_js_files): Add it. --- test/requests/link_checker.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'test') diff --git a/test/requests/link_checker.py b/test/requests/link_checker.py index 12057203..d29e5965 100644 --- a/test/requests/link_checker.py +++ b/test/requests/link_checker.py @@ -97,6 +97,8 @@ def check_packaged_js_files(args_obj, parser): # Datatables plugins: "/DataTablesExtensions/plugins/sorting/natural.js", "/DataTablesExtensions/plugins/sorting/scientific.js", + # Other js libraries + "/chroma/chroma.min.js" ] print("Checking links") -- cgit v1.2.3 From db0ba01a135902f5b90ca1674f064371e710a959 Mon Sep 17 00:00:00 2001 From: BonfaceKilz Date: Mon, 31 Aug 2020 17:55:19 +0300 Subject: Add check for "d3-tip.js" js library * test/requests/link_checker.py (check_packaged_js_files): Add it. --- test/requests/link_checker.py | 1 + 1 file changed, 1 insertion(+) (limited to 'test') diff --git a/test/requests/link_checker.py b/test/requests/link_checker.py index d29e5965..31f0dc34 100644 --- a/test/requests/link_checker.py +++ b/test/requests/link_checker.py @@ -99,6 +99,7 @@ def check_packaged_js_files(args_obj, parser): "/DataTablesExtensions/plugins/sorting/scientific.js", # Other js libraries "/chroma/chroma.min.js" + "/d3-tip/d3-tip.js" ] print("Checking links") -- cgit v1.2.3 From b37e6862978a89bcb1abd5790f8ae17f017130db Mon Sep 17 00:00:00 2001 From: BonfaceKilz Date: Tue, 1 Sep 2020 14:10:32 +0300 Subject: Check availability of several js and css files * test/requests/link_checker.py: Check availability of: chroma.min.js; d3-tip.js; d3.min.js; underscore.min.js; nv.d3.min.css; and jquery.qtip.min.js --- test/requests/link_checker.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'test') diff --git a/test/requests/link_checker.py b/test/requests/link_checker.py index 31f0dc34..eee79b78 100644 --- a/test/requests/link_checker.py +++ b/test/requests/link_checker.py @@ -98,8 +98,12 @@ def check_packaged_js_files(args_obj, parser): "/DataTablesExtensions/plugins/sorting/natural.js", "/DataTablesExtensions/plugins/sorting/scientific.js", # Other js libraries - "/chroma/chroma.min.js" - "/d3-tip/d3-tip.js" + "/chroma/chroma.min.js", + "/d3-tip/d3-tip.js", + "/d3js/d3.min.js", + "/js_alt/underscore.min.js", + "/nvd3/nv.d3.min.css", + "/qtip2/jquery.qtip.min.js", ] print("Checking links") -- cgit v1.2.3 From d747b95a258f4d606d4aa4442d153d6e163cf0de Mon Sep 17 00:00:00 2001 From: BonfaceKilz Date: Tue, 1 Sep 2020 19:20:53 +0300 Subject: Add check for "md5.min.js" library * test/requests/link_checker.py: Add it. --- test/requests/link_checker.py | 1 + 1 file changed, 1 insertion(+) (limited to 'test') diff --git a/test/requests/link_checker.py b/test/requests/link_checker.py index eee79b78..47454c75 100644 --- a/test/requests/link_checker.py +++ b/test/requests/link_checker.py @@ -104,6 +104,7 @@ def check_packaged_js_files(args_obj, parser): "/js_alt/underscore.min.js", "/nvd3/nv.d3.min.css", "/qtip2/jquery.qtip.min.js", + "/js_alt/md5.min.js", ] print("Checking links") -- cgit v1.2.3 From 86fd0e0bec0c56ffa7857d9bf8c2c0dac25f99dc Mon Sep 17 00:00:00 2001 From: BonfaceKilz Date: Fri, 4 Sep 2020 01:02:38 +0300 Subject: Fix false positive tests * test/requests/link_checker.py: (verify_static_file): Add it. Verify that a static link is fetched by checking for the message "Error: 404 not Found" in page. (check_package_js_files): Add appropriate 'js' or 'css' prefix. --- test/requests/link_checker.py | 53 +++++++++++++++++++++++++++---------------- 1 file changed, 34 insertions(+), 19 deletions(-) (limited to 'test') diff --git a/test/requests/link_checker.py b/test/requests/link_checker.py index 47454c75..d040ba54 100644 --- a/test/requests/link_checker.py +++ b/test/requests/link_checker.py @@ -52,6 +52,21 @@ def verify_link(link): if DO_FAIL: raise ex + +def verify_static_file(link): + print("verifying "+link) + try: + result = requests.get(link, timeout=20, verify=False) + if (result.status_code == 200 and + result.content.find("Error: 404 Not Found") <= 0): + print(link+" ==> OK") + else: + print("ERROR: link {}".format(link)) + raise Exception("Failed verify") + except ConnectionError as ex: + print("ERROR: ", link, ex) + + def check_page(host, start_url): print("") print("Checking links host "+host+" in page `"+start_url+"`") @@ -85,28 +100,28 @@ def check_packaged_js_files(args_obj, parser): host = args_obj.host js_files = [ # Datatables Extensions: - "/DataTablesExtensions/buttonsBootstrap/css/buttons.bootstrap.css", - "/DataTablesExtensions/buttons/js/dataTables.buttons.min.js", - "/DataTablesExtensions/buttonStyles/css/buttons.dataTables.min.css", - "/DataTablesExtensions/buttons/js/dataTables.buttons.min.js", - "/DataTablesExtensions/colResize/dataTables.colResize.js", - "/DataTablesExtensions/colReorder/js/dataTables.colReorder.js", - "/DataTablesExtensions/buttons/js/buttons.colVis.min.js", - "/DataTables/js/jquery.dataTables.js", - "/DataTablesExtensions/scroller/css/scroller.dataTables.min.css", + "/css/DataTablesExtensions/buttonsBootstrap/css/buttons.bootstrap.css", + "/js/DataTablesExtensions/buttons/js/dataTables.buttons.min.js", + "/css/DataTablesExtensions/buttonStyles/css/buttons.dataTables.min.css", + "/js/DataTablesExtensions/buttons/js/dataTables.buttons.min.js", + "/js/DataTablesExtensions/colResize/dataTables.colResize.js", + "/js/DataTablesExtensions/colReorder/js/dataTables.colReorder.js", + "/js/DataTablesExtensions/buttons/js/buttons.colVis.min.js", + "/js/DataTables/js/jquery.dataTables.js", + "/css/DataTablesExtensions/scroller/css/scroller.dataTables.min.css", # Datatables plugins: - "/DataTablesExtensions/plugins/sorting/natural.js", - "/DataTablesExtensions/plugins/sorting/scientific.js", + "/js/DataTablesExtensions/plugins/sorting/natural.js", + "/js/DataTablesExtensions/plugins/sorting/scientific.js", # Other js libraries - "/chroma/chroma.min.js", - "/d3-tip/d3-tip.js", - "/d3js/d3.min.js", - "/js_alt/underscore.min.js", - "/nvd3/nv.d3.min.css", - "/qtip2/jquery.qtip.min.js", - "/js_alt/md5.min.js", + "/js/chroma/chroma.min.js", + "/js/d3-tip/d3-tip.js", + "/js/d3js/d3.min.js", + "/js/js_alt/underscore.min.js", + "/js/nvd3/nv.d3.min.css", + "/js/qtip2/jquery.qtip.min.js", + "/js/js_alt/md5.min.js", ] print("Checking links") for link in js_files: - verify_link(host+link) + verify_static_file(host+link) -- cgit v1.2.3 From d52cc25d120173de3fd16bbd42ea38498d458e35 Mon Sep 17 00:00:00 2001 From: BonfaceKilz Date: Thu, 17 Sep 2020 21:19:00 +0300 Subject: Update Mechanical Rob * test/requests/link_checker.py (verify_static_file): Cast result.content.find's args to bytes. * test/requests/main_web_functionality.py (check_search_page): Update text to search for in a successful result. This value changed in 2aac6a06. --- test/requests/link_checker.py | 2 +- test/requests/main_web_functionality.py | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) (limited to 'test') diff --git a/test/requests/link_checker.py b/test/requests/link_checker.py index e9943492..6ac26ba7 100644 --- a/test/requests/link_checker.py +++ b/test/requests/link_checker.py @@ -54,7 +54,7 @@ def verify_static_file(link): try: result = requests.get(link, timeout=20, verify=False) if (result.status_code == 200 and - result.content.find("Error: 404 Not Found") <= 0): + result.content.find(bytes("Error: 404 Not Found", "utf-8")) <= 0): print(link+" ==> OK") else: print("ERROR: link {}".format(link)) diff --git a/test/requests/main_web_functionality.py b/test/requests/main_web_functionality.py index 78030307..cefb8b8c 100644 --- a/test/requests/main_web_functionality.py +++ b/test/requests/main_web_functionality.py @@ -9,7 +9,6 @@ def check_home(url): assert(search_button[0].value == "Search") print("OK") - def check_search_page(host): data = dict( species="mouse", @@ -19,7 +18,7 @@ def check_search_page(host): search_terms_or="", search_terms_and="MEAN=(15 16) LRS=(23 46)") result = requests.get(host+"/search", params=data) - found = result.text.find("records are shown below") + found = result.text.find("records were found.") assert(found >= 0) assert(result.status_code == 200) print("OK") -- cgit v1.2.3 From 125c75b724350dd750b8633410d4b9b3841ce984 Mon Sep 17 00:00:00 2001 From: BonfaceKilz Date: Tue, 22 Sep 2020 03:43:50 +0300 Subject: Update Mechanical Rob * test/requests/main_web_functionality.py (check_search_page): Breaking change introduced by updating text in search page. See: 9f76abc95 --- test/requests/main_web_functionality.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test') diff --git a/test/requests/main_web_functionality.py b/test/requests/main_web_functionality.py index d070dab9..d4c3b1ad 100644 --- a/test/requests/main_web_functionality.py +++ b/test/requests/main_web_functionality.py @@ -20,7 +20,7 @@ def check_search_page(host): , search_terms_or="" , search_terms_and="MEAN=(15 16) LRS=(23 46)") result = requests.get(host+"/search", params=data) - found = result.text.find("records are shown below") + found = result.text.find("records were found") assert(found >= 0) assert(result.status_code == 200) print("OK") -- cgit v1.2.3 From 8bf342d5d02b4023814a79605c3f5f23a7ea67a0 Mon Sep 17 00:00:00 2001 From: Alexander Kabui Date: Mon, 7 Dec 2020 22:08:41 +0300 Subject: add cytocape.min.js,cytoscape-panzoom.js,cytoscape.js-panzoom.css,cytoscape-qtip.js to mechanical rob --- test/requests/link_checker.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'test') diff --git a/test/requests/link_checker.py b/test/requests/link_checker.py index 6ac26ba7..5bc30798 100644 --- a/test/requests/link_checker.py +++ b/test/requests/link_checker.py @@ -116,6 +116,11 @@ def check_packaged_js_files(args_obj, parser): "/js/nvd3/nv.d3.min.css", "/js/qtip2/jquery.qtip.min.js", "/js/js_alt/md5.min.js", + "/js/cytoscape/cytoscape.min.js", + "/js/cytoscape-panzoom/cytoscape-panzoom.js", + "/js/cytoscape-panzoom/cytoscape.js-panzoom.css", + "/js/cytoscape-qtip/cytoscape-qtip.js", + ] print("Checking links") -- cgit v1.2.3 From b3b2a6a6792896c59b8dbbd3bbe1bf8c650b223e Mon Sep 17 00:00:00 2001 From: Alexander Kabui Date: Tue, 8 Dec 2020 12:56:22 +0300 Subject: add ckeditor to mechanical rob --- test/requests/link_checker.py | 1 + 1 file changed, 1 insertion(+) (limited to 'test') diff --git a/test/requests/link_checker.py b/test/requests/link_checker.py index 6ac26ba7..5888146d 100644 --- a/test/requests/link_checker.py +++ b/test/requests/link_checker.py @@ -116,6 +116,7 @@ def check_packaged_js_files(args_obj, parser): "/js/nvd3/nv.d3.min.css", "/js/qtip2/jquery.qtip.min.js", "/js/js_alt/md5.min.js", + "/js/ckeditor/ckeditor.js", ] print("Checking links") -- cgit v1.2.3 From 971cf481a125a7da763a818a06dea946b6e5e81f Mon Sep 17 00:00:00 2001 From: Alexander Kabui Date: Tue, 8 Dec 2020 12:59:01 +0300 Subject: add purescript-genetics-browser.js to mechanical rob --- test/requests/link_checker.py | 1 + 1 file changed, 1 insertion(+) (limited to 'test') diff --git a/test/requests/link_checker.py b/test/requests/link_checker.py index 6ac26ba7..ed28aaf0 100644 --- a/test/requests/link_checker.py +++ b/test/requests/link_checker.py @@ -116,6 +116,7 @@ def check_packaged_js_files(args_obj, parser): "/js/nvd3/nv.d3.min.css", "/js/qtip2/jquery.qtip.min.js", "/js/js_alt/md5.min.js", + "/js/purescript-genome-browser/js/purescript-genetics-browser.js", ] print("Checking links") -- cgit v1.2.3 From 1995fbcf19645feaa1aabbab921e90c6877b4c4d Mon Sep 17 00:00:00 2001 From: Alexander Kabui Date: Tue, 8 Dec 2020 12:59:51 +0300 Subject: add purescript-genetics-browser.css --- test/requests/link_checker.py | 1 + 1 file changed, 1 insertion(+) (limited to 'test') diff --git a/test/requests/link_checker.py b/test/requests/link_checker.py index ed28aaf0..f19ee155 100644 --- a/test/requests/link_checker.py +++ b/test/requests/link_checker.py @@ -117,6 +117,7 @@ def check_packaged_js_files(args_obj, parser): "/js/qtip2/jquery.qtip.min.js", "/js/js_alt/md5.min.js", "/js/purescript-genome-browser/js/purescript-genetics-browser.js", + "/js/purescript-genome-browser/css/purescript-genetics-browser.css", ] print("Checking links") -- cgit v1.2.3 From 233ad63b9cdd6d80895bf551a4ec11d6649728ea Mon Sep 17 00:00:00 2001 From: Alexander Kabui Date: Tue, 8 Dec 2020 13:02:32 +0300 Subject: add nouislider.min.css to mechanical-rob --- test/requests/link_checker.py | 1 + 1 file changed, 1 insertion(+) (limited to 'test') diff --git a/test/requests/link_checker.py b/test/requests/link_checker.py index 6ac26ba7..8c73d20a 100644 --- a/test/requests/link_checker.py +++ b/test/requests/link_checker.py @@ -116,6 +116,7 @@ def check_packaged_js_files(args_obj, parser): "/js/nvd3/nv.d3.min.css", "/js/qtip2/jquery.qtip.min.js", "/js/js_alt/md5.min.js", + "/css/nouislider/nouislider.min.css", ] print("Checking links") -- cgit v1.2.3 From 2f8ba729e65960478b09f5ad64699831004310f8 Mon Sep 17 00:00:00 2001 From: Alexander Kabui Date: Tue, 8 Dec 2020 13:03:44 +0300 Subject: add nouislider.js to mechanical-rob --- test/requests/link_checker.py | 1 + 1 file changed, 1 insertion(+) (limited to 'test') diff --git a/test/requests/link_checker.py b/test/requests/link_checker.py index 8c73d20a..81bf4792 100644 --- a/test/requests/link_checker.py +++ b/test/requests/link_checker.py @@ -117,6 +117,7 @@ def check_packaged_js_files(args_obj, parser): "/js/qtip2/jquery.qtip.min.js", "/js/js_alt/md5.min.js", "/css/nouislider/nouislider.min.css", + "/js/nouislider/nouislider.js", ] print("Checking links") -- cgit v1.2.3 From d0be8fdb02e5bfa80a93633e59450789174a6d87 Mon Sep 17 00:00:00 2001 From: Alexander Kabui Date: Tue, 8 Dec 2020 13:17:13 +0300 Subject: add plotly.min.js to mechanical rob --- test/requests/link_checker.py | 1 + 1 file changed, 1 insertion(+) (limited to 'test') diff --git a/test/requests/link_checker.py b/test/requests/link_checker.py index 6ac26ba7..35c7cc97 100644 --- a/test/requests/link_checker.py +++ b/test/requests/link_checker.py @@ -116,6 +116,7 @@ def check_packaged_js_files(args_obj, parser): "/js/nvd3/nv.d3.min.css", "/js/qtip2/jquery.qtip.min.js", "/js/js_alt/md5.min.js", + "/js/plotly/plotly.min.js", ] print("Checking links") -- cgit v1.2.3 From 699b211aee55703937df07a210756292114382d2 Mon Sep 17 00:00:00 2001 From: Alexander Kabui Date: Tue, 8 Dec 2020 13:27:18 +0300 Subject: add underscore.string.min.js to mechanical rob --- test/requests/link_checker.py | 1 + 1 file changed, 1 insertion(+) (limited to 'test') diff --git a/test/requests/link_checker.py b/test/requests/link_checker.py index 6ac26ba7..2bcef540 100644 --- a/test/requests/link_checker.py +++ b/test/requests/link_checker.py @@ -116,6 +116,7 @@ def check_packaged_js_files(args_obj, parser): "/js/nvd3/nv.d3.min.css", "/js/qtip2/jquery.qtip.min.js", "/js/js_alt/md5.min.js", + "/js/underscore-string/underscore.string.min.js", ] print("Checking links") -- cgit v1.2.3 From d2a87a9a48fe6237f0ac25829502a25881a66ba7 Mon Sep 17 00:00:00 2001 From: Alexander Kabui Date: Tue, 8 Dec 2020 13:33:43 +0300 Subject: add datatable images to mechanical rob --- test/requests/link_checker.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'test') diff --git a/test/requests/link_checker.py b/test/requests/link_checker.py index 6ac26ba7..d10c15ac 100644 --- a/test/requests/link_checker.py +++ b/test/requests/link_checker.py @@ -116,6 +116,9 @@ def check_packaged_js_files(args_obj, parser): "/js/nvd3/nv.d3.min.css", "/js/qtip2/jquery.qtip.min.js", "/js/js_alt/md5.min.js", + #img + "/js/DataTables/images/sort_asc_disabled.png", + "/js/DataTables/images/sort_desc_disabled.png" ] print("Checking links") -- cgit v1.2.3 From 7122dcbd014e463e7b90b74d8c40f520b1064710 Mon Sep 17 00:00:00 2001 From: Alexander Kabui Date: Tue, 8 Dec 2020 13:43:03 +0300 Subject: add jscolor to mechanical rob --- test/requests/link_checker.py | 1 + 1 file changed, 1 insertion(+) (limited to 'test') diff --git a/test/requests/link_checker.py b/test/requests/link_checker.py index 6ac26ba7..7ee0dfb2 100644 --- a/test/requests/link_checker.py +++ b/test/requests/link_checker.py @@ -116,6 +116,7 @@ def check_packaged_js_files(args_obj, parser): "/js/nvd3/nv.d3.min.css", "/js/qtip2/jquery.qtip.min.js", "/js/js_alt/md5.min.js", + "/js/jscolor/jscolor.js", ] print("Checking links") -- cgit v1.2.3 From ece54a359552c55c359115d2a7c4949bafda874d Mon Sep 17 00:00:00 2001 From: Alexander Kabui Date: Tue, 8 Dec 2020 13:48:08 +0300 Subject: scroller.dataTables.min.js to mechanical rob --- test/requests/link_checker.py | 1 + 1 file changed, 1 insertion(+) (limited to 'test') diff --git a/test/requests/link_checker.py b/test/requests/link_checker.py index 6ac26ba7..2716434a 100644 --- a/test/requests/link_checker.py +++ b/test/requests/link_checker.py @@ -103,6 +103,7 @@ def check_packaged_js_files(args_obj, parser): "/js/DataTablesExtensions/colResize/dataTables.colResize.js", "/js/DataTablesExtensions/colReorder/js/dataTables.colReorder.js", "/js/DataTablesExtensions/buttons/js/buttons.colVis.min.js", + "/js/DataTablesExtensions/scroller/js/scroller.dataTables.min.js", "/js/DataTables/js/jquery.dataTables.js", "/css/DataTablesExtensions/scroller/css/scroller.dataTables.min.css", # Datatables plugins: -- cgit v1.2.3 From bc66593b6ac99e74b0949e23fe6a6f3fc2c9cae5 Mon Sep 17 00:00:00 2001 From: Alexander Kabui Date: Tue, 8 Dec 2020 13:55:18 +0300 Subject: add datatablejquery to mechanical rob --- test/requests/link_checker.py | 1 + 1 file changed, 1 insertion(+) (limited to 'test') diff --git a/test/requests/link_checker.py b/test/requests/link_checker.py index 2716434a..069dc025 100644 --- a/test/requests/link_checker.py +++ b/test/requests/link_checker.py @@ -117,6 +117,7 @@ def check_packaged_js_files(args_obj, parser): "/js/nvd3/nv.d3.min.css", "/js/qtip2/jquery.qtip.min.js", "/js/js_alt/md5.min.js", + "/js/DataTables/js/jquery.js", ] print("Checking links") -- cgit v1.2.3 From 20e4b1e2599dc641aa9d3a08b8686a3953bd1165 Mon Sep 17 00:00:00 2001 From: Alexander Kabui Date: Tue, 8 Dec 2020 13:57:38 +0300 Subject: add jquery.datatables css to mechanical rob --- test/requests/link_checker.py | 1 + 1 file changed, 1 insertion(+) (limited to 'test') diff --git a/test/requests/link_checker.py b/test/requests/link_checker.py index 069dc025..2cde3252 100644 --- a/test/requests/link_checker.py +++ b/test/requests/link_checker.py @@ -118,6 +118,7 @@ def check_packaged_js_files(args_obj, parser): "/js/qtip2/jquery.qtip.min.js", "/js/js_alt/md5.min.js", "/js/DataTables/js/jquery.js", + "/css/DataTables/css/jquery.dataTables.css", ] print("Checking links") -- cgit v1.2.3 From dd69862d269c4adbba0e524965c2b967bfc243fe Mon Sep 17 00:00:00 2001 From: Alexander Kabui Date: Tue, 8 Dec 2020 14:03:56 +0300 Subject: add jquery.colorbox-min.js to mechanical rob --- test/requests/link_checker.py | 1 + 1 file changed, 1 insertion(+) (limited to 'test') diff --git a/test/requests/link_checker.py b/test/requests/link_checker.py index 6ac26ba7..3cc3fc9d 100644 --- a/test/requests/link_checker.py +++ b/test/requests/link_checker.py @@ -116,6 +116,7 @@ def check_packaged_js_files(args_obj, parser): "/js/nvd3/nv.d3.min.css", "/js/qtip2/jquery.qtip.min.js", "/js/js_alt/md5.min.js", + "/js/colorbox/jquery.colorbox-min.js", ] print("Checking links") -- cgit v1.2.3 From 788304e2a81ad118e3a81ca211c74754eaa763a5 Mon Sep 17 00:00:00 2001 From: Alexander Kabui Date: Tue, 8 Dec 2020 14:12:38 +0300 Subject: add jsalt/jstat.min.js to mechanical rob --- test/requests/link_checker.py | 1 + 1 file changed, 1 insertion(+) (limited to 'test') diff --git a/test/requests/link_checker.py b/test/requests/link_checker.py index 6ac26ba7..58d4d305 100644 --- a/test/requests/link_checker.py +++ b/test/requests/link_checker.py @@ -116,6 +116,7 @@ def check_packaged_js_files(args_obj, parser): "/js/nvd3/nv.d3.min.css", "/js/qtip2/jquery.qtip.min.js", "/js/js_alt/md5.min.js", + "/js/js_alt/jstat.min.js", ] print("Checking links") -- cgit v1.2.3 From 6c4eeb4868945a63219a2de561ad145436b2a35a Mon Sep 17 00:00:00 2001 From: Alexander Kabui Date: Tue, 8 Dec 2020 14:15:12 +0300 Subject: add js-alt/parsley.min.js to mechanical rob --- test/requests/link_checker.py | 1 + 1 file changed, 1 insertion(+) (limited to 'test') diff --git a/test/requests/link_checker.py b/test/requests/link_checker.py index 58d4d305..3da366ef 100644 --- a/test/requests/link_checker.py +++ b/test/requests/link_checker.py @@ -117,6 +117,7 @@ def check_packaged_js_files(args_obj, parser): "/js/qtip2/jquery.qtip.min.js", "/js/js_alt/md5.min.js", "/js/js_alt/jstat.min.js", + "/js/js_alt/parsley.min.js", ] print("Checking links") -- cgit v1.2.3 From 79759d982c7524a117a4d3cb72a28b501ef5b354 Mon Sep 17 00:00:00 2001 From: Alexander Kabui Date: Tue, 8 Dec 2020 14:16:06 +0300 Subject: add jsalt/timeago.min.js to mechanical rob --- test/requests/link_checker.py | 1 + 1 file changed, 1 insertion(+) (limited to 'test') diff --git a/test/requests/link_checker.py b/test/requests/link_checker.py index 3da366ef..35e9e5e6 100644 --- a/test/requests/link_checker.py +++ b/test/requests/link_checker.py @@ -118,6 +118,7 @@ def check_packaged_js_files(args_obj, parser): "/js/js_alt/md5.min.js", "/js/js_alt/jstat.min.js", "/js/js_alt/parsley.min.js", + "/js/js_alt/timeago.min.js", ] print("Checking links") -- cgit v1.2.3 From cec8e3078784abf0224b23592d56745a09d7060f Mon Sep 17 00:00:00 2001 From: Alexander Kabui Date: Tue, 8 Dec 2020 14:17:57 +0300 Subject: add jszip to mechanical rob --- test/requests/link_checker.py | 1 + 1 file changed, 1 insertion(+) (limited to 'test') diff --git a/test/requests/link_checker.py b/test/requests/link_checker.py index 6ac26ba7..dd0bbb65 100644 --- a/test/requests/link_checker.py +++ b/test/requests/link_checker.py @@ -116,6 +116,7 @@ def check_packaged_js_files(args_obj, parser): "/js/nvd3/nv.d3.min.css", "/js/qtip2/jquery.qtip.min.js", "/js/js_alt/md5.min.js", + "/js/jszip/jszip.min.js", ] print("Checking links") -- cgit v1.2.3 From cea24282d18be73ceb67587296e756b092ce1021 Mon Sep 17 00:00:00 2001 From: Alexander Kabui Date: Tue, 8 Dec 2020 14:38:07 +0300 Subject: add boostrap.min.js to mechanical rob --- test/requests/link_checker.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'test') diff --git a/test/requests/link_checker.py b/test/requests/link_checker.py index 6ac26ba7..abddcd2e 100644 --- a/test/requests/link_checker.py +++ b/test/requests/link_checker.py @@ -116,6 +116,8 @@ def check_packaged_js_files(args_obj, parser): "/js/nvd3/nv.d3.min.css", "/js/qtip2/jquery.qtip.min.js", "/js/js_alt/md5.min.js", + "/js/bootstrap/js/bootstrap.min.js", + ] print("Checking links") -- cgit v1.2.3 From 09e6d353d1808921d4f361d297bf1ef52d2861f3 Mon Sep 17 00:00:00 2001 From: Alexander Kabui Date: Tue, 8 Dec 2020 14:39:44 +0300 Subject: add boostrap css to mechanical rob --- test/requests/link_checker.py | 1 + 1 file changed, 1 insertion(+) (limited to 'test') diff --git a/test/requests/link_checker.py b/test/requests/link_checker.py index abddcd2e..e8a61077 100644 --- a/test/requests/link_checker.py +++ b/test/requests/link_checker.py @@ -117,6 +117,7 @@ def check_packaged_js_files(args_obj, parser): "/js/qtip2/jquery.qtip.min.js", "/js/js_alt/md5.min.js", "/js/bootstrap/js/bootstrap.min.js", + "/css/bootstrap/css/bootstrap.css", ] -- cgit v1.2.3 From 97eecd445a1f006400ba162a848353ca5435148a Mon Sep 17 00:00:00 2001 From: Alexander Kabui Date: Tue, 8 Dec 2020 15:03:12 +0300 Subject: add d3-tip.css to mechanical rob --- test/requests/link_checker.py | 1 + 1 file changed, 1 insertion(+) (limited to 'test') diff --git a/test/requests/link_checker.py b/test/requests/link_checker.py index 6ac26ba7..3e83991a 100644 --- a/test/requests/link_checker.py +++ b/test/requests/link_checker.py @@ -116,6 +116,7 @@ def check_packaged_js_files(args_obj, parser): "/js/nvd3/nv.d3.min.css", "/js/qtip2/jquery.qtip.min.js", "/js/js_alt/md5.min.js", + "/css/d3-tip/d3-tip.css", ] print("Checking links") -- cgit v1.2.3 From ae789135f098573f5a8d3f39d2e6bc72a3cf3f08 Mon Sep 17 00:00:00 2001 From: Alexander Kabui Date: Wed, 9 Dec 2020 14:18:53 +0300 Subject: merge testing --- test/requests/link_checker.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test') diff --git a/test/requests/link_checker.py b/test/requests/link_checker.py index 7c98d5de..5149a991 100644 --- a/test/requests/link_checker.py +++ b/test/requests/link_checker.py @@ -134,7 +134,7 @@ def check_packaged_js_files(args_obj, parser): "/js/cytoscape-qtip/cytoscape-qtip.js", "/css/d3-tip/d3-tip.css", "/js/DataTables/images/sort_asc_disabled.png", - "/js/DataTables/images/sort_desc_disabled.png" + "/js/DataTables/images/sort_desc_disabled.png", ] print("Checking links") -- cgit v1.2.3 From 67ec0db7ef88a4ce49f6f6161bea978674f7123a Mon Sep 17 00:00:00 2001 From: Alexander Kabui Date: Tue, 15 Dec 2020 14:52:39 +0300 Subject: Replace twitter-post-fetcher (#526) * replace twitter fetcher in templates * add twitter post fetcher to mechanical rob Co-authored-by: BonfaceKilz --- test/requests/link_checker.py | 1 + wqflask/wqflask/templates/index_page_orig.html | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/requests/link_checker.py b/test/requests/link_checker.py index 0a371bb8..64707514 100644 --- a/test/requests/link_checker.py +++ b/test/requests/link_checker.py @@ -137,6 +137,7 @@ def check_packaged_js_files(args_obj, parser): "/js/cytoscape-panzoom/cytoscape.js-panzoom.css", "/js/cytoscape-qtip/cytoscape-qtip.js", "/css/d3-tip/d3-tip.css", + "/js/javascript-twitter-post-fetcher/js/twitterFetcher_min.js", "/js/DataTables/images/sort_asc_disabled.png", "/js/DataTables/images/sort_desc_disabled.png", ] diff --git a/wqflask/wqflask/templates/index_page_orig.html b/wqflask/wqflask/templates/index_page_orig.html index 13ca52df..7efbdccf 100755 --- a/wqflask/wqflask/templates/index_page_orig.html +++ b/wqflask/wqflask/templates/index_page_orig.html @@ -326,7 +326,7 @@ } - + - + -- cgit v1.2.3 From e744352ec32809f791754fe7828c7e81813b24c7 Mon Sep 17 00:00:00 2001 From: Alexander Kabui Date: Wed, 16 Dec 2020 14:57:37 +0300 Subject: Replace jquery libs(jquery cookie,jquery ui,jquery js) (#512) * replace jquery-ui in templates * replace jquery-cookie library in templates * replace jquery.min.js in templates * add jquery-ui to mechanical rob * add jquery-cookie to mechanical rob * add jquery min js to mechanical rob Co-authored-by: BonfaceKilz --- test/requests/link_checker.py | 3 +++ wqflask/wqflask/templates/base.html | 6 +++--- wqflask/wqflask/templates/loading.html | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) (limited to 'test') diff --git a/test/requests/link_checker.py b/test/requests/link_checker.py index a22c2b54..eb27d9fe 100644 --- a/test/requests/link_checker.py +++ b/test/requests/link_checker.py @@ -117,6 +117,9 @@ def check_packaged_js_files(args_obj, parser): "/js/nvd3/nv.d3.min.css", "/js/qtip2/jquery.qtip.min.js", "/js/js_alt/md5.min.js", + "/js/jquery-ui/jquery-ui.min.js", + "/js/jquery-cookie/jquery.cookie.js", + "/js/jquery/jquery.min.js", "/js/typeahead/typeahead.bundle.js", "/js/underscore-string/underscore.string.min.js", "/js/js_alt/jstat.min.js", diff --git a/wqflask/wqflask/templates/base.html b/wqflask/wqflask/templates/base.html index bb618294..e368a4be 100644 --- a/wqflask/wqflask/templates/base.html +++ b/wqflask/wqflask/templates/base.html @@ -238,7 +238,7 @@ - + - + - + diff --git a/wqflask/wqflask/templates/loading.html b/wqflask/wqflask/templates/loading.html index 9b335dfe..94e17724 100644 --- a/wqflask/wqflask/templates/loading.html +++ b/wqflask/wqflask/templates/loading.html @@ -38,7 +38,7 @@ - + - + -- cgit v1.2.3 From 218a2aa198cb70761ddd20c94169941f3ea86188 Mon Sep 17 00:00:00 2001 From: Alexander Kabui Date: Wed, 16 Dec 2020 15:03:15 +0300 Subject: Replace zxcvbn async (#524) * replace axcbn-async in templates * add zxcvbn-async.min.js in mechanical rob Co-authored-by: BonfaceKilz --- test/requests/link_checker.py | 1 + wqflask/wqflask/templates/new_security/forgot_password_step2.html | 2 +- wqflask/wqflask/templates/new_security/password_reset.html | 2 +- wqflask/wqflask/templates/new_security/register_user.html | 2 +- wqflask/wqflask/templates/new_security/registered.html | 2 +- wqflask/wqflask/templates/new_security/thank_you.html | 2 +- wqflask/wqflask/templates/new_security/verification_still_needed.html | 2 +- 7 files changed, 7 insertions(+), 6 deletions(-) (limited to 'test') diff --git a/test/requests/link_checker.py b/test/requests/link_checker.py index f73ec185..bc3b5861 100644 --- a/test/requests/link_checker.py +++ b/test/requests/link_checker.py @@ -141,6 +141,7 @@ def check_packaged_js_files(args_obj, parser): "/js/cytoscape-panzoom/cytoscape.js-panzoom.css", "/js/cytoscape-qtip/cytoscape-qtip.js", "/css/d3-tip/d3-tip.css", + "/js/zxcvbn-async/zxcvbn-async.min.js", "/js/javascript-twitter-post-fetcher/js/twitterFetcher_min.js", "/js/DataTables/images/sort_asc_disabled.png", "/js/DataTables/images/sort_desc_disabled.png", diff --git a/wqflask/wqflask/templates/new_security/forgot_password_step2.html b/wqflask/wqflask/templates/new_security/forgot_password_step2.html index 473fa377..5dc424e5 100644 --- a/wqflask/wqflask/templates/new_security/forgot_password_step2.html +++ b/wqflask/wqflask/templates/new_security/forgot_password_step2.html @@ -21,6 +21,6 @@ {% block js %} {% include "new_security/_scripts.html" %} - + {% endblock %} diff --git a/wqflask/wqflask/templates/new_security/password_reset.html b/wqflask/wqflask/templates/new_security/password_reset.html index 7110dc79..4e3ea59f 100644 --- a/wqflask/wqflask/templates/new_security/password_reset.html +++ b/wqflask/wqflask/templates/new_security/password_reset.html @@ -74,6 +74,6 @@ {% block js %} {% include "new_security/_scripts.html" %} - + {% endblock %} diff --git a/wqflask/wqflask/templates/new_security/register_user.html b/wqflask/wqflask/templates/new_security/register_user.html index 325d8aa5..2506f4ee 100644 --- a/wqflask/wqflask/templates/new_security/register_user.html +++ b/wqflask/wqflask/templates/new_security/register_user.html @@ -101,6 +101,6 @@ {% block js %} {% include "new_security/_scripts.html" %} - + {% endblock %} diff --git a/wqflask/wqflask/templates/new_security/registered.html b/wqflask/wqflask/templates/new_security/registered.html index e71d5598..eaed3ed0 100644 --- a/wqflask/wqflask/templates/new_security/registered.html +++ b/wqflask/wqflask/templates/new_security/registered.html @@ -20,6 +20,6 @@ {% block js %} {% include "new_security/_scripts.html" %} - + {% endblock %} diff --git a/wqflask/wqflask/templates/new_security/thank_you.html b/wqflask/wqflask/templates/new_security/thank_you.html index 459bd66a..f492fb51 100644 --- a/wqflask/wqflask/templates/new_security/thank_you.html +++ b/wqflask/wqflask/templates/new_security/thank_you.html @@ -19,6 +19,6 @@ {% block js %} {% include "new_security/_scripts.html" %} - + {% endblock %} diff --git a/wqflask/wqflask/templates/new_security/verification_still_needed.html b/wqflask/wqflask/templates/new_security/verification_still_needed.html index 3aa24e37..91768eb9 100644 --- a/wqflask/wqflask/templates/new_security/verification_still_needed.html +++ b/wqflask/wqflask/templates/new_security/verification_still_needed.html @@ -22,6 +22,6 @@ {% block js %} {% include "new_security/_scripts.html" %} - + {% endblock %} -- cgit v1.2.3 From 6781bda17452ee5b948fd0deb217df464a4a7202 Mon Sep 17 00:00:00 2001 From: Alexanderkabui Date: Thu, 17 Dec 2020 21:12:26 +0300 Subject: add scroller.dataTables.min.css and dataTables.scroller.min.js to mechanical rob --- test/requests/link_checker.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test') diff --git a/test/requests/link_checker.py b/test/requests/link_checker.py index bc3b5861..f162ec84 100644 --- a/test/requests/link_checker.py +++ b/test/requests/link_checker.py @@ -103,9 +103,9 @@ def check_packaged_js_files(args_obj, parser): "/js/DataTablesExtensions/colResize/dataTables.colResize.js", "/js/DataTablesExtensions/colReorder/js/dataTables.colReorder.js", "/js/DataTablesExtensions/buttons/js/buttons.colVis.min.js", - "/js/DataTablesExtensions/scroller/js/scroller.dataTables.min.js", + "/js/DataTablesExtensions/scroller/js/dataTables.scroller.min.js", "/js/DataTables/js/jquery.dataTables.js", - "/css/DataTablesExtensions/scroller/css/scroller.dataTables.min.css", + "/js/DataTablesExtensions/scrollerStyle/css/scroller.dataTables.min.css", # Datatables plugins: "/js/DataTablesExtensions/plugins/sorting/natural.js", "/js/DataTablesExtensions/plugins/sorting/scientific.js", -- cgit v1.2.3 From c76009e7b53ce4cf65110cf220c40cc9154138c1 Mon Sep 17 00:00:00 2001 From: Alexander Kabui Date: Fri, 29 Jan 2021 14:07:33 +0300 Subject: add zxcvbn.js to mechanical rob --- test/requests/link_checker.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test') diff --git a/test/requests/link_checker.py b/test/requests/link_checker.py index 31336967..feae6526 100644 --- a/test/requests/link_checker.py +++ b/test/requests/link_checker.py @@ -143,7 +143,7 @@ def check_packaged_js_files(args_obj, parser): "/js/cytoscape-panzoom/cytoscape.js-panzoom.css", "/js/cytoscape-qtip/cytoscape-qtip.js", "/css/d3-tip/d3-tip.css", - "/js/zxcvbn-async/zxcvbn-async.min.js", + "/js/zxcvbn/zxcvbn.js", "/js/javascript-twitter-post-fetcher/js/twitterFetcher_min.js", "/js/DataTables/images/sort_asc_disabled.png", "/js/DataTables/images/sort_desc_disabled.png", -- cgit v1.2.3 From 06986d1c3a9d76e9e4b0f0d2a7c89746a5a19990 Mon Sep 17 00:00:00 2001 From: Alexander Kabui Date: Tue, 9 Feb 2021 23:28:26 +0300 Subject: add check for broken links in genenetwork homepage --- test/requests/links_scraper/genelinks.py | 92 ++++++++++++++++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 test/requests/links_scraper/genelinks.py (limited to 'test') diff --git a/test/requests/links_scraper/genelinks.py b/test/requests/links_scraper/genelinks.py new file mode 100644 index 00000000..223a2c31 --- /dev/null +++ b/test/requests/links_scraper/genelinks.py @@ -0,0 +1,92 @@ +import re +import requests +import urllib3 +import os +import logging + +from urllib.request import urlopen as uReq +from bs4 import BeautifulSoup as soup +from urllib.parse import urljoin + + +PORT = os.environ.get("PORT", "5004") + + +def test_link(link, strict=True): + print(f"link testing {link}") + results = None + try: + + results = requests.get(link, verify=False, timeout=10) + + except Exception as e: + if strict: + raise SystemExit( + "The link does not exists or is wrongly formatted") + else: + logging.error(f"FAILED:{link} does not exists or is wrongly formatted") + + status_code = results.status_code if results is not None else "404" + + print(f'the link {link} ---> {status_code}') + + +def fetch_css_links(parsed_page): + print("fetching css links") + for link in parsed_page.findAll("link"): + full_path = None + + link_url = link.attrs.get("href") + if re.match(r"^http://", link_url): + pass + # not sure whether to raise an error here for external css links + + elif re.match(r"^/css", link_url) or re.match(r"^/js", link_url): + full_path = urljoin('http://localhost:5004/', link_url) + + if full_path is not None: + test_link(full_path) + + +def fetch_html_links(parsed_page): + print("fetching a tags ") + + for link in parsed_page.findAll("a"): + full_path = None + link_url = link.attrs.get("href") + if re.match(r"^/", link_url): + full_path = urljoin('http://localhost:5004/', link_url) + + elif re.match(r'^http://', link_url): + full_path = link_url + + if full_path is not None: + test_link(full_path) + + +def fetch_script_tags(parsed_page): + print("--->fetching js links") + for link in parsed_page.findAll("script"): + js_link = link.attrs.get("src") + if js_link is not None: + if re.match(r'^http://', js_link): + raise SystemExit("Failed,the library should be packaged in guix.\ + Please contact,http://genenetwork.org/ for more details") + + elif re.match(r"^/css", js_link) or re.match(r"^/js", js_link): + full_path = urljoin('http://localhost:5004/', js_link) + test_link(full_path) + + +def fetch_page_links(page_url): + + urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) + html_page = uReq(page_url) + parsed_page = soup(html_page, "html.parser") + + fetch_script_tags(parsed_page=parsed_page) + fetch_css_links(parsed_page=parsed_page) + fetch_html_links(parsed_page=parsed_page) + + +fetch_page_links(f"http://localhost:{PORT}/") -- cgit v1.2.3 From e1c3827d65a35d87e45cefe04135c1ff16374410 Mon Sep 17 00:00:00 2001 From: Alexander Kabui Date: Thu, 11 Feb 2021 03:26:49 +0300 Subject: add links validator --- test/requests/links_scraper/genelinks.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/requests/links_scraper/genelinks.py b/test/requests/links_scraper/genelinks.py index 223a2c31..5dddcc47 100644 --- a/test/requests/links_scraper/genelinks.py +++ b/test/requests/links_scraper/genelinks.py @@ -7,11 +7,20 @@ import logging from urllib.request import urlopen as uReq from bs4 import BeautifulSoup as soup from urllib.parse import urljoin +from urllib.parse import urlparse PORT = os.environ.get("PORT", "5004") +def is_valid_link(url_link): + try: + result = urlparse(url_link) + return all([result.scheme, result.netloc, result.path]) + except Exception as e: + return False + + def test_link(link, strict=True): print(f"link testing {link}") results = None @@ -57,7 +66,8 @@ def fetch_html_links(parsed_page): if re.match(r"^/", link_url): full_path = urljoin('http://localhost:5004/', link_url) - elif re.match(r'^http://', link_url): + elif is_valid_link(link_url): + print(link_url) full_path = link_url if full_path is not None: -- cgit v1.2.3 From 0cda88d6112ae0e4ae9ef5d4491a2d5695a07330 Mon Sep 17 00:00:00 2001 From: Alexander Kabui Date: Thu, 11 Feb 2021 08:16:33 +0300 Subject: add check for url validity --- test/requests/links_scraper/genelinks.py | 61 ++++++++++++++++++++++---------- 1 file changed, 43 insertions(+), 18 deletions(-) (limited to 'test') diff --git a/test/requests/links_scraper/genelinks.py b/test/requests/links_scraper/genelinks.py index 5dddcc47..3b8ce230 100644 --- a/test/requests/links_scraper/genelinks.py +++ b/test/requests/links_scraper/genelinks.py @@ -12,6 +12,8 @@ from urllib.parse import urlparse PORT = os.environ.get("PORT", "5004") +BROKEN_LINKS = set() + def is_valid_link(url_link): try: @@ -21,23 +23,21 @@ def is_valid_link(url_link): return False -def test_link(link, strict=True): - print(f"link testing {link}") +def test_link(link): + print(f'Checking -->{link}') results = None try: results = requests.get(link, verify=False, timeout=10) + status_code = results.status_code except Exception as e: - if strict: - raise SystemExit( - "The link does not exists or is wrongly formatted") - else: - logging.error(f"FAILED:{link} does not exists or is wrongly formatted") + status_code = 408 - status_code = results.status_code if results is not None else "404" + if int(status_code) > 403: + return True - print(f'the link {link} ---> {status_code}') + return False def fetch_css_links(parsed_page): @@ -46,15 +46,15 @@ def fetch_css_links(parsed_page): full_path = None link_url = link.attrs.get("href") - if re.match(r"^http://", link_url): - pass - # not sure whether to raise an error here for external css links + if is_valid_link(link_url): + full_path = link_url elif re.match(r"^/css", link_url) or re.match(r"^/js", link_url): full_path = urljoin('http://localhost:5004/', link_url) if full_path is not None: - test_link(full_path) + if test_link(full_path): + BROKEN_LINKS.add(full_path) def fetch_html_links(parsed_page): @@ -67,11 +67,11 @@ def fetch_html_links(parsed_page): full_path = urljoin('http://localhost:5004/', link_url) elif is_valid_link(link_url): - print(link_url) full_path = link_url if full_path is not None: - test_link(full_path) + if test_link(full_path): + BROKEN_LINKS.add(full_path) def fetch_script_tags(parsed_page): @@ -79,13 +79,14 @@ def fetch_script_tags(parsed_page): for link in parsed_page.findAll("script"): js_link = link.attrs.get("src") if js_link is not None: - if re.match(r'^http://', js_link): + if is_valid_link(js_link): raise SystemExit("Failed,the library should be packaged in guix.\ Please contact,http://genenetwork.org/ for more details") elif re.match(r"^/css", js_link) or re.match(r"^/js", js_link): full_path = urljoin('http://localhost:5004/', js_link) - test_link(full_path) + if test_link(full_path): + BROKEN_LINKS.add(full_path) def fetch_page_links(page_url): @@ -99,4 +100,28 @@ def fetch_page_links(page_url): fetch_html_links(parsed_page=parsed_page) -fetch_page_links(f"http://localhost:{PORT}/") +def webpages_to_check(): + pages = [ + + "http://localhost:/5004", + + + + + + + ] + + return pages + + +if __name__ == '__main__': + for page in webpages_to_check(): + fetch_page_links(f"http://localhost:{PORT}/") + if BROKEN_LINKS is not None: + print("THE LINKS BELOW ARE BROKEN>>>>>>>>>>>>>") + for link in BROKEN_LINKS: + print(link) + + raise SystemExit( + "The links Above are broken.Please contact genenetwork.org<<<<<<<<") -- cgit v1.2.3 From 5f4ad48a7afaca3cf34266c1012efedb7ef2ec46 Mon Sep 17 00:00:00 2001 From: Alexander Kabui Date: Thu, 11 Feb 2021 08:43:37 +0300 Subject: pep8 formatting --- test/requests/links_scraper/genelinks.py | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) (limited to 'test') diff --git a/test/requests/links_scraper/genelinks.py b/test/requests/links_scraper/genelinks.py index 3b8ce230..00a71d57 100644 --- a/test/requests/links_scraper/genelinks.py +++ b/test/requests/links_scraper/genelinks.py @@ -101,23 +101,14 @@ def fetch_page_links(page_url): def webpages_to_check(): - pages = [ - - "http://localhost:/5004", - - - - - - - ] + pages = [f"http://localhost:{PORT}/"] return pages if __name__ == '__main__': for page in webpages_to_check(): - fetch_page_links(f"http://localhost:{PORT}/") + fetch_page_links(page) if BROKEN_LINKS is not None: print("THE LINKS BELOW ARE BROKEN>>>>>>>>>>>>>") for link in BROKEN_LINKS: -- cgit v1.2.3 From f46991d6751efaac1687c12a74a92d913d61ac54 Mon Sep 17 00:00:00 2001 From: Alexander Kabui Date: Thu, 11 Feb 2021 22:32:56 +0300 Subject: modify code for link_checker --- test/requests/links_scraper/genelinks.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'test') diff --git a/test/requests/links_scraper/genelinks.py b/test/requests/links_scraper/genelinks.py index 00a71d57..ca98f62f 100644 --- a/test/requests/links_scraper/genelinks.py +++ b/test/requests/links_scraper/genelinks.py @@ -109,10 +109,11 @@ def webpages_to_check(): if __name__ == '__main__': for page in webpages_to_check(): fetch_page_links(page) - if BROKEN_LINKS is not None: + if len(BROKEN_LINKS) > 0: print("THE LINKS BELOW ARE BROKEN>>>>>>>>>>>>>") for link in BROKEN_LINKS: print(link) - raise SystemExit( - "The links Above are broken.Please contact genenetwork.org<<<<<<<<") + if len(BROKEN_LINKS) > 0: + raise SystemExit( + "The links Above are broken.Please contact genenetwork.org<<<<<<<<") -- cgit v1.2.3 From b53a8362ba1d3031ece2deefdc3309823b932012 Mon Sep 17 00:00:00 2001 From: Alexander Kabui Date: Thu, 11 Feb 2021 23:11:45 +0300 Subject: add search for templates --- test/requests/links_scraper/genelinks.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'test') diff --git a/test/requests/links_scraper/genelinks.py b/test/requests/links_scraper/genelinks.py index ca98f62f..6a3d363e 100644 --- a/test/requests/links_scraper/genelinks.py +++ b/test/requests/links_scraper/genelinks.py @@ -11,10 +11,25 @@ from urllib.parse import urlparse PORT = os.environ.get("PORT", "5004") +TEMPLATE_PATH = "../wqflask/wqflask/templates" BROKEN_LINKS = set() +def search_templates(): + """searches for broken links in templates""" + html_parsed_pages = [] + for subdir, dirs, files in os.walk(TEMPLATE_PATH): + for file in files: + file_path = os.path.join(subdir, file) + if file_path.endswith(".html"): + parsed_page = soup( + open(file_path, encoding="utf8"), "html.parser") + html_parsed_pages.append(parsed_page) + + return html_parsed_pages + + def is_valid_link(url_link): try: result = urlparse(url_link) @@ -107,6 +122,8 @@ def webpages_to_check(): if __name__ == '__main__': + # results = search_templates() + for page in webpages_to_check(): fetch_page_links(page) if len(BROKEN_LINKS) > 0: -- cgit v1.2.3 From 187415f223b101f8c0b0ac100b2cf8e19c0ad3a5 Mon Sep 17 00:00:00 2001 From: Alexander Kabui Date: Sat, 13 Feb 2021 08:56:36 +0300 Subject: refactor to use idiomatic python --- test/requests/links_scraper/genelinks.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'test') diff --git a/test/requests/links_scraper/genelinks.py b/test/requests/links_scraper/genelinks.py index 6a3d363e..12300f4a 100644 --- a/test/requests/links_scraper/genelinks.py +++ b/test/requests/links_scraper/genelinks.py @@ -49,10 +49,7 @@ def test_link(link): except Exception as e: status_code = 408 - if int(status_code) > 403: - return True - - return False + return int(status_code) > 403 def fetch_css_links(parsed_page): -- cgit v1.2.3