Permalink
Browse files

Fix PEP8 E271, E272 and a few cases of E701.

E271 multiple spaces after keyword
E272 multiple spaces before keyword
E701 multiple statements on one line (colon)
  • Loading branch information...
1 parent 536cc0e commit d3ad376b92db375cb7afff8eee11b34855deb95b @cbrueffer cbrueffer committed Dec 3, 2012
Showing with 31 additions and 15 deletions.
  1. +1 −1 Bio/AlignIO/StockholmIO.py
  2. +1 −1 Bio/SCOP/Raf.py
  3. +2 −2 Bio/SeqIO/UniprotIO.py
  4. +1 −1 Bio/SwissProt/__init__.py
  5. +1 −1 Bio/_py3k/_ordereddict.py
  6. +24 −8 BioSQL/BioSeq.py
  7. +1 −1 Tests/test_seq.py
@@ -194,7 +194,7 @@ def _write_record(self, record):
seq_name = seq_name.replace(" ","_")
if "start" in record.annotations \
- and "end" in record.annotations:
+ and "end" in record.annotations:
suffix = "/%s-%s" % (str(record.annotations["start"]),
str(record.annotations["end"]))
if seq_name[-len(suffix):] != suffix:
View
@@ -172,7 +172,7 @@ def _process(self, line):
self.version = line[6:10]
#Raf format versions 0.01 and 0.02 are identical for practical purposes
- if(self.version != "0.01" and self.version !="0.02"):
+ if(self.version != "0.01" and self.version !="0.02"):
raise ValueError("Incompatible RAF version: "+self.version)
self.pdb_datestamp = line[14:20]
View
@@ -329,7 +329,7 @@ def _parse_dbReference(element):
feature.location = SeqFeature.FeatureLocation(start, end)
#self.ParsedSeqRecord.features.append(feature)
- for ref_element in element.getchildren():
+ for ref_element in element.getchildren():
if ref_element.tag == NS + 'property':
pass# this data cannot be fitted in a seqrecord object with a simple list. however at least ensembl and EMBL parsing can be improved to add entries in dbxrefs
@@ -442,7 +442,7 @@ def _parse_proteinExistence(element):
append_to_annotations('proteinExistence', element.attrib['type'])
def _parse_evidence(element):
- for k, v in element.attrib.items():
+ for k, v in element.attrib.items():
ann_key = k
append_to_annotations(ann_key, v)
@@ -362,7 +362,7 @@ def _read_dt(record, line):
# Re-use the historical property names, even though
# the meaning has changed slighty:
- if "INTEGRATED" in uprline:
+ if "INTEGRATED" in uprline:
record.created = date, version
elif 'SEQUENCE VERSION' in uprline:
record.sequence_update = date, version
@@ -117,7 +117,7 @@ def __eq__(self, other):
if isinstance(other, OrderedDict):
if len(self) != len(other):
return False
- for p, q in zip(self.items(), other.items()):
+ for p, q in zip(self.items(), other.items()):
if p != q:
return False
return True
View
@@ -497,16 +497,24 @@ def __get_seq(self):
if not hasattr(self, "_seq"):
self._seq = _retrieve_seq(self._adaptor, self._primary_id)
return self._seq
- def __set_seq(self, seq): self._seq = seq
- def __del_seq(self): del self._seq
+
+ def __set_seq(self, seq):
+ self._seq = seq
+
+ def __del_seq(self):
+ del self._seq
seq = property(__get_seq, __set_seq, __del_seq, "Seq object")
def __get_dbxrefs(self):
if not hasattr(self,"_dbxrefs"):
self._dbxrefs = _retrieve_dbxrefs(self._adaptor, self._primary_id)
return self._dbxrefs
- def __set_dbxrefs(self, dbxrefs): self._dbxrefs = dbxrefs
- def __del_dbxrefs(self): del self._dbxrefs
+
+ def __set_dbxrefs(self, dbxrefs):
+ self._dbxrefs = dbxrefs
+
+ def __del_dbxrefs(self):
+ del self._dbxrefs
dbxrefs = property(__get_dbxrefs, __set_dbxrefs, __del_dbxrefs,
"Database cross references")
@@ -515,8 +523,12 @@ def __get_features(self):
self._features = _retrieve_features(self._adaptor,
self._primary_id)
return self._features
- def __set_features(self, features): self._features = features
- def __del_features(self): del self._features
+
+ def __set_features(self, features):
+ self._features = features
+
+ def __del_features(self):
+ del self._features
features = property(__get_features, __set_features, __del_features,
"Features")
@@ -530,7 +542,11 @@ def __get_annotations(self):
if self._division:
self._annotations["data_file_division"] = self._division
return self._annotations
- def __set_annotations(self, annotations): self._annotations = annotations
- def __del_annotations(self): del self._annotations
+
+ def __set_annotations(self, annotations):
+ self._annotations = annotations
+
+ def __del_annotations(self):
+ del self._annotations
annotations = property(__get_annotations, __set_annotations,
__del_annotations, "Annotations")
View
@@ -250,7 +250,7 @@
except TypeError:
pass #Good!
- for chars in test_chars:
+ for chars in test_chars:
str_chars = str(chars)
assert str(a.strip(chars)) == str(a).strip(str_chars)
assert str(a.lstrip(chars)) == str(a).lstrip(str_chars)

0 comments on commit d3ad376

Please sign in to comment.