Skip to content

Commit ccd9dc3

Browse files
committed
Resolve pylon convention messages
1 parent 542bbc9 commit ccd9dc3

File tree

1 file changed

+7
-13
lines changed

1 file changed

+7
-13
lines changed

reaper/dicom_reaper.py

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
import logging
55
import datetime
66
import re
7+
from subprocess import Popen, PIPE, STDOUT
78

89
from . import dcm
910
from . import scu
1011
from . import reaper
11-
from subprocess import Popen, PIPE, STDOUT
1212

1313
log = logging.getLogger('reaper.dicom')
1414

@@ -86,28 +86,22 @@ def _custom_acq_uid(self, metadata_map):
8686
if self.uid_ext_command is None:
8787
return
8888
for filepath, metadata in metadata_map.iteritems():
89-
print(filepath)
90-
print(metadata)
9189
dcm_dir = re.sub(r'\.zip$', '', filepath)
9290

9391
unzipped_file = [os.path.join(dcm_dir, filename) for filename in os.listdir(dcm_dir)][0]
9492

9593
formatted_string = self.uid_ext_command.format(unzipped_file)
96-
print(formatted_string)
97-
9894
arg_list = formatted_string.split()
9995

100-
p = Popen(arg_list,
101-
stdout=PIPE,
102-
stderr=STDOUT)
103-
out, _ = p.communicate()
96+
proc = Popen(arg_list,
97+
stdout=PIPE,
98+
stderr=STDOUT)
99+
out, _ = proc.communicate()
104100

105-
if p.returncode and p.returncode != 0:
106-
log.error('Error with command. Return code = %d', p.returncode)
101+
if proc.returncode and proc.returncode != 0:
102+
log.error('Error with command. Return code = %d', proc.returncode)
107103
raise RuntimeError(out)
108-
print(out.rstrip())
109104
metadata['acquisition']['uid'] = out.rstrip()
110-
print(metadata)
111105

112106

113107
def update_arg_parser(ap):

0 commit comments

Comments
 (0)