def get_backends():
IGNORE_DIRS = ["<STR_LIT>", "<STR_LIT>", "<STR_LIT>"]<EOL>global backends<EOL>if backends is None:<EOL><INDENT>backends = {}<EOL>i3pystatus_dir = os.path.dirname(i3pystatus.__file__)<EOL>subdirs = [<EOL>x<EOL>for x in next(os.walk(i3pystatus_dir))[<NUM_LIT:1>]<EOL>if not x.startswith("<STR_LIT:_>") and x not in IGNORE_DIRS<EOL>]<EOL>for subdir in subdirs:<EOL><INDENT>dirs = next(os.walk(os.path.join(i3pystatus_dir, subdir)))[<NUM_LIT:2>]<EOL>backends.update(<EOL>{<EOL>x[:-<NUM_LIT:3>]: "<STR_LIT>" % (subdir, x[:-<NUM_LIT:3>])<EOL>for x in dirs<EOL>if not x.startswith("<STR_LIT:_>") and x.endswith("<STR_LIT>")<EOL>}<EOL>)<EOL><DEDENT><DEDENT>return backends<EOL>
Get backends info so that we can find the correct one.
We just look in the directory structure to find modules.