@staticmethod
def _get_prefix(path):
    """Get the appropriate prefix for the given file"""
    try:
        idx = path.rindex('/')
    except ValueError:
        try:
            idx = path.index('.')
        except ValueError:
            idx = len(path)
    return path[:idx].strip('/').replace('/', '_')
