(self)
return fname[:255] or 'empty'
Name of the file on the client file system, but normalized to ensure
            file system compatibility. An empty filename is returned as 'empty'.

            Only ASCII letters, digits, dashes, underscores and dots are
            allowed in the final filename. Accents are removed, if possible.
            Whitespace is replaced by a single dash. Leading or tailing dots
            or dashes are removed. The filename is limited to 255 characters.
Name of the file on the client file system, but normalized to ensure
            file system compatibility. An empty filename is returned as 'empty'.
Name of the file on the client file system but normalized to ensure file system compatibility . An empty filename is returned as empty .
def filename(self):
        ''' Name of the file on the client file system, but normalized to ensure
            file system compatibility. An empty filename is returned as 'empty'.

            Only ASCII letters, digits, dashes, underscores and dots are
            allowed in the final filename. Accents are removed, if possible.
            Whitespace is replaced by a single dash. Leading or tailing dots
            or dashes are removed. The filename is limited to 255 characters.
        '''
        fname = self.raw_filename
        if not isinstance(fname, unicode):
            fname = fname.decode('utf8', 'ignore')
        fname = normalize('NFKD', fname).encode('ASCII', 'ignore').decode('ASCII')
        fname = os.path.basename(fname.replace('\\', os.path.sep))
        fname = re.sub(r'[^a-zA-Z0-9-_.\s]', '', fname).strip()
        fname = re.sub(r'[-\s]+', '-', fname).strip('.-')
        return fname[:255] or 'empty'
def filename ( self ) : fname = self . raw_filename if not isinstance ( fname , unicode ) : fname = fname . decode ( 'utf8' , 'ignore' ) fname = normalize ( 'NFKD' , fname ) . encode ( 'ASCII' , 'ignore' ) . decode ( 'ASCII' ) fname = os . path . basename ( fname . replace ( '\\' , os . path . sep ) ) fname = re . sub ( r'[^a-zA-Z0-9-_.\s]' , '' , fname ) . strip ( ) fname = re . sub ( r'[-\s]+' , '-' , fname ) . strip ( '.-' ) return fname [ : 255 ] or 'empty'