equal
deleted
inserted
replaced
172 # name metadata, so we use the real file name and extension when |
172 # name metadata, so we use the real file name and extension when |
173 # available. Keeping the extension is useful for example in the case of |
173 # available. Keeping the extension is useful for example in the case of |
174 # PIL processing that use filename extension to detect content-type, as |
174 # PIL processing that use filename extension to detect content-type, as |
175 # well as providing more understandable file names on the fs. |
175 # well as providing more understandable file names on the fs. |
176 basename = [str(entity.eid), attr] |
176 basename = [str(entity.eid), attr] |
177 name = entity.attr_metadata(attr, 'name') |
177 name = entity.cw_attr_metadata(attr, 'name') |
178 if name is not None: |
178 if name is not None: |
179 basename.append(name.encode(self.fsencoding)) |
179 basename.append(name.encode(self.fsencoding)) |
180 fspath = uniquify_path(self.default_directory, '_'.join(basename)) |
180 fspath = uniquify_path(self.default_directory, '_'.join(basename)) |
181 if fspath is None: |
181 if fspath is None: |
182 msg = entity._cw._('failed to uniquify path (%s, %s)') % ( |
182 msg = entity._cw._('failed to uniquify path (%s, %s)') % ( |