equal
deleted
inserted
replaced
148 # name metadata, so we use the real file name and extension when |
148 # name metadata, so we use the real file name and extension when |
149 # available. Keeping the extension is useful for example in the case of |
149 # available. Keeping the extension is useful for example in the case of |
150 # PIL processing that use filename extension to detect content-type, as |
150 # PIL processing that use filename extension to detect content-type, as |
151 # well as providing more understandable file names on the fs. |
151 # well as providing more understandable file names on the fs. |
152 basename = [str(entity.eid), attr] |
152 basename = [str(entity.eid), attr] |
153 name = entity.attr_metadata(attr, 'name') |
153 name = entity.cw_attr_metadata(attr, 'name') |
154 if name is not None: |
154 if name is not None: |
155 basename.append(name.encode(self.fsencoding)) |
155 basename.append(name.encode(self.fsencoding)) |
156 fspath = uniquify_path(self.default_directory, '_'.join(basename)) |
156 fspath = uniquify_path(self.default_directory, '_'.join(basename)) |
157 if fspath is None: |
157 if fspath is None: |
158 msg = entity._cw._('failed to uniquify path (%s, %s)') % ( |
158 msg = entity._cw._('failed to uniquify path (%s, %s)') % ( |