@@ -103,10 +103,10 @@ def readdir(self, path, fh):
103
103
if matched_path is None :
104
104
return - errno .ENOENT
105
105
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 ()]
107
107
fnames .append ('.' )
108
108
fnames .append ('..' )
109
- return [ fuse .Direntry (f ) for f in fnames ]
109
+ return [fuse .Direntry (f ) for f in fnames ]
110
110
111
111
def getattr (self , path ):
112
112
logger .debug ('getattr %s' % path )
@@ -115,7 +115,7 @@ def getattr(self, path):
115
115
now = time .time ()
116
116
st = fuse .Stat ()
117
117
if isinstance (matched_path , dict ):
118
- st .st_mode = stat .S_IFDIR | 0755
118
+ st .st_mode = stat .S_IFDIR | 0o755
119
119
st .st_ctime = now
120
120
st .st_mtime = now
121
121
st .st_atime = now
@@ -124,7 +124,7 @@ def getattr(self, path):
124
124
st .st_nlink = len (matched_path )
125
125
return st
126
126
if isinstance (matched_path , str ):
127
- st .st_mode = stat .S_IFREG | 0644
127
+ st .st_mode = stat .S_IFREG | 0o644
128
128
st .st_ctime = now
129
129
st .st_mtime = now
130
130
st .st_atime = now
@@ -134,7 +134,7 @@ def getattr(self, path):
134
134
st .st_nlink = 1
135
135
return st
136
136
if isinstance (matched_path , tuple ):
137
- st .st_mode = stat .S_IFREG | 0644
137
+ st .st_mode = stat .S_IFREG | 0o644
138
138
st .st_ctime = now
139
139
st .st_mtime = now
140
140
st .st_atime = now
@@ -168,7 +168,7 @@ def read(self, path, size, offset, fh):
168
168
logger .debug (size )
169
169
logger .debug (offset )
170
170
logger .debug (fh )
171
- return self .fhs [fh .fno ][offset :offset + size ]
171
+ return self .fhs [fh .fno ][offset :offset + size ]
172
172
173
173
def release (self , path , flags , fh ):
174
174
logger .debug ('release' )
@@ -181,21 +181,21 @@ def release(self, path, flags, fh):
181
181
def get_opt_parser ():
182
182
# use module docstring for help output
183
183
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__ )
187
187
188
188
p .add_options ([
189
189
Option ("-v" , "--verbose" , action = "count" ,
190
190
dest = "verbose" , default = 0 ,
191
191
help = "make noise. Could be specified multiple times" ),
192
- ])
192
+ ])
193
193
194
194
p .add_options ([
195
195
Option ("-L" , "--follow-links" , action = "store_true" ,
196
196
dest = "followlinks" , default = False ,
197
197
help = "Follow symbolic links in DICOM directory" ),
198
- ])
198
+ ])
199
199
return p
200
200
201
201
@@ -208,7 +208,7 @@ def main(args=None):
208
208
logger .setLevel (opts .verbose > 1 and logging .DEBUG or logging .INFO )
209
209
210
210
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 )
212
212
sys .exit (1 )
213
213
214
214
fs = DICOMFS (dash_s_do = 'setsingle' , followlinks = opts .followlinks )
@@ -221,5 +221,3 @@ def main(args=None):
221
221
sys .exit (1 )
222
222
223
223
sys .exit (0 )
224
-
225
- # eof
0 commit comments