(filename, project_name=None)
return result
Extract name, version, python version from a filename (no extension)

    Return name, version, pyver or None
Extract name, version, python version from a filename (no extension)
Extract name version python version from a filename ( no extension )
def split_filename(filename, project_name=None):
    """
    Extract name, version, python version from a filename (no extension)

    Return name, version, pyver or None
    """
    result = None
    pyver = None
    filename = unquote(filename).replace(' ', '-')
    m = PYTHON_VERSION.search(filename)
    if m:
        pyver = m.group(1)
        filename = filename[:m.start()]
    if project_name and len(filename) > len(project_name) + 1:
        m = re.match(re.escape(project_name) + r'\b', filename)
        if m:
            n = m.end()
            result = filename[:n], filename[n + 1:], pyver
    if result is None:
        m = PROJECT_NAME_AND_VERSION.match(filename)
        if m:
            result = m.group(1), m.group(3), pyver
    return result
def split_filename ( filename , project_name = None ) : result = None pyver = None filename = unquote ( filename ) . replace ( ' ' , '-' ) m = PYTHON_VERSION . search ( filename ) if m : pyver = m . group ( 1 ) filename = filename [ : m . start ( ) ] if project_name and len ( filename ) > len ( project_name ) + 1 : m = re . match ( re . escape ( project_name ) + r'\b' , filename ) if m : n = m . end ( ) result = filename [ : n ] , filename [ n + 1 : ] , pyver if result is None : m = PROJECT_NAME_AND_VERSION . match ( filename ) if m : result = m . group ( 1 ) , m . group ( 3 ) , pyver return result