mirror of
https://github.com/xonsh/xonsh.git
synced 2025-03-05 17:00:58 +01:00
remove a bunch of unused code
This commit is contained in:
parent
410052429c
commit
f5dee4fc5c
1 changed files with 5 additions and 22 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue