def complete_file(self, text, line, *_):
leading = line[len("<STR_LIT>") :]<EOL>curpath = os.path.join(os.path.curdir, leading)<EOL>def isdql(parent, filename):<EOL><INDENT>"""<STR_LIT>"""<EOL>return not filename.startswith("<STR_LIT:.>") and (<EOL>os.path.isdir(os.path.join(parent, filename))<EOL>or filename.lower().endswith("<STR_LIT>")<EOL>)<EOL><DEDENT>def addslash(path):<EOL><INDENT>"""<STR_LIT>"""<EOL>if path.lower().endswith("<STR_LIT>"):<EOL><INDENT>return path + "<STR_LIT:U+0020>"<EOL><DEDENT>else:<EOL><INDENT>return path + "<STR_LIT:/>"<EOL><DEDENT><DEDENT>if not os.path.exists(curpath) or not os.path.isdir(curpath):<EOL><INDENT>curpath = os.path.dirname(curpath)<EOL><DEDENT>return [<EOL>addslash(f)<EOL>for f in os.listdir(curpath)<EOL>if f.startswith(text) and isdql(curpath, f)<EOL>]<EOL>
Autocomplete DQL file lookup