projects
/
htsworkflow.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
bca953e
)
Convert old style except blocks to except Exception as variable: blocks
author
Diane Trout
<diane@ghic.org>
Thu, 29 Jan 2015 00:00:53 +0000
(16:00 -0800)
committer
Diane Trout
<diane@ghic.org>
Thu, 29 Jan 2015 18:46:50 +0000
(10:46 -0800)
27 files changed:
bcmagic/views.py
patch
|
blob
|
history
encode_submission/encode_find.py
patch
|
blob
|
history
experiments/experiments.py
patch
|
blob
|
history
experiments/models.py
patch
|
blob
|
history
htsworkflow/pipelines/configure_run.py
patch
|
blob
|
history
htsworkflow/pipelines/genome_mapper.py
patch
|
blob
|
history
htsworkflow/pipelines/gerald.py
patch
|
blob
|
history
htsworkflow/pipelines/retrieve_config.py
patch
|
blob
|
history
htsworkflow/pipelines/runfolder.py
patch
|
blob
|
history
htsworkflow/pipelines/summary.py
patch
|
blob
|
history
htsworkflow/pipelines/test/test_retrieve_config.py
patch
|
blob
|
history
htsworkflow/submission/daf.py
patch
|
blob
|
history
htsworkflow/submission/submission.py
patch
|
blob
|
history
htsworkflow/submission/ucsc.py
patch
|
blob
|
history
htsworkflow/util/api.py
patch
|
blob
|
history
htsworkflow/util/config_helper.py
patch
|
blob
|
history
htsworkflow/util/hdquery.py
patch
|
blob
|
history
htsworkflow/util/rdfhelp.py
patch
|
blob
|
history
htsworkflow/util/test/test_ethelp.py
patch
|
blob
|
history
htsworkflow/util/test/test_rdfhelp.py
patch
|
blob
|
history
htsworkflow/util/version.py
patch
|
blob
|
history
inventory/models.py
patch
|
blob
|
history
inventory/views.py
patch
|
blob
|
history
samples/auth_backend.py
patch
|
blob
|
history
samples/models.py
patch
|
blob
|
history
samples/test_samples.py
patch
|
blob
|
history
samples/views.py
patch
|
blob
|
history
diff --git
a/bcmagic/views.py
b/bcmagic/views.py
index df860770fc26309dbfe2aa64cc8bceb63b112989..3d9206fec91e52321043f649cfb9937481f0a07e 100644
(file)
--- a/
bcmagic/views.py
+++ b/
bcmagic/views.py
@@
-11,7
+11,7
@@
from . import plugin
try:
import json
try:
import json
-except ImportError
,
e:
+except ImportError
as
e:
import simplejson as json
import re
import simplejson as json
import re
diff --git
a/encode_submission/encode_find.py
b/encode_submission/encode_find.py
index 7589f5487aef5ef85a6c4ec65072aa3d025ef5bc..60e0bee9b5700f8be2a58e7e45480dddf0bd0c6f 100644
(file)
--- a/
encode_submission/encode_find.py
+++ b/
encode_submission/encode_find.py
@@
-566,7
+566,7
@@
def load_library_detail(model, libraryUrn):
try:
body = get_url_as_text(str(libraryUrn.uri), 'GET')
rdfaParser.parse_string_into_model(model, body, libraryUrn.uri)
try:
body = get_url_as_text(str(libraryUrn.uri), 'GET')
rdfaParser.parse_string_into_model(model, body, libraryUrn.uri)
- except httplib2.HttpLib2ErrorWithResponse
,
e:
+ except httplib2.HttpLib2ErrorWithResponse
as
e:
LOGGER.error(str(e))
elif len(results) == 1:
pass # Assuming that a loaded dataset has one record
LOGGER.error(str(e))
elif len(results) == 1:
pass # Assuming that a loaded dataset has one record
diff --git
a/experiments/experiments.py
b/experiments/experiments.py
index a5b8436df567ee7396a46abd9697fcb5c1557f79..b8f905ecf3682d0e59e340b4597c12a17fdc084d 100644
(file)
--- a/
experiments/experiments.py
+++ b/
experiments/experiments.py
@@
-4,7
+4,7
@@
from __future__ import absolute_import, print_function
from datetime import datetime, timedelta
try:
import json
from datetime import datetime, timedelta
try:
import json
-except ImportError
,
e:
+except ImportError
as
e:
import simplejson as json
import os
import simplejson as json
import os
@@
-28,7
+28,7
@@
def flowcell_information(flowcell_id):
"""
try:
fc = FlowCell.objects.get(flowcell_id__startswith=flowcell_id)
"""
try:
fc = FlowCell.objects.get(flowcell_id__startswith=flowcell_id)
- except FlowCell.DoesNotExist
,
e:
+ except FlowCell.DoesNotExist
as
e:
return None
lane_set = {}
return None
lane_set = {}
@@
-126,7
+126,7
@@
def lanes_for_json(request, username):
try:
result = lanes_for(username)
try:
result = lanes_for(username)
- except ObjectDoesNotExist
,
e:
+ except ObjectDoesNotExist
as
e:
raise Http404
#convert query set to python structure
raise Http404
#convert query set to python structure
diff --git
a/experiments/models.py
b/experiments/models.py
index 6b92a1845dc334b2fa6a1ae3e8a68f2371186253..3377e28c38c95354d0e7aa972456fbb1070dd135 100644
(file)
--- a/
experiments/models.py
+++ b/
experiments/models.py
@@
-25,7
+25,7
@@
LOGGER = logging.getLogger(__name__)
default_pM = 5
try:
default_pM = int(settings.DEFAULT_PM)
default_pM = 5
try:
default_pM = int(settings.DEFAULT_PM)
-except AttributeError
,
e:
+except AttributeError
as
e:
LOGGER.error("invalid value for default_pm")
# how many days to wait before trying to re-import a runfolder
LOGGER.error("invalid value for default_pm")
# how many days to wait before trying to re-import a runfolder
diff --git
a/htsworkflow/pipelines/configure_run.py
b/htsworkflow/pipelines/configure_run.py
index 83c7569d2816b03e3a67a3fb4f376589ae472a5f..d0d43d25e579e62e7a7ddceb6774d187457a118b 100644
(file)
--- a/
htsworkflow/pipelines/configure_run.py
+++ b/
htsworkflow/pipelines/configure_run.py
@@
-377,16
+377,16
@@
def retrieve_config(conf_info, flowcell, cfg_filepath, genome_dir):
try:
saveConfigFile(flowcell, options.url, cfg_filepath)
conf_info.config_filepath = cfg_filepath
try:
saveConfigFile(flowcell, options.url, cfg_filepath)
conf_info.config_filepath = cfg_filepath
- except FlowCellNotFound
,
e:
+ except FlowCellNotFound
as
e:
LOGGER.error(e)
return False
LOGGER.error(e)
return False
- except WebError404
,
e:
+ except WebError404
as
e:
LOGGER.error(e)
return False
LOGGER.error(e)
return False
- except IOError
,
e:
+ except IOError
as
e:
LOGGER.error(e)
return False
LOGGER.error(e)
return False
- except Exception
,
e:
+ except Exception
as
e:
LOGGER.error(e)
return False
LOGGER.error(e)
return False
diff --git
a/htsworkflow/pipelines/genome_mapper.py
b/htsworkflow/pipelines/genome_mapper.py
index fb16d7ffc60ed70ce11c10b4a204316de9e3f37e..35830a2dc0a615f917a0a4dac2c3f9b1ea962874 100644
(file)
--- a/
htsworkflow/pipelines/genome_mapper.py
+++ b/
htsworkflow/pipelines/genome_mapper.py
@@
-103,7
+103,7
@@
class constructMapperDict(object):
def get(self, key, default=None):
try:
return self[key]
def get(self, key, default=None):
try:
return self[key]
- except KeyError
,
e:
+ except KeyError
as
e:
return default
def keys(self):
return default
def keys(self):
diff --git
a/htsworkflow/pipelines/gerald.py
b/htsworkflow/pipelines/gerald.py
index 2eaff677e6d90c75848a24a43f4b28fad8d2beff..dd70fe262bbed816e0d0ed38c9ab793dca79281e 100644
(file)
--- a/
htsworkflow/pipelines/gerald.py
+++ b/
htsworkflow/pipelines/gerald.py
@@
-283,7
+283,7
@@
class LaneParametersGA(LaneParameters):
lanes = [x.tag.split('_')[1] for x in container.getchildren()]
try:
index = lanes.index(self._lane_id)
lanes = [x.tag.split('_')[1] for x in container.getchildren()]
try:
index = lanes.index(self._lane_id)
- except ValueError
,
e:
+ except ValueError
as
e:
return None
element = container[index]
return element.text
return None
element = container[index]
return element.text
diff --git
a/htsworkflow/pipelines/retrieve_config.py
b/htsworkflow/pipelines/retrieve_config.py
index 7951752318aebe7d2443c010e64ac24149023167..1d442145ae07f0bd17ac694bd9fd472e45337c04 100644
(file)
--- a/
htsworkflow/pipelines/retrieve_config.py
+++ b/
htsworkflow/pipelines/retrieve_config.py
@@
-49,7
+49,7
@@
def retrieve_flowcell_info(base_host_url, flowcell):
try:
apipayload = urllib.urlencode(apidata)
web = urllib2.urlopen(url, apipayload)
try:
apipayload = urllib.urlencode(apidata)
web = urllib2.urlopen(url, apipayload)
- except urllib2.URLError
,
e:
+ except urllib2.URLError
as
e:
errmsg = 'URLError: %d %s' % (e.code, e.msg)
LOGGER.error(errmsg)
LOGGER.error('opened %s' % (url,))
errmsg = 'URLError: %d %s' % (e.code, e.msg)
LOGGER.error(errmsg)
LOGGER.error('opened %s' % (url,))
diff --git
a/htsworkflow/pipelines/runfolder.py
b/htsworkflow/pipelines/runfolder.py
index 669c5f03363dfc8c647730133af71678319d0336..dfc75f4b0f44492338458df766a6f6c4039fe301 100644
(file)
--- a/
htsworkflow/pipelines/runfolder.py
+++ b/
htsworkflow/pipelines/runfolder.py
@@
-336,7
+336,7
@@
def build_gerald_runs(runs, b, image_analysis, bustard_pathname, datadir, pathna
p.bustard = b
p.gerald = g
runs.append(p)
p.bustard = b
p.gerald = g
runs.append(p)
- except IOError
,
e:
+ except IOError
as
e:
LOGGER.error("Ignoring " + str(e))
return len(runs) - start
LOGGER.error("Ignoring " + str(e))
return len(runs) - start
diff --git
a/htsworkflow/pipelines/summary.py
b/htsworkflow/pipelines/summary.py
index 8f47670d99521f37fc8afe75ab8edf292b4c5396..100b2c0edcf7fd8cae1f48f679b7f673cc8a1c75 100644
(file)
--- a/
htsworkflow/pipelines/summary.py
+++ b/
htsworkflow/pipelines/summary.py
@@
-311,7
+311,7
@@
class LaneResultSummary(object):
variable_name = tags[element.tag]
setattr(self, variable_name,
parse_summary_element(element))
variable_name = tags[element.tag]
setattr(self, variable_name,
parse_summary_element(element))
- except KeyError
,
e:
+ except KeyError
as
e:
LOGGER.warn('Unrecognized tag %s' % (element.tag,))
LOGGER.warn('Unrecognized tag %s' % (element.tag,))
@@
-414,7
+414,7
@@
def tonumber(v):
"""
try:
v = int(v)
"""
try:
v = int(v)
- except ValueError
,
e:
+ except ValueError
as
e:
v = float(v)
return v
v = float(v)
return v
diff --git
a/htsworkflow/pipelines/test/test_retrieve_config.py
b/htsworkflow/pipelines/test/test_retrieve_config.py
index 1a24c633b82314ac40ed933a7bfb2698d27d8510..7ca87905d623e0ff6ce0c5c880851a283490176f 100644
(file)
--- a/
htsworkflow/pipelines/test/test_retrieve_config.py
+++ b/
htsworkflow/pipelines/test/test_retrieve_config.py
@@
-5,7
+5,7
@@
from StringIO import StringIO
try:
import json
try:
import json
-except ImportError
,
e:
+except ImportError
as
e:
import simplejson as json
from django.test import TestCase
import simplejson as json
from django.test import TestCase
diff --git
a/htsworkflow/submission/daf.py
b/htsworkflow/submission/daf.py
index f04ac8fe5328e738a012738a5d256b9307e11504..30edcdc54ba3ca60fc231334c5de2b3a38909568 100644
(file)
--- a/
htsworkflow/submission/daf.py
+++ b/
htsworkflow/submission/daf.py
@@
-300,7
+300,7
@@
class UCSCSubmission(object):
LOGGER.info("Importing %s from %s" % (lib_id, result_dir))
try:
self.import_submission_dir(result_dir, lib_id)
LOGGER.info("Importing %s from %s" % (lib_id, result_dir))
try:
self.import_submission_dir(result_dir, lib_id)
- except MetadataLookupException
,
e:
+ except MetadataLookupException
as
e:
LOGGER.error("Skipping %s: %s" % (lib_id, str(e)))
def import_submission_dir(self, submission_dir, library_id):
LOGGER.error("Skipping %s: %s" % (lib_id, str(e)))
def import_submission_dir(self, submission_dir, library_id):
@@
-531,7
+531,7
@@
class UCSCSubmission(object):
LOGGER.debug("Found: %s" % (literal_re,))
try:
filename_re = re.compile(literal_re)
LOGGER.debug("Found: %s" % (literal_re,))
try:
filename_re = re.compile(literal_re)
- except re.error
,
e:
+ except re.error
as
e:
LOGGER.error("Unable to compile: %s" % (literal_re,))
patterns[literal_re] = view_name
return patterns
LOGGER.error("Unable to compile: %s" % (literal_re,))
patterns[literal_re] = view_name
return patterns
diff --git
a/htsworkflow/submission/submission.py
b/htsworkflow/submission/submission.py
index 897053fbc148477c108d232635958db45488dfc5..cb204557cecf8a74dbd230e9475ad55f76b05e66 100644
(file)
--- a/
htsworkflow/submission/submission.py
+++ b/
htsworkflow/submission/submission.py
@@
-44,7
+44,7
@@
class Submission(object):
LOGGER.info("Importing %s from %s" % (lib_id, result_dir))
try:
self.import_analysis_dir(result_dir, lib_id)
LOGGER.info("Importing %s from %s" % (lib_id, result_dir))
try:
self.import_analysis_dir(result_dir, lib_id)
- except MetadataLookupException
,
e:
+ except MetadataLookupException
as
e:
LOGGER.error("Skipping %s: %s" % (lib_id, str(e)))
def import_analysis_dir(self, analysis_dir, library_id):
LOGGER.error("Skipping %s: %s" % (lib_id, str(e)))
def import_analysis_dir(self, analysis_dir, library_id):
@@
-245,7
+245,7
@@
class Submission(object):
LOGGER.debug("Importing %s" % (lane.uri,))
try:
parser.parse_into_model(self.model, lane.uri)
LOGGER.debug("Importing %s" % (lane.uri,))
try:
parser.parse_into_model(self.model, lane.uri)
- except RDF.RedlandError
,
e:
+ except RDF.RedlandError
as
e:
LOGGER.error("Error accessing %s" % (lane.uri,))
raise e
LOGGER.error("Error accessing %s" % (lane.uri,))
raise e
@@
-286,7
+286,7
@@
class Submission(object):
LOGGER.debug("Found: %s" % (literal_re,))
try:
filename_re = re.compile(literal_re)
LOGGER.debug("Found: %s" % (literal_re,))
try:
filename_re = re.compile(literal_re)
- except re.error
,
e:
+ except re.error
as
e:
LOGGER.error("Unable to compile: %s" % (literal_re,))
patterns[literal_re] = view_name
return patterns
LOGGER.error("Unable to compile: %s" % (literal_re,))
patterns[literal_re] = view_name
return patterns
diff --git
a/htsworkflow/submission/ucsc.py
b/htsworkflow/submission/ucsc.py
index f7734adbd972b26db9150b155a7cdeb39818e0c1..ff717366f2066b14e8f48213834d1ec27001f3e8 100644
(file)
--- a/
htsworkflow/submission/ucsc.py
+++ b/
htsworkflow/submission/ucsc.py
@@
-61,7
+61,7
@@
def get_encodedcc_file_index(genome, composite):
request = urllib2.urlopen(request_url)
file_index = parse_ucsc_file_index(request, base_url)
return file_index
request = urllib2.urlopen(request_url)
file_index = parse_ucsc_file_index(request, base_url)
return file_index
- except urllib2.HTTPError
,
e:
+ except urllib2.HTTPError
as
e:
err = e
pass
err = e
pass
diff --git
a/htsworkflow/util/api.py
b/htsworkflow/util/api.py
index 76ee84dc318005fea7281d6b838244fb869b811f..7abfa2a2266594147946c875a87c85213d3975d0 100644
(file)
--- a/
htsworkflow/util/api.py
+++ b/
htsworkflow/util/api.py
@@
-131,7
+131,7
@@
def retrieve_info(url, apidata):
try:
apipayload = urllib.urlencode(apidata)
web = urllib2.urlopen(url, apipayload)
try:
apipayload = urllib.urlencode(apidata)
web = urllib2.urlopen(url, apipayload)
- except urllib2.URLError
,
e:
+ except urllib2.URLError
as
e:
if hasattr(e, 'code') and e.code == 404:
LOGGER.info("%s was not found" % (url,))
return None
if hasattr(e, 'code') and e.code == 404:
LOGGER.info("%s was not found" % (url,))
return None
@@
-168,7
+168,7
@@
def make_django_secret_key(size=216):
"""return key suitable for use as secret key"""
try:
source = random.SystemRandom()
"""return key suitable for use as secret key"""
try:
source = random.SystemRandom()
- except AttributeError
,
e:
+ except AttributeError
as
e:
source = random.random()
bits = source.getrandbits(size)
chars = []
source = random.random()
bits = source.getrandbits(size)
chars = []
diff --git
a/htsworkflow/util/config_helper.py
b/htsworkflow/util/config_helper.py
index 162580f2765d4cd72a27f16bd7911b4dbf3082ac..4b86da4541de29d3c9430eeb9acd92ca9cbf7b46 100644
(file)
--- a/
htsworkflow/util/config_helper.py
+++ b/
htsworkflow/util/config_helper.py
@@
-39,5
+39,5
@@
class HTSWConfig(ConfigParser.SafeConfigParser):
ini_stream = open(self.filename, 'w')
self.write(ini_stream)
ini_stream.close()
ini_stream = open(self.filename, 'w')
self.write(ini_stream)
ini_stream.close()
- except IOError
,
e:
+ except IOError
as
e:
LOGGER.info("Error saving setting: %s" % (str(e)))
LOGGER.info("Error saving setting: %s" % (str(e)))
diff --git
a/htsworkflow/util/hdquery.py
b/htsworkflow/util/hdquery.py
index 57c05e6025bf847e31e32875f44b34ea49c6adc6..37fd555d3fd6c0f55c2aba2676ceaf62425f309d 100644
(file)
--- a/
htsworkflow/util/hdquery.py
+++ b/
htsworkflow/util/hdquery.py
@@
-23,7
+23,7
@@
try:
# the 2nd of which is the serial number
return data.strip('\x00').split()[1]
# the 2nd of which is the serial number
return data.strip('\x00').split()[1]
-except ImportError
,
e:
+except ImportError
as
e:
print >>sys.stderr, "hdquery requires py_sg"
def get_hd_serial_num(device):
print >>sys.stderr, "hdquery requires py_sg"
def get_hd_serial_num(device):
diff --git
a/htsworkflow/util/rdfhelp.py
b/htsworkflow/util/rdfhelp.py
index 48294416abf1def5a9bc1c3d77b0a4eaa1a607b0..cc16f794ffa9392924880f566a7cbc243c444471 100644
(file)
--- a/
htsworkflow/util/rdfhelp.py
+++ b/
htsworkflow/util/rdfhelp.py
@@
-147,7
+147,7
@@
def fromTypedNode(node):
elif value_type in ('dateTime'):
try:
return datetime.strptime(literal, ISOFORMAT_MS)
elif value_type in ('dateTime'):
try:
return datetime.strptime(literal, ISOFORMAT_MS)
- except ValueError
, _
:
+ except ValueError:
return datetime.strptime(literal, ISOFORMAT_SHORT)
return literal
return datetime.strptime(literal, ISOFORMAT_SHORT)
return literal
@@
-280,7
+280,7
@@
def load_into_model(model, parser_name, path, ns=None):
statements = rdf_parser.parse_as_stream(url, ns)
retries = 0
succeeded = True
statements = rdf_parser.parse_as_stream(url, ns)
retries = 0
succeeded = True
- except RDF.RedlandError
,
e:
+ except RDF.RedlandError
as
e:
errmsg = "RDF.RedlandError: {0} {1} tries remaining"
logger.error(errmsg.format(str(e), retries))
errmsg = "RDF.RedlandError: {0} {1} tries remaining"
logger.error(errmsg.format(str(e), retries))
diff --git
a/htsworkflow/util/test/test_ethelp.py
b/htsworkflow/util/test/test_ethelp.py
index 379dd9e1e525e45bc81e414a60d21b07694d9333..5d982e8a29c200fe49b8393900a13bd600862c9f 100644
(file)
--- a/
htsworkflow/util/test/test_ethelp.py
+++ b/
htsworkflow/util/test/test_ethelp.py
@@
-3,7
+3,7
@@
from unittest import TestCase
try:
from xml.etree import ElementTree
try:
from xml.etree import ElementTree
-except ImportError
,
e:
+except ImportError
as
e:
from elementtree import ElementTree
from htsworkflow.util.ethelp import indent, flatten
from elementtree import ElementTree
from htsworkflow.util.ethelp import indent, flatten
diff --git
a/htsworkflow/util/test/test_rdfhelp.py
b/htsworkflow/util/test/test_rdfhelp.py
index 9694c37e244658b274735603c8723fc9986f3e32..d11d98bb2642ed539f6da544c7057e40e0cfa935 100644
(file)
--- a/
htsworkflow/util/test/test_rdfhelp.py
+++ b/
htsworkflow/util/test/test_rdfhelp.py
@@
-261,7
+261,7
@@
_:a owl:imports "{loc}extra.turtle" .
self.assertTrue(model.contains_statement(s))
self.assertTrue(model.contains_statement(s))
-except ImportError
,
e:
+except ImportError
as
e:
print "Unable to test rdfhelp"
def suite():
print "Unable to test rdfhelp"
def suite():
diff --git
a/htsworkflow/util/version.py
b/htsworkflow/util/version.py
index 8097edbedb8d95acddad2c9626d47050c4d92817..56a1b113513345e0fe4fcf84115d70e86c774379 100644
(file)
--- a/
htsworkflow/util/version.py
+++ b/
htsworkflow/util/version.py
@@
-8,13
+8,13
@@
def version():
version = None
try:
import pkg_resources
version = None
try:
import pkg_resources
- except ImportError
,
e:
+ except ImportError
as
e:
LOGGER.error("Can't find version number, please install setuptools")
raise e
try:
version = pkg_resources.get_distribution("htsworkflow")
LOGGER.error("Can't find version number, please install setuptools")
raise e
try:
version = pkg_resources.get_distribution("htsworkflow")
- except pkg_resources.DistributionNotFound
,
e:
+ except pkg_resources.DistributionNotFound
as
e:
LOGGER.error("Package not installed")
return version
LOGGER.error("Package not installed")
return version
diff --git
a/inventory/models.py
b/inventory/models.py
index deefeedb64e50c37c0855d4c66fb0b24eaf214c9..d41025ad2732953a2bd6091b536c1405791efdf4 100644
(file)
--- a/
inventory/models.py
+++ b/
inventory/models.py
@@
-13,7
+13,7
@@
LOGGER = logging.getLogger(__name__)
try:
import uuid
try:
import uuid
-except ImportError
,
e:
+except ImportError
as
e:
# Some systems are using python 2.4, which doesn't have uuid
# this is a stub
LOGGER.warning('Real uuid is not available, initializing fake uuid module')
# Some systems are using python 2.4, which doesn't have uuid
# this is a stub
LOGGER.warning('Real uuid is not available, initializing fake uuid module')
diff --git
a/inventory/views.py
b/inventory/views.py
index 05f300a08fdde5d4329f26f3d896ea8c2092e5d6..149710ff22466df20da3905a2ccb12180113f434 100644
(file)
--- a/
inventory/views.py
+++ b/
inventory/views.py
@@
-21,7
+21,7
@@
register_search_plugin('Inventory Item', item_search)
try:
import json
try:
import json
-except ImportError
,
e:
+except ImportError
as
e:
import simplejson as json
INVENTORY_CONTEXT_DEFAULTS = {
import simplejson as json
INVENTORY_CONTEXT_DEFAULTS = {
@@
-216,7
+216,7
@@
def item_summary_by_barcode(request, barcode_id, msg=''):
"""
try:
item = Item.objects.get(barcode_id=barcode_id)
"""
try:
item = Item.objects.get(barcode_id=barcode_id)
- except ObjectDoesNotExist
,
e:
+ except ObjectDoesNotExist
as
e:
item = None
return item_summary_by_uuid(request, None, msg, item)
item = None
return item_summary_by_uuid(request, None, msg, item)
@@
-231,7
+231,7
@@
def item_summary_by_uuid(request, uuid, msg='', item=None):
if item is None:
try:
item = Item.objects.get(uuid=uuid)
if item is None:
try:
item = Item.objects.get(uuid=uuid)
- except ObjectDoesNotExist
,
e:
+ except ObjectDoesNotExist
as
e:
item = None
context_dict = {
item = None
context_dict = {
@@
-291,7
+291,7
@@
def item_print(request, uuid):
"""
try:
item = Item.objects.get(uuid=uuid)
"""
try:
item = Item.objects.get(uuid=uuid)
- except ObjectDoesNotExist
,
e:
+ except ObjectDoesNotExist
as
e:
item = None
msg = "Item with UUID %s does not exist" % (uuid)
item = None
msg = "Item with UUID %s does not exist" % (uuid)
@@
-316,7
+316,7
@@
def link_flowcell_and_device(request, flowcell, serial):
# Retrieve Storage Device
try:
sd = Item.objects.get(barcode_id=serial)
# Retrieve Storage Device
try:
sd = Item.objects.get(barcode_id=serial)
- except ObjectDoesNotExist
,
e:
+ except ObjectDoesNotExist
as
e:
msg = "Item with barcode_id of %s not found." % (serial)
raise ObjectDoesNotExist(msg)
msg = "Item with barcode_id of %s not found." % (serial)
raise ObjectDoesNotExist(msg)
@@
-324,7
+324,7
@@
def link_flowcell_and_device(request, flowcell, serial):
# Retrieve FlowCell
try:
fc = FlowCell.objects.get(flowcell_id__startswith=flowcell)
# Retrieve FlowCell
try:
fc = FlowCell.objects.get(flowcell_id__startswith=flowcell)
- except ObjectDoesNotExist
,
e:
+ except ObjectDoesNotExist
as
e:
msg = "FlowCell with flowcell_id of %s not found." % (flowcell)
raise ObjectDoesNotExist(msg)
msg = "FlowCell with flowcell_id of %s not found." % (flowcell)
raise ObjectDoesNotExist(msg)
diff --git
a/samples/auth_backend.py
b/samples/auth_backend.py
index d3f4330bc49385ca4449d1eb75b0496524aab5d5..aacf43b3d3a7b52b5af36983117a0995554ac6e1 100644
(file)
--- a/
samples/auth_backend.py
+++ b/
samples/auth_backend.py
@@
-17,7
+17,7
@@
class HTSUserModelBackend(ModelBackend):
if user.check_password(password):
return user
#except self.user_class.DoesNotExist:
if user.check_password(password):
return user
#except self.user_class.DoesNotExist:
- except Exception
,
e:
+ except Exception
as
e:
logger.error(str(e))
return None
logger.error(str(e))
return None
@@
-25,7
+25,7
@@
class HTSUserModelBackend(ModelBackend):
try:
return self.user_class.objects.get(pk=user_id)
#except self.user_class.DoesNotExist:
try:
return self.user_class.objects.get(pk=user_id)
#except self.user_class.DoesNotExist:
- except Exception
,
e:
+ except Exception
as
e:
logger.error(str(e))
return None
logger.error(str(e))
return None
diff --git
a/samples/models.py
b/samples/models.py
index 5c5c27c951efd831efabaa3e5495e8287dbe20c7..21b6f40f25d71495433bf6c3a3eeeae5f4fa51c0 100644
(file)
--- a/
samples/models.py
+++ b/
samples/models.py
@@
-272,7
+272,7
@@
class Library(models.Model):
adapter_type = self.library_type.id,
multiplex_id = multiplex_id)
return multiplex.sequence
adapter_type = self.library_type.id,
multiplex_id = multiplex_id)
return multiplex.sequence
- except MultiplexIndex.DoesNotExist
,
e:
+ except MultiplexIndex.DoesNotExist
as
e:
return None
def index_sequence_text(self, seperator=' '):
return None
def index_sequence_text(self, seperator=' '):
diff --git
a/samples/test_samples.py
b/samples/test_samples.py
index c339619eb0309ce9dfed96142010309891a7971f..61fc9305cb938382b3fa2205eead9e701cc1d817 100644
(file)
--- a/
samples/test_samples.py
+++ b/
samples/test_samples.py
@@
-276,7
+276,7
@@
try:
libNS = RDF.NS("http://jumpgate.caltech.edu/wiki/LibraryOntology#")
from htsworkflow.util.rdfhelp import dump_model
libNS = RDF.NS("http://jumpgate.caltech.edu/wiki/LibraryOntology#")
from htsworkflow.util.rdfhelp import dump_model
-except ImportError
,
e:
+except ImportError
as
e:
HAVE_RDF = False
HAVE_RDF = False
diff --git
a/samples/views.py
b/samples/views.py
index 79e7856f1041db732a1d3c5020fe8652cc9c82c4..e506c7d68789783e118ca6132d44a7e5e044c549 100644
(file)
--- a/
samples/views.py
+++ b/
samples/views.py
@@
-8,7
+8,7
@@
import sys
try:
import json
try:
import json
-except ImportError
,
e:
+except ImportError
as
e:
import simplejson as json
from django.views.decorators.csrf import csrf_exempt
import simplejson as json
from django.views.decorators.csrf import csrf_exempt
@@
-338,7
+338,7
@@
def _summary_stats(flowcell_id, lane_id, library_id):
summary_list.append(eland_summary)
summary_list.append(eland_summary)
- #except Exception
,
e:
+ #except Exception
as
e:
# summary_list.append("Summary report needs to be updated.")
# LOGGER.error("Exception: " + str(e))
# summary_list.append("Summary report needs to be updated.")
# LOGGER.error("Exception: " + str(e))
@@
-471,7
+471,7
@@
def library_dict(library_id):
"""
try:
lib = Library.objects.get(id=library_id)
"""
try:
lib = Library.objects.get(id=library_id)
- except Library.DoesNotExist
,
e:
+ except Library.DoesNotExist
as
e:
return None
#lane_info = lane_information(lib.lane_set)
return None
#lane_info = lane_information(lib.lane_set)