@staticmethod<EOL><INDENT>def search_conf_item(start_path, item_type, item_name):<DEDENT>
dir_path = os.path.dirname(os.path.abspath(start_path))<EOL>target_file = os.path.join(dir_path, "<STR_LIT>")<EOL>if os.path.isfile(target_file):<EOL><INDENT>imported_module = ModuleUtils.get_imported_module_from_file(target_file)<EOL>items_dict = ModuleUtils.filter_module(imported_module, item_type)<EOL>if item_name in items_dict:<EOL><INDENT>return items_dict[item_name]<EOL><DEDENT>else:<EOL><INDENT>return ModuleUtils.search_conf_item(dir_path, item_type, item_name)<EOL><DEDENT><DEDENT>if dir_path == start_path:<EOL><INDENT>err_msg = "<STR_LIT>".format(item_name)<EOL>if item_type == "<STR_LIT>":<EOL><INDENT>raise p_exception.FunctionNotFound(err_msg)<EOL><DEDENT>else:<EOL><INDENT>raise p_exception.VariableNotFound(err_msg)<EOL><DEDENT><DEDENT>return ModuleUtils.search_conf_item(dir_path, item_type, item_name)<EOL>
search expected function or variable recursive upward
        @param
            start_path: search start path
            item_type: "function" or "variable"
            item_name: function name or variable name
        e.g.
            search_conf_item('C:/Users/RockFeng/Desktop/s/preference.py','function','test_func')