Skip to content

Commit

Permalink
fixed bug: due to condition being ignored because of default value
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul K. Korir, PhD committed Apr 5, 2018
1 parent a690b7a commit 7b11d00
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

setup(
name="sfftk",
version="0.2.0.dev0",
version="0.2.1.dev0",
packages=find_packages(),
author="Paul K. Korir, PhD",
author_email="[email protected], [email protected]",
Expand Down
16 changes: 8 additions & 8 deletions sfftk/notes/modify.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Add, edit and delete terms in EMDB-SFF files
"""
from __future__ import division
from __future__ import division, print_function

import os
import re
Expand Down Expand Up @@ -147,7 +147,7 @@ def add_to_segmentation(self, segmentation):
if self.filePath is not None:
segmentation.filePath = self.filePath
# details
if self.details is not None:
if self.details:
segmentation.details = self.details
# global external references
if self.externalReferences:
Expand Down Expand Up @@ -574,14 +574,14 @@ def add_note(args, configs):
# add notes to segmentation
sff_seg = global_note.add_to_segmentation(sff_seg)
# show the updated header
print HeaderView(sff_seg)
print(HeaderView(sff_seg))
else:
found_segment = False
for segment in sff_seg.segments:
if segment.id in args.segment_id:
note = ArgsNote(args, configs)
sff_seg.segment = note.add_to_segment(segment)
print NoteView(sff_seg.segment, _long=True)
print(NoteView(sff_seg.segment, _long=True))
found_segment = True
if not found_segment:
print_date("Segment of ID(s) {} not found".format(", ".join(map(str, args.segment_id))))
Expand Down Expand Up @@ -611,14 +611,14 @@ def edit_note(args, configs):
# any additionally specified external references (-E a b -E x y) are inserted after the edited index
sff_seg = global_note.edit_in_segmentation(sff_seg)
#  show the updated header
print HeaderView(sff_seg)
print(HeaderView(sff_seg))
else:
found_segment = False
for segment in sff_seg.segments:
if segment.id in args.segment_id:
note = ArgsNote(args, configs)
sff_seg.segment = note.edit_in_segment(segment)
print NoteView(sff_seg.segment, _long=True)
print(NoteView(sff_seg.segment, _long=True))
found_segment = True
if not found_segment:
print_date("Segment of ID(s) {} not found".format(", ".join(map(str, args.segment_id))))
Expand All @@ -644,14 +644,14 @@ def del_note(args, configs):
# delete the notes from segmentation
sff_seg = global_note.del_from_segmentation(sff_seg)
#  show the updated header
print HeaderView(sff_seg)
print(HeaderView(sff_seg))
else:
found_segment = False
for segment in sff_seg.segments:
if segment.id in args.segment_id:
note = ArgsNote(args, configs)
sff_seg.segment = note.del_from_segment(segment)
print NoteView(sff_seg.segment, _long=True)
print(NoteView(sff_seg.segment, _long=True))
found_segment = True
if not found_segment:
print_date("Segment of ID(s) {} not found".format(", ".join(map(str, args.segment_id))))
Expand Down

0 comments on commit 7b11d00

Please sign in to comment.