def get_dictionary(self, dict): dict, offset = get_var_and_offset(dict) ret = self.init_dict() for i, (key, val) in enumerate(dict_iter_items(dict)): if i >= offset: if i >= offset + MAX_ITEMS_TO_HANDLE: if not IS_PYCHARM: ret[TOO_LARGE_ATTR] = TOO_LARGE_MSG break # we need to add the id because otherwise we cannot find the real object to get its contents later on. key = '%s (%s)' % (self.key_to_str(key), id(key)) ret[key] = val ret['__len__'] = len(dict) # in case if the class extends built-in type and has some additional fields additional_fields = defaultResolver.get_dictionary(dict) if IS_PYCHARM: if offset == 0: additional_fields.update(ret) ret = additional_fields else: ret.update(additional_fields) return ret
def get_dictionary(self, var): var, offset = get_var_and_offset(var) l = len(var) d = OrderedDict() format_str = '%0' + str(int(len(str(l)))) + 'd' i = 0 for item in var: if i >= offset: if i >= offset + MAX_ITEMS_TO_HANDLE: if not IS_PYCHARM: d[TOO_LARGE_ATTR] = TOO_LARGE_MSG break d[format_str % i] = item i += 1 d['__len__'] = len(var) # in case if the class extends built-in type and has some additional fields additional_fields = defaultResolver.get_dictionary(var) if IS_PYCHARM: if offset == 0: additional_fields['maxlen'] = getattr(var, 'maxlen', None) additional_fields.update(d) d = additional_fields else: d.update(additional_fields) return d
def get_dictionary(self, var): var, offset = get_var_and_offset(var) l = len(var) d = OrderedDict() format_str = '%0' + str(int(len(str(l)))) + 'd' i = 0 for item in var: if i >= offset: if i >= offset + MAX_ITEMS_TO_HANDLE: if not IS_PYCHARM: d[TOO_LARGE_ATTR] = TOO_LARGE_MSG break d[format_str % i] = item i += 1 d['__len__'] = len(var) # in case if the class extends built-in type and has some additional fields additional_fields = defaultResolver.get_dictionary(var) if IS_PYCHARM: if offset == 0: additional_fields['maxlen'] = getattr(var, 'maxlen', None) additional_fields.update(d) d = additional_fields else: d.update(additional_fields) return d
def get_dictionary(self, dict): dict, offset = get_var_and_offset(dict) ret = self.init_dict() for i, (key, val) in enumerate(dict_iter_items(dict)): if i >= offset: if i >= offset + MAX_ITEMS_TO_HANDLE: if not IS_PYCHARM: ret[TOO_LARGE_ATTR] = TOO_LARGE_MSG break # we need to add the id because otherwise we cannot find the real object to get its contents later on. key = '%s (%s)' % (self.key_to_str(key), id(key)) ret[key] = val ret['__len__'] = len(dict) # in case if the class extends built-in type and has some additional fields additional_fields = defaultResolver.get_dictionary(dict) if IS_PYCHARM: if offset == 0: additional_fields.update(ret) ret = additional_fields else: ret.update(additional_fields) return ret
def get_dictionary(self, obj): obj, offset = get_var_and_offset(obj) l = len(obj.items) d = OrderedDict() format_str = '%0' + str(int(len(str(l)))) + 'd' i = offset for item in obj.items[offset:offset + MAX_ITEMS_TO_HANDLE]: d[format_str % i] = item i += 1 if i > MAX_ITEMS_TO_HANDLE + offset: break d['__len__'] = l return d
def get_dictionary(self, obj): obj, offset = get_var_and_offset(obj) l = len(obj.items) d = OrderedDict() format_str = '%0' + str(int(len(str(l)))) + 'd' i = offset for item in obj.items[offset:offset + MAX_ITEMS_TO_HANDLE]: d[format_str % i] = item i += 1 if i > MAX_ITEMS_TO_HANDLE + offset: break d['__len__'] = l return d
def get_dictionary(self, var): var, offset = get_var_and_offset(var) d = OrderedDict() i = 0 for item in var: if i >= offset: if i >= offset + MAX_ITEMS_TO_HANDLE: if not IS_PYCHARM: d[TOO_LARGE_ATTR] = TOO_LARGE_MSG break d[str(id(item))] = item i += 1 d['__len__'] = len(var) # in case if the class extends built-in type and has some additional fields additional_fields = defaultResolver.get_dictionary(var) if IS_PYCHARM: if offset == 0: additional_fields.update(d) d = additional_fields else: d.update(additional_fields) return d
def get_dictionary(self, var): var, offset = get_var_and_offset(var) d = OrderedDict() i = 0 for item in var: if i >= offset: if i >= offset + MAX_ITEMS_TO_HANDLE: if not IS_PYCHARM: d[TOO_LARGE_ATTR] = TOO_LARGE_MSG break d[str(id(item))] = item i += 1 d['__len__'] = len(var) # in case if the class extends built-in type and has some additional fields additional_fields = defaultResolver.get_dictionary(var) if IS_PYCHARM: if offset == 0: additional_fields.update(d) d = additional_fields else: d.update(additional_fields) return d