aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBonfaceKilz2020-08-19 03:10:33 +0300
committerBonfaceKilz2020-08-19 03:10:33 +0300
commit8be6ecf3d6b70b40be97d4abebb59eabcce8c8f8 (patch)
tree04dea17bec771ad97ea205676bc0c7d1f6ce5e75
parentcaec08fa1e738fa9bc1b0b6bf626d8325f798712 (diff)
downloadgenenetwork2-8be6ecf3d6b70b40be97d4abebb59eabcce8c8f8.tar.gz
Convert the use of iterator’s next() methods to the next() function
Run `2to3-3.8 -f next -w .` See: <https://docs.python.org/2/library/2to3.html#2to3fixer-next>
-rwxr-xr-xscripts/maintenance/delete_genotypes.py2
-rwxr-xr-xscripts/maintenance/load_phenotypes.py10
-rw-r--r--wqflask/wqflask/collect.py2
3 files changed, 7 insertions, 7 deletions
diff --git a/scripts/maintenance/delete_genotypes.py b/scripts/maintenance/delete_genotypes.py
index 060640e1..b7f83758 100755
--- a/scripts/maintenance/delete_genotypes.py
+++ b/scripts/maintenance/delete_genotypes.py
@@ -18,7 +18,7 @@ def main(argv):
# datafile
datafile = open(config.get('config', 'datafile'), 'r')
datafile = csv.reader(datafile, delimiter='\t', quotechar='"')
- datafile.next()
+ next(datafile)
delrowcount = 0
for row in datafile:
if len(row) == 0:
diff --git a/scripts/maintenance/load_phenotypes.py b/scripts/maintenance/load_phenotypes.py
index 61d527d4..759d2eec 100755
--- a/scripts/maintenance/load_phenotypes.py
+++ b/scripts/maintenance/load_phenotypes.py
@@ -22,22 +22,22 @@ def main(argv):
# datafile
datafile = open(config.get('config', 'datafile'), 'r')
phenotypedata = csv.reader(datafile, delimiter='\t', quotechar='"')
- phenotypedata_head = phenotypedata.next()
+ phenotypedata_head = next(phenotypedata)
print(("phenotypedata head:\n\t%s" % phenotypedata_head))
strainnames = phenotypedata_head[1:]
strains = datastructure.get_strains_bynames(inbredsetid=inbredsetid, strainnames=strainnames, updatestrainxref="yes")
# metafile
metafile = open(config.get('config', 'metafile'), 'r')
phenotypemeta = csv.reader(metafile, delimiter='\t', quotechar='"')
- phenotypemeta_head = phenotypemeta.next()
+ phenotypemeta_head = next(phenotypemeta)
print(("phenotypemeta head:\n\t%s" % phenotypemeta_head))
print()
# load
for metarow in phenotypemeta:
#
- datarow_value = phenotypedata.next()
- datarow_se = phenotypedata.next()
- datarow_n = phenotypedata.next()
+ datarow_value = next(phenotypedata)
+ datarow_se = next(phenotypedata)
+ datarow_n = next(phenotypedata)
# Phenotype
sql = """
INSERT INTO Phenotype
diff --git a/wqflask/wqflask/collect.py b/wqflask/wqflask/collect.py
index 42a09fed..4c6e38e6 100644
--- a/wqflask/wqflask/collect.py
+++ b/wqflask/wqflask/collect.py
@@ -193,7 +193,7 @@ def view_collection():
params = request.args
uc_id = params['uc_id']
- uc = (collection for collection in g.user_session.user_collections if collection["id"] == uc_id).next()
+ uc = next((collection for collection in g.user_session.user_collections if collection["id"] == uc_id))
traits = uc["members"]
trait_obs = []