Skip to content

Commit 7b11d00

Browse files
author
Paul K. Korir, PhD
committed
fixed bug: due to condition being ignored because of default value
1 parent a690b7a commit 7b11d00

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
setup(
66
name="sfftk",
7-
version="0.2.0.dev0",
7+
version="0.2.1.dev0",
88
packages=find_packages(),
99
author="Paul K. Korir, PhD",
1010
author_email="pkorir@ebi.ac.uk, paul.korir@gmail.com",

sfftk/notes/modify.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
66
Add, edit and delete terms in EMDB-SFF files
77
"""
8-
from __future__ import division
8+
from __future__ import division, print_function
99

1010
import os
1111
import re
@@ -147,7 +147,7 @@ def add_to_segmentation(self, segmentation):
147147
if self.filePath is not None:
148148
segmentation.filePath = self.filePath
149149
# details
150-
if self.details is not None:
150+
if self.details:
151151
segmentation.details = self.details
152152
# global external references
153153
if self.externalReferences:
@@ -574,14 +574,14 @@ def add_note(args, configs):
574574
# add notes to segmentation
575575
sff_seg = global_note.add_to_segmentation(sff_seg)
576576
# show the updated header
577-
print HeaderView(sff_seg)
577+
print(HeaderView(sff_seg))
578578
else:
579579
found_segment = False
580580
for segment in sff_seg.segments:
581581
if segment.id in args.segment_id:
582582
note = ArgsNote(args, configs)
583583
sff_seg.segment = note.add_to_segment(segment)
584-
print NoteView(sff_seg.segment, _long=True)
584+
print(NoteView(sff_seg.segment, _long=True))
585585
found_segment = True
586586
if not found_segment:
587587
print_date("Segment of ID(s) {} not found".format(", ".join(map(str, args.segment_id))))
@@ -611,14 +611,14 @@ def edit_note(args, configs):
611611
# any additionally specified external references (-E a b -E x y) are inserted after the edited index
612612
sff_seg = global_note.edit_in_segmentation(sff_seg)
613613
#  show the updated header
614-
print HeaderView(sff_seg)
614+
print(HeaderView(sff_seg))
615615
else:
616616
found_segment = False
617617
for segment in sff_seg.segments:
618618
if segment.id in args.segment_id:
619619
note = ArgsNote(args, configs)
620620
sff_seg.segment = note.edit_in_segment(segment)
621-
print NoteView(sff_seg.segment, _long=True)
621+
print(NoteView(sff_seg.segment, _long=True))
622622
found_segment = True
623623
if not found_segment:
624624
print_date("Segment of ID(s) {} not found".format(", ".join(map(str, args.segment_id))))
@@ -644,14 +644,14 @@ def del_note(args, configs):
644644
# delete the notes from segmentation
645645
sff_seg = global_note.del_from_segmentation(sff_seg)
646646
#  show the updated header
647-
print HeaderView(sff_seg)
647+
print(HeaderView(sff_seg))
648648
else:
649649
found_segment = False
650650
for segment in sff_seg.segments:
651651
if segment.id in args.segment_id:
652652
note = ArgsNote(args, configs)
653653
sff_seg.segment = note.del_from_segment(segment)
654-
print NoteView(sff_seg.segment, _long=True)
654+
print(NoteView(sff_seg.segment, _long=True))
655655
found_segment = True
656656
if not found_segment:
657657
print_date("Segment of ID(s) {} not found".format(", ".join(map(str, args.segment_id))))

0 commit comments

Comments
 (0)