Skip to content

Commit 542bbc9

Browse files
committed
Resolve pylon and pep8 errors
1 parent 10a4867 commit 542bbc9

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

reaper/dcm.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
"""SciTran Reaper DICOM utility functions"""
22

33
import os
4-
import shutil
54
import hashlib
65
import logging
76
import datetime

reaper/dicom_reaper.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import logging
55
import datetime
66
import re
7-
import zipfile
87

98
from . import dcm
109
from . import scu
@@ -89,30 +88,28 @@ def _custom_acq_uid(self, metadata_map):
8988
for filepath, metadata in metadata_map.iteritems():
9089
print(filepath)
9190
print(metadata)
92-
dcm_dir = re.sub('\.zip$','',filepath)
91+
dcm_dir = re.sub(r'\.zip$', '', filepath)
9392

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

9695
formatted_string = self.uid_ext_command.format(unzipped_file)
9796
print(formatted_string)
9897

99-
10098
arg_list = formatted_string.split()
10199

102100
p = Popen(arg_list,
103-
stdout=PIPE,
104-
stderr=STDOUT)
101+
stdout=PIPE,
102+
stderr=STDOUT)
105103
out, _ = p.communicate()
106104

107105
if p.returncode and p.returncode != 0:
108-
log.error('Error with command. Return code = {0}'.format(p.returncode))
106+
log.error('Error with command. Return code = %d', p.returncode)
109107
raise RuntimeError(out)
110108
print(out.rstrip())
111109
metadata['acquisition']['uid'] = out.rstrip()
112110
print(metadata)
113111

114112

115-
116113
def update_arg_parser(ap):
117114
# pylint: disable=missing-docstring
118115
ap.add_argument('host', help='remote hostname or IP')
@@ -122,7 +119,10 @@ def update_arg_parser(ap):
122119
ap.add_argument('aec', help='remote AE title')
123120

124121
ap.add_argument('-A', '--no-anonymize', dest='anonymize', action='store_false', help='do not anonymize patient name and birthdate')
125-
ap.add_argument('--uid-ext-command', dest='uid_ext_command', help='Command to execute against single source file to generate acquisition uid', default=None)
122+
ap.add_argument('--uid-ext-command',
123+
dest='uid_ext_command',
124+
help='Command to execute against single source file to generate acquisition uid',
125+
default=None)
126126

127127
return ap
128128

0 commit comments

Comments
 (0)