Permalink
Browse files

Issue 583

  • Loading branch information...
pyscripter
pyscripter committed Feb 28, 2012
1 parent 5a81807 commit 87ee80a596cd50e2f0da25ef0f5865aa3bf098f9
Showing with 95 additions and 47 deletions.
  1. BIN Lib/rpyc.zip
  2. +1 −0 PyScripter.dproj
  3. +4 −3 cPyDebugger.pas
  4. +5 −4 cPyRemoteDebugger.pas
  5. +84 −40 dmCommands.dfm
  6. +1 −0 frmPyIDEMain.pas
View
Binary file not shown.
View
@@ -100,6 +100,7 @@
<VerInfo_Locale>1033</VerInfo_Locale>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_2_Win32)'!=''">
+ <Debugger_RunParams>--PYTHON27</Debugger_RunParams>
<ILINK_FullDebugInfo>true</ILINK_FullDebugInfo>
<BCC_SourceDebuggingOn>true</BCC_SourceDebuggingOn>
<BCC_DebugLineNumbers>true</BCC_DebugLineNumbers>
View
@@ -239,7 +239,7 @@ function TNameSpaceItem.GetChildCount: integer;
else begin
SuppressOutput := PythonIIForm.OutputSuppressor; // Do not show errors
try
- Result := InternalInterpreter.PyInteractiveInterpreter.membercount(fPyObject, True, False);
+ Result := InternalInterpreter.PyInteractiveInterpreter.membercount(fPyObject, True, False, True);
except
Result := 0;
end;
@@ -269,7 +269,7 @@ procedure TNameSpaceItem.GetChildNodes;
GotChildNodes := True;
SuppressOutput := PythonIIForm.OutputSuppressor; // Do not show errors
try
- FullInfoTuple := InternalInterpreter.PyInteractiveInterpreter.safegetmembersfullinfo(fPyObject, True, False);
+ FullInfoTuple := InternalInterpreter.PyInteractiveInterpreter.safegetmembersfullinfo(fPyObject, True, False, True);
fChildCount := len(FullInfoTuple);
if fChildCount > 0 then begin
@@ -294,7 +294,8 @@ procedure TNameSpaceItem.GetChildNodes;
fChildNodes.AddObject(ObjName, NameSpaceItem);
end;
GetPythonEngine.CheckError;
- fChildNodes.CustomSort(ComparePythonIdents);
+ if (ObjectType <> 'list') and (ObjectType <> 'tuple') then
+ fChildNodes.CustomSort(ComparePythonIdents);
end;
except
fChildCount := 0;
View
@@ -182,7 +182,7 @@ function TRemNameSpaceItem.GetChildCount: integer;
fRemotePython.CheckConnected;
SuppressOutput := PythonIIForm.OutputSuppressor; // Do not show errors
try
- Result := fRemotePython.RPI.membercount(fPyObject, True, False);
+ Result := fRemotePython.RPI.membercount(fPyObject, True, False, True);
except
Result := 0;
end;
@@ -206,9 +206,9 @@ procedure TRemNameSpaceItem.GetChildNodes;
SuppressOutput := PythonIIForm.OutputSuppressor; // Do not show errors
try
if IsProxy then
- FullInfoTuple := fRemotePython.RPI.safegetmembersfullinfo(fPyObject, True, False)
+ FullInfoTuple := fRemotePython.RPI.safegetmembersfullinfo(fPyObject, True, False, True)
else
- FullInfoTuple := InternalInterpreter.PyInteractiveInterpreter.safegetmembersfullinfo(fPyObject, True, False);
+ FullInfoTuple := InternalInterpreter.PyInteractiveInterpreter.safegetmembersfullinfo(fPyObject, True, False, True);
fChildCount := len(FullInfoTuple);
if fChildCount > 0 then begin
@@ -236,7 +236,8 @@ procedure TRemNameSpaceItem.GetChildNodes;
fChildNodes.AddObject(ObjName, NameSpaceItem);
end;
GetPythonEngine.CheckError;
- fChildNodes.CustomSort(ComparePythonIdents);
+ if (ObjectType <> 'list') and (ObjectType <> 'tuple') then
+ fChildNodes.CustomSort(ComparePythonIdents);
end;
except
fChildCount := 0;
View
@@ -1366,15 +1366,17 @@ object CommandsDataModule: TCommandsDataModule
''
' def membercount(self, ob, dictitems = False, expandcommontyp' +
- 'es = True):'
+ 'es = True, sequenceitems = False):'
' # dictitems will be True when used in the Variables win' +
'dow'
' # expandcommontypes will be False when used in the Vari' +
'ables window'
' try:'
- ' if dictitems and isinstance(ob, dict):'
+ ' if sequenceitems and isinstance(ob, (list, tuple)):'
+ ' return len(ob)'
+ ' elif dictitems and isinstance(ob, dict):'
' return len(ob)'
' elif not expandcommontypes and (self.objecttype(ob) ' +
@@ -1387,8 +1389,12 @@ object CommandsDataModule: TCommandsDataModule
''
' def _getmembers(self, ob, dictitems = False, expandcommontyp' +
- 'es = True):'
- ' if dictitems and isinstance(ob, dict):'
+ 'es = True, sequenceitems = False):'
+ ' if sequenceitems and isinstance(ob, (list, tuple)):'
+ ' result = {}'
+ ' for i in range(len(ob)):'
+ ' result[str(i)] = ob[i]'
+ ' elif dictitems and isinstance(ob, dict):'
' result = {}'
' for (i,j) in ob.items():'
' result[self.safestr(i)] = j'
@@ -1407,30 +1413,35 @@ object CommandsDataModule: TCommandsDataModule
''
' def safegetmembers(self, ob, dictitems = False, expandcommon' +
- 'types = True):'
+ 'types = True, sequenceitems = False):'
' try:'
' return self._getmembers(ob, dictitems, expandcommont' +
- 'ypes)'
+ 'ypes, sequenceitems)'
' except:'
' return {}'
''
' def safegetmembersfullinfo(self, ob, dictitems = False, expa' +
- 'ndcommontypes = True):'
+ 'ndcommontypes = True, sequenceitems = False):'
' try:'
' members = self._getmembers(ob, dictitems, expandcomm' +
- 'ontypes)'
+ 'ontypes, sequenceitems)'
' d = {}'
' for (i,j) in members.items():'
' d[i] = (j, self.saferepr(j), self.objecttype(j),' +
' self.objectinfo(j),'
' self.membercount(j, dictitems, expan' +
- 'dcommontypes))'
- ' return tuple(d.items())'
+ 'dcommontypes, sequenceitems))'
+ ' if sequenceitems and isinstance(ob, (list, tuple)):'
+
+ ' return tuple(sorted(d.items(), key = lambda r: i' +
+ 'nt(r[0])))'
+ ' else:'
+ ' return tuple(d.items())'
' except:'
' return ()'
''
@@ -1987,15 +1998,17 @@ object CommandsDataModule: TCommandsDataModule
''
' def membercount(self, ob, dictitems = False, expandcommontyp' +
- 'es = True):'
+ 'es = True, sequenceitems = False):'
' # dictitems will be True when used in the Variables win' +
'dow'
' # expandcommontypes will be False when used in the Vari' +
'ables window'
' try:'
- ' if dictitems and isinstance(ob, dict):'
+ ' if sequenceitems and isinstance(ob, (list, tuple)):'
+ ' return len(ob)'
+ ' elif dictitems and isinstance(ob, dict):'
' return len(ob)'
' elif not expandcommontypes and (self.objecttype(ob) ' +
@@ -2008,8 +2021,12 @@ object CommandsDataModule: TCommandsDataModule
''
' def _getmembers(self, ob, dictitems = False, expandcommontyp' +
- 'es = True):'
- ' if dictitems and isinstance(ob, dict):'
+ 'es = True, sequenceitems = False):'
+ ' if sequenceitems and isinstance(ob, (list, tuple)):'
+ ' result = {}'
+ ' for i in range(len(ob)):'
+ ' result[str(i)] = ob[i]'
+ ' elif dictitems and isinstance(ob, dict):'
' result = {}'
' for (i,j) in ob.items():'
' result[self.safestr(i)] = j'
@@ -2028,30 +2045,35 @@ object CommandsDataModule: TCommandsDataModule
''
' def safegetmembers(self, ob, dictitems = False, expandcommon' +
- 'types = True):'
+ 'types = True, sequenceitems = False):'
' try:'
' return self._getmembers(ob, dictitems, expandcommont' +
- 'ypes)'
+ 'ypes, sequenceitems)'
' except:'
' return {}'
''
' def safegetmembersfullinfo(self, ob, dictitems = False, expa' +
- 'ndcommontypes = True):'
+ 'ndcommontypes = True, sequenceitems = False):'
' try:'
' members = self._getmembers(ob, dictitems, expandcomm' +
- 'ontypes)'
+ 'ontypes, sequenceitems)'
' d = {}'
' for (i,j) in members.items():'
' d[i] = (j, self.saferepr(j), self.objecttype(j),' +
' self.objectinfo(j),'
' self.membercount(j, dictitems, expan' +
- 'dcommontypes))'
- ' return tuple(d.items())'
+ 'dcommontypes, sequenceitems))'
+ ' if sequenceitems and isinstance(ob, (list, tuple)):'
+
+ ' return tuple(sorted(d.items(), key = lambda r: i' +
+ 'nt(r[0])))'
+ ' else:'
+ ' return tuple(d.items())'
' except:'
' return ()'
''
@@ -2481,15 +2503,17 @@ object CommandsDataModule: TCommandsDataModule
''
' def membercount(self, ob, dictitems = False, expandcommontyp' +
- 'es = True):'
+ 'es = True, sequenceitems = False):'
' # dictitems will be True when used in the Variables win' +
'dow'
' # expandcommontypes will be False when used in the Vari' +
'ables window'
' try:'
- ' if dictitems and isinstance(ob, dict):'
+ ' if sequenceitems and isinstance(ob, (list, tuple)):'
+ ' return len(ob)'
+ ' elif dictitems and isinstance(ob, dict):'
' return len(ob)'
' elif not expandcommontypes and (self.objecttype(ob) ' +
@@ -2502,8 +2526,12 @@ object CommandsDataModule: TCommandsDataModule
''
' def _getmembers(self, ob, dictitems = False, expandcommontyp' +
- 'es = True):'
- ' if dictitems and isinstance(ob, dict):'
+ 'es = True, sequenceitems = False):'
+ ' if sequenceitems and isinstance(ob, (list, tuple)):'
+ ' result = {}'
+ ' for i in range(len(ob)):'
+ ' result[str(i)] = ob[i]'
+ ' elif dictitems and isinstance(ob, dict):'
' result = {}'
' for (i,j) in ob.items():'
' result[self.safestr(i)] = j'
@@ -2522,30 +2550,35 @@ object CommandsDataModule: TCommandsDataModule
''
' def safegetmembers(self, ob, dictitems = False, expandcommon' +
- 'types = True):'
+ 'types = True, sequenceitems = False):'
' try:'
' return self._getmembers(ob, dictitems, expandcommont' +
- 'ypes)'
+ 'ypes, sequenceitems)'
' except:'
' return {}'
''
' def safegetmembersfullinfo(self, ob, dictitems = False, expa' +
- 'ndcommontypes = True):'
+ 'ndcommontypes = True, sequenceitems = False):'
' try:'
' members = self._getmembers(ob, dictitems, expandcomm' +
- 'ontypes)'
+ 'ontypes, sequenceitems)'
' d = {}'
' for (i,j) in members.items():'
' d[i] = (j, self.saferepr(j), self.objecttype(j),' +
' self.objectinfo(j),'
' self.membercount(j, dictitems, expan' +
- 'dcommontypes))'
- ' return tuple(d.items())'
+ 'dcommontypes, sequenceitems))'
+ ' if sequenceitems and isinstance(ob, (list, tuple)):'
+
+ ' return tuple(sorted(d.items(), key = lambda r: i' +
+ 'nt(r[0])))'
+ ' else:'
+ ' return tuple(d.items())'
' except:'
' return ()'
''
@@ -3144,15 +3177,17 @@ object CommandsDataModule: TCommandsDataModule
''
' def membercount(self, ob, dictitems = False, expandcommontyp' +
- 'es = True):'
+ 'es = True, sequenceitems = False):'
' # dictitems will be True when used in the Variables win' +
'dow'
' # expandcommontypes will be False when used in the Vari' +
'ables window'
' try:'
- ' if dictitems and isinstance(ob, dict):'
+ ' if sequenceitems and isinstance(ob, (list, tuple)):'
+ ' return len(ob)'
+ ' elif dictitems and isinstance(ob, dict):'
' return len(ob)'
' elif not expandcommontypes and (self.objecttype(ob) ' +
@@ -3165,8 +3200,12 @@ object CommandsDataModule: TCommandsDataModule
''
' def _getmembers(self, ob, dictitems = False, expandcommontyp' +
- 'es = True):'
- ' if dictitems and isinstance(ob, dict):'
+ 'es = True, sequenceitems = False):'
+ ' if sequenceitems and isinstance(ob, (list, tuple)):'
+ ' result = {}'
+ ' for i in range(len(ob)):'
+ ' result[str(i)] = ob[i]'
+ ' elif dictitems and isinstance(ob, dict):'
' result = {}'
' for (i,j) in ob.items():'
' result[self.safestr(i)] = j'
@@ -3185,30 +3224,35 @@ object CommandsDataModule: TCommandsDataModule
''
' def safegetmembers(self, ob, dictitems = False, expandcommon' +
- 'types = True):'
+ 'types = True, sequenceitems = False):'
' try:'
' return self._getmembers(ob, dictitems, expandcommont' +
- 'ypes)'
+ 'ypes, sequenceitems)'
' except:'
' return {}'
''
' def safegetmembersfullinfo(self, ob, dictitems = False, expa' +
- 'ndcommontypes = True):'
+ 'ndcommontypes = True, sequenceitems = False):'
' try:'
' members = self._getmembers(ob, dictitems, expandcomm' +
- 'ontypes)'
+ 'ontypes, sequenceitems)'
' d = {}'
' for (i,j) in members.items():'
' d[i] = (j, self.saferepr(j), self.objecttype(j),' +
' self.objectinfo(j),'
' self.membercount(j, dictitems, expan' +
- 'dcommontypes))'
- ' return tuple(d.items())'
+ 'dcommontypes, sequenceitems))'
+ ' if sequenceitems and isinstance(ob, (list, tuple)):'
+
+ ' return tuple(sorted(d.items(), key = lambda r: i' +
+ 'nt(r[0])))'
+ ' else:'
+ ' return tuple(d.items())'
' except:'
' return ()'
''
View
@@ -361,6 +361,7 @@
New Features
64-bit version released
Recent Projects menu item added
+ Expandable lists and tuples in the Variables window (Issue 583)
Issues addressed
516, 549, 563, 564, 568, 576, 587, 591, 592, 594,
597, 598, 599, 612, 613

0 comments on commit 87ee80a

Please sign in to comment.