Skip to content

Commit 7f90116

Browse files
committed
reformatted per Travis CI
1 parent c81afe6 commit 7f90116

File tree

1 file changed

+12
-14
lines changed

1 file changed

+12
-14
lines changed

nibabel/cmdline/dicomfs.py

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,10 @@ def readdir(self, path, fh):
103103
if matched_path is None:
104104
return -errno.ENOENT
105105
logger.debug('matched %s' % (matched_path,))
106-
fnames = [ k.encode('ascii', 'replace') for k in matched_path.keys() ]
106+
fnames = [k.encode('ascii', 'replace') for k in matched_path.keys()]
107107
fnames.append('.')
108108
fnames.append('..')
109-
return [ fuse.Direntry(f) for f in fnames ]
109+
return [fuse.Direntry(f) for f in fnames]
110110

111111
def getattr(self, path):
112112
logger.debug('getattr %s' % path)
@@ -115,7 +115,7 @@ def getattr(self, path):
115115
now = time.time()
116116
st = fuse.Stat()
117117
if isinstance(matched_path, dict):
118-
st.st_mode = stat.S_IFDIR | 0755
118+
st.st_mode = stat.S_IFDIR | 0o755
119119
st.st_ctime = now
120120
st.st_mtime = now
121121
st.st_atime = now
@@ -124,7 +124,7 @@ def getattr(self, path):
124124
st.st_nlink = len(matched_path)
125125
return st
126126
if isinstance(matched_path, str):
127-
st.st_mode = stat.S_IFREG | 0644
127+
st.st_mode = stat.S_IFREG | 0o644
128128
st.st_ctime = now
129129
st.st_mtime = now
130130
st.st_atime = now
@@ -134,7 +134,7 @@ def getattr(self, path):
134134
st.st_nlink = 1
135135
return st
136136
if isinstance(matched_path, tuple):
137-
st.st_mode = stat.S_IFREG | 0644
137+
st.st_mode = stat.S_IFREG | 0o644
138138
st.st_ctime = now
139139
st.st_mtime = now
140140
st.st_atime = now
@@ -168,7 +168,7 @@ def read(self, path, size, offset, fh):
168168
logger.debug(size)
169169
logger.debug(offset)
170170
logger.debug(fh)
171-
return self.fhs[fh.fno][offset:offset+size]
171+
return self.fhs[fh.fno][offset:offset + size]
172172

173173
def release(self, path, flags, fh):
174174
logger.debug('release')
@@ -181,21 +181,21 @@ def release(self, path, flags, fh):
181181
def get_opt_parser():
182182
# use module docstring for help output
183183
p = OptionParser(
184-
usage="%s [OPTIONS] <DIRECTORY CONTAINING DICOMSs> <mount point>"
185-
% os.path.basename(sys.argv[0]),
186-
version="%prog " + nib.__version__)
184+
usage="%s [OPTIONS] <DIRECTORY CONTAINING DICOMSs> <mount point>"
185+
% os.path.basename(sys.argv[0]),
186+
version="%prog " + nib.__version__)
187187

188188
p.add_options([
189189
Option("-v", "--verbose", action="count",
190190
dest="verbose", default=0,
191191
help="make noise. Could be specified multiple times"),
192-
])
192+
])
193193

194194
p.add_options([
195195
Option("-L", "--follow-links", action="store_true",
196196
dest="followlinks", default=False,
197197
help="Follow symbolic links in DICOM directory"),
198-
])
198+
])
199199
return p
200200

201201

@@ -208,7 +208,7 @@ def main(args=None):
208208
logger.setLevel(opts.verbose > 1 and logging.DEBUG or logging.INFO)
209209

210210
if len(files) != 2:
211-
sys.stderr.write("Please provide two arguments:\n%s\n" % parser.usage)
211+
sys.stderr.write("Please provide two arguments:\n%s\n" % parser.usage)
212212
sys.exit(1)
213213

214214
fs = DICOMFS(dash_s_do='setsingle', followlinks=opts.followlinks)
@@ -221,5 +221,3 @@ def main(args=None):
221221
sys.exit(1)
222222

223223
sys.exit(0)
224-
225-
# eof

0 commit comments

Comments
 (0)