@staticmethod<EOL><INDENT>def load_from_file(filepath):<DEDENT>
class_inst = None<EOL>expected_class = "<STR_LIT>"<EOL>module_name, file_ext = os.path.splitext(os.path.split(filepath)[-<NUM_LIT:1>])<EOL>if file_ext.lower() == "<STR_LIT>":<EOL><INDENT>py_mod = imp.load_source(module_name, filepath)<EOL>if hasattr(py_mod, expected_class):<EOL><INDENT>class_inst = py_mod.Py3status()<EOL><DEDENT><DEDENT>return class_inst<EOL>
Return user-written class object from given path.