remove a bunch of unused code

This commit is contained in:
adam j hartz 2016-06-03 12:57:52 -04:00
parent 410052429c
commit f5dee4fc5c

View file

@ -1,25 +1,9 @@
# -*- coding: utf-8 -*-
"""A (tab-)completer for xonsh."""
import os
import re
import ast
import sys
import shlex
import pickle
import inspect
import builtins
import importlib
import subprocess
from pathlib import Path
from collections import Sequence
from xonsh.built_ins import iglobpath, expand_path
from xonsh.platform import ON_WINDOWS
from xonsh.tools import (subexpr_from_unbalanced, get_sep,
check_for_partial_string, RE_STRING_START)
from xonsh.completers import completers
class Completer(object):
"""This provides a list of optional completions for the xonsh shell."""
@ -48,15 +32,14 @@ class Completer(object):
Length of the prefix to be replaced in the completion
(only used with prompt_toolkit)
"""
space = ' ' # intern some strings for faster appending
ctx = ctx or {}
empty_set = set()
for name, func in builtins.__xonsh_completers__.items():
o = func(prefix, line, begidx, endidx, ctx)
if isinstance(o, Sequence):
res, lprefix = o
for func in builtins.__xonsh_completers__.values():
out = func(prefix, line, begidx, endidx, ctx)
if isinstance(out, Sequence):
res, lprefix = out
else:
res = o
res = out
lprefix = len(prefix)
if res is not None and res != empty_set:
return tuple(sorted(res)), lprefix