setattr(__builtin__, 'False', 0)
import pydevd_constants
-from pydevd_constants import DictIterItems, xrange
+from pydevd_constants import DictIterItems, DictKeys, xrange
# Note: 300 is already a lot to see in the outline (after that the user should really use the shell to get things)
class NdArrayItemsContainer: pass
+
+#=======================================================================================================================
+# MultiValueDictResolver
+#=======================================================================================================================
+class MultiValueDictResolver(DictResolver):
+
+ def resolve(self, dict, key):
+ if key in ('__len__', TOO_LARGE_ATTR):
+ return None
+
+ #ok, we have to iterate over the items to find the one that matches the id, because that's the only way
+ #to actually find the reference from the string we have before.
+ expected_id = int(key.split('(')[-1][:-1])
+ for key in DictKeys(dict):
+ val = dict.getlist(key)
+ if id(key) == expected_id:
+ return val
+
+ raise UnableToResolveVariableException()
+
+ def getDictionary(self, dict):
+ ret = {}
+ i = 0
+ for key in DictKeys(dict):
+ val = dict.getlist(key)
+ i += 1
+ #we need to add the id because otherwise we cannot find the real object to get its contents later on.
+ key = '%s (%s)' % (self.keyStr(key), id(key))
+ ret[key] = val
+ if i > MAX_ITEMS_TO_HANDLE:
+ ret[TOO_LARGE_ATTR] = TOO_LARGE_MSG
+ break
+
+ ret['__len__'] = len(dict)
+ return ret
+
+
#=======================================================================================================================
# FrameResolver
#=======================================================================================================================
jyArrayResolver = JyArrayResolver()
setResolver = SetResolver()
ndarrayResolver = NdArrayResolver()
+multiValueDictResolver = MultiValueDictResolver()
frameResolver = FrameResolver()
#------------------------------------------------------------------------------------------------------ resolvers in map
if not sys.platform.startswith("java"):
+
typeMap = [
#None means that it should not be treated as a compound variable
except:
pass #numpy may not be installed
+ try:
+ from django.utils.datastructures import MultiValueDict
+ typeMap.insert(0, (MultiValueDict, pydevd_resolver.multiValueDictResolver))
+ #we should put it before dict
+ except:
+ pass #django may not be installed
+
if frame_type is not None:
typeMap.append((frame_type, pydevd_resolver.frameResolver))