removed obsolete functions

This commit is contained in:
laerus 2016-07-18 21:41:22 +03:00
parent 1141d4cf89
commit 39ca37b51c
2 changed files with 4 additions and 44 deletions

View file

@ -17,9 +17,8 @@ from xonsh.tools import (
dynamic_cwd_tuple_to_str, ensure_slice, ensure_string,
env_path_to_str, escape_windows_cmd_string, executables_in,
expand_case_matching, find_next_break, iglobpath, is_bool, is_bool_or_int,
is_callable, is_dynamic_cwd_width, is_env_path, is_float, is_int,
is_int_as_str, is_logfile_opt, is_slice_as_str, is_string,
is_string_or_callable, logfile_opt_to_str, str_to_env_path,
is_callable, is_dynamic_cwd_width, is_env_path, is_float, is_int, is_logfile_opt,
is_string_or_callable, logfile_opt_to_str, str_to_env_path, is_string,
subexpr_from_unbalanced, subproc_toks, to_bool, to_bool_or_int,
to_dynamic_cwd_tuple, to_logfile_opt, pathsep_to_set, set_to_pathsep,
is_string_seq, pathsep_to_seq, seq_to_pathsep, is_nonstring_seq_of_strings,
@ -348,22 +347,6 @@ def test_is_int(inp, exp):
assert exp == obs
@pytest.mark.parametrize('inp, exp', [
('42', True),
('42.0', False),
(42, False),
([42], False),
([], False),
(None, False),
('', False),
(False, False),
(True, False),
])
def test_is_int_as_str(inp, exp):
obs = is_int_as_str(inp)
assert exp == obs
@pytest.mark.parametrize('inp, exp', [
(42.0, True),
(42.000101010010101010101001010101010001011100001101101011100, True),
@ -382,29 +365,6 @@ def test_is_float(inp, exp):
assert exp == obs
@pytest.mark.parametrize('inp, exp', [
(42, False),
(None, False),
('42', False),
('-42', False),
(slice(1,2,3), False),
([], False),
(False, False),
(True, False),
('1:2:3', True),
('1::3', True),
('1:', True),
(':', True),
('[1:2:3]', True),
('(1:2:3)', True),
('r', False),
('r:11', False),
])
def test_is_slice_as_str(inp, exp):
obs = is_slice_as_str(inp)
assert exp == obs
def test_is_string_true():
assert is_string('42.0')

View file

@ -17,7 +17,7 @@ import collections.abc as abc
from xonsh.lazyasd import LazyObject, lazyobject
from xonsh.lazyjson import LazyJSON, ljdump, LJNode
from xonsh.tools import (ensure_int_or_slice, to_history_tuple,
from xonsh.tools import (ensure_slice, to_history_tuple,
expanduser_abs_path)
from xonsh.diff_history import _dh_create_parser, _dh_main_action
@ -466,7 +466,7 @@ def _hist_show(ns=None, hist=None, start_index=None, end_index=None,
print("Invalid end time, must be float or datetime.")
idx = None
if ns:
idx = ensure_int_or_slice(ns.n)
idx = ensure_slice(ns.n)
if idx is False:
print("{} is not a valid input.".format(ns.n),
file=sys.stderr)