From 7dba25bb00c1f502de32a217be074464f3728016 Mon Sep 17 00:00:00 2001 From: Alexander Koshevoy Date: Mon, 2 Jul 2018 16:55:17 +0300 Subject: [PATCH] PY-18029 Remove obsolete todos and commented-out code from .py files --- .../pydev/_pydev_bundle/pydev_console_utils.py | 15 --------------- .../helpers/pydev/_pydevd_bundle/pydevd_thrift.py | 12 ------------ .../helpers/pydev/_pydevd_bundle/pydevd_vars.py | 1 - 3 files changed, 28 deletions(-) diff --git a/python/helpers/pydev/_pydev_bundle/pydev_console_utils.py b/python/helpers/pydev/_pydev_bundle/pydev_console_utils.py index 0e29264bb33f..6bbb8e1a140f 100644 --- a/python/helpers/pydev/_pydev_bundle/pydev_console_utils.py +++ b/python/helpers/pydev/_pydev_bundle/pydev_console_utils.py @@ -255,7 +255,6 @@ class BaseInterpreterInterface: def create_std_in(self, debugger=None, original_std_in=None): if debugger is None: - # @alexander todo fix `StdIn.readline()` return StdIn(self, self.rpc_client, original_stdin=original_std_in) else: return DebugConsoleStdIn(dbg=debugger, original_stdin=original_std_in) @@ -499,10 +498,7 @@ class BaseInterpreterInterface: return pydevd_thrift.frame_vars_to_struct(self.get_namespace(), hidden_ns) def getVariable(self, attributes): - # @alexander todo replace xml with thrift object debug_values = [] - # xml = StringIO.StringIO() - # xml.write("") val_dict = pydevd_vars.resolve_compound_var_object_fields(self.get_namespace(), attributes) if val_dict is None: val_dict = {} @@ -510,14 +506,9 @@ class BaseInterpreterInterface: keys = val_dict.keys() for k in keys: val = val_dict[k] - # evaluate_full_value = pydevd_xml.should_evaluate_full_value(val) - # xml.write(pydevd_vars.var_to_xml(val, k, evaluate_full_value=evaluate_full_value)) evaluate_full_value = pydevd_thrift.should_evaluate_full_value(val) debug_values.append(pydevd_thrift.var_to_struct(val, k, evaluate_full_value=evaluate_full_value)) - # xml.write("") - # - # return xml.getvalue() return debug_values def getArray(self, attr, roffset, coffset, rows, cols, format): @@ -529,13 +520,7 @@ class BaseInterpreterInterface: def evaluate(self, expression): # returns `DebugValue` of evaluated expression - # @alexander todo replace xml with thrift object - # xml = StringIO.StringIO() - # xml.write("") result = pydevd_vars.eval_in_context(expression, self.get_namespace(), self.get_namespace()) - # xml.write(pydevd_vars.var_to_xml(result, expression)) - # xml.write("") - # return xml.getvalue() return [pydevd_thrift.var_to_struct(result, expression)] def do_get_completions(self, text, act_tok): diff --git a/python/helpers/pydev/_pydevd_bundle/pydevd_thrift.py b/python/helpers/pydev/_pydevd_bundle/pydevd_thrift.py index f9aca88a8cd7..c0de1988b17f 100644 --- a/python/helpers/pydev/_pydevd_bundle/pydevd_thrift.py +++ b/python/helpers/pydev/_pydevd_bundle/pydevd_thrift.py @@ -16,18 +16,6 @@ try: except: frame_type = None -## @alexander we do not need xml utility methods now -# try: -# from xml.sax.saxutils import escape -# -# -# def make_valid_xml_value(s): -# return escape(s, {'"': '"'}) -# except: -# # Simple replacement if it's not there. -# def make_valid_xml_value(s): -# return s.replace('<', '<').replace('>', '>').replace('"', '"') - class ExceptionOnEvaluate: def __init__(self, result): diff --git a/python/helpers/pydev/_pydevd_bundle/pydevd_vars.py b/python/helpers/pydev/_pydevd_bundle/pydevd_vars.py index bc574397c656..15cbff88921c 100644 --- a/python/helpers/pydev/_pydevd_bundle/pydevd_vars.py +++ b/python/helpers/pydev/_pydevd_bundle/pydevd_vars.py @@ -878,7 +878,6 @@ def header_data_to_thrift_struct(rows, cols, dtypes, col_bounds, col_to_format, TYPE_TO_THRIFT_STRUCT_CONVERTERS = {"ndarray": array_to_thrift_struct, "DataFrame": dataframe_to_thrift_struct, "Series": dataframe_to_thrift_struct} -# @alexander todo `GetArrayResponse` should be renamed to `ArrayChunk` def table_like_struct_to_thrift_struct(array, name, roffset, coffset, rows, cols, format): # returns `GetArrayResponse` _, type_name, _ = get_type(array)