[issue24790] Idle: improve stack viewer

2015-08-25 Thread Can İbanoğlu

Can İbanoğlu added the comment:

First of all, sorry for the late reply.

I did try the solution you have proposed which removes the need to click to 
expand the items under globals/locals but as I understand it, you have 
something more in mind for the whole stackviewer UI. Should I still submit a 
patch for this?

As far as the bug is concerned I will look into that next.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24790
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24790] Idle: improve stack viewer

2015-08-19 Thread Can İbanoğlu

Can İbanoğlu added the comment:

Alright, here goes my first patch. I just did what you have pointed out :)

--
keywords: +patch
Added file: http://bugs.python.org/file40213/issue24790.1.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24790
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24790] Idle: improve stack viewer

2015-08-19 Thread Can İbanoğlu

Can İbanoğlu added the comment:

Thank you very much for your thorough input, it is very much appreciated!

Actually one of the first things that I tried was to return stack[1:] to remove 
the target but your suggestion is much better. I did try it and it does work 
and I will provide a patch as soon as I get home. 

I'll start probing the second one then. :)

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24790
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24790] Idle: improve stack viewer

2015-08-19 Thread Can İbanoğlu

Can İbanoğlu added the comment:

I have also prepared a patch for the second item but I don't know if I should 
regenerate the patch after you have committed the first patch so I'm sitting on 
it now. 

I also didn't update the ACKS and NEWS files, should I?

Here's what I did for the second item, just in case you spot something I 
shouldn't be doing:

 sublist = []
 if frame.f_globals is not frame.f_locals:
 item = VariablesTreeItem(locals, frame.f_locals, self.flist)
-sublist.append(item)
-item = VariablesTreeItem(globals, frame.f_globals, self.flist)
+else:
+item = VariablesTreeItem(globals, frame.f_globals, self.flist)
 sublist.append(item)
 return sublist

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24790
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24790] Idle: improve stack viewer

2015-08-19 Thread Can İbanoğlu

Can İbanoğlu added the comment:

Come to think of it, maybe I should send both the second and third items in one 
patch? I could just call the GetSubList method if the VariablesTreeItem is 
being created for locals. Is that a bad approach to take?

Sorry for the sheer number of questions :)

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24790
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24790] Idle: improve stack viewer

2015-08-18 Thread Can İbanoğlu

Can İbanoğlu added the comment:

Hello again,

I have spent some time going over the code and how the PyShell brings all of 
this together and have formed some loose opinions on how to solve these issues 
but I wanted to get a much more informed opinion.

I will provide a patch for the first one first, so right now, all my questions 
are related to that one.

Basically, I have come up with three different places I could patch in 
StackViewer.py to remove idlelib.run.runcode from the stack viewer. 

First option is to patch the constructor of StackTreeItem so that if 
idlelib.run.runcode is in the traceback, it never gets pushed to the stack 
list. I don't like this approach very much because I would essentially be 
removing data from the stack. 

Second option is to patch the GetSubList method so that the iterated variable 
info is checked before constructing a new FrameTreeItem. If 
idlelib.run.runcode is matched, we would just continue to the next value in 
the list. I think this would lead to repetitive code though. We would rewrite 
some of the GetText method of FrameTreeItem and then make a string 
comparison to identify the entry to be removed.

Third option is to call the GetText method after each created FrameTreeItem 
and make the string comparison then. This would add a lot of method calls if 
the stack is long. On the other hand, this approach doesn't repeat any code. 

It is highly possible that I have missed something very simple and elegant :) I 
would very much appreciate your input. I can make upload a patch once I get 
your approval. Which approach would be better here?

Something else that I would like to ask is the preparation of the patch file. 
Should switch to the 3.4 branch and then create the patch or can I do it at the 
dev branch? How would I check if the patch applies to 3.4/3.5/3.6 (apart from 
applying them manually and testing if it has the desired outcome)?

I'm sorry for the wall of text, I'm nervous and I don't want to mess something 
up. :)

Thanks a lot for your assistance.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24790
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24790] Idle: improve stack viewer

2015-08-17 Thread Can İbanoğlu

Can İbanoğlu added the comment:

Hello, 

I'm very interested in tackling this issue but this will be my first 
contribution to Python and I'm quite nervous. I have gone over the developer 
guide and FAQ but I would appreciate if you could let me know if I should 
approach this in a certain way.

--
nosy: +Can İbanoğlu

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24790
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24790] Idle: improve stack viewer

2015-08-17 Thread Can İbanoğlu

Can İbanoğlu added the comment:

It does indeed, thank you very much! I have signed the Contributor Agreement 
and will start working on this right away.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24790
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com