[IPython-dev] IPythonQt development update

Gerardo Gutierrez muzgash.lists at gmail.com
Wed Jun 23 04:28:45 EDT 2010


Hi everyone.
I'm sorry I haven't been in contact later, just thinking (erroneously) that
I needed to have something nicely working for you guys, but you're really
the help I need and the decision makers.

So, something (not working as planned) is in git at github.com:
muzgash/ipython.git
You have to install pyzmq and I think that with python-qt4-dev and
pyqt4-dev-tools also will be enough.
The frontend have pure graphical features working well (until someone finds
a bug :p ) however, I have some problems trying to run several lines, I
think I don't understand well this piece of code from the frontend.py file
from the pyzmq examples:

def runcode(self, code):
print code, type(code)
# We can't pickle code objects, so fetch the actual source
src = '\n'.join(self.buffer)

# for non-background inputs, if we do have previoiusly backgrounded
# jobs, check to see if they've produced results
if not src.endswith(';'):
while self.backgrounded > 0:
#print 'checking background'
rep = self.recv_reply()
if rep:
self.backgrounded -= 1
time.sleep(0.05)

# Send code execution message to kernel
omsg = self.session.send(self.request_socket,
'execute_request', dict(code=src))
self.messages[omsg.header.msg_id] = omsg

# Fake asynchronicity by letting the user put ';' at the end of the line
if src.endswith(';'):
self.backgrounded += 1
return

# For foreground jobs, wait for reply
while True:
rep = self.recv_reply()
if rep is not None:
break
self.recv_output()
time.sleep(0.05)

I've tried a lot of things but nothing seems to clarify to me the way I
should implement this in the project, please take a look at the IPyhonQt's
files: ipqt_frontend.py and ipythonqt.py.
In ipqt_frontend.py I'm just inheriting frontend's console class since I
don't really want to change it (although I'm practically rewriting the whole
class)


One thing I want to discuss, or at least read some opinions is what to do
with different outputs from inputs from the same cell, I mean:
________
| a=0      |
| a          |
| *a+10**    *|

Suppose this is the input cell, so there will be two ouputs, the question is
then, does this outputs need to be in the same cell or in different ones?
There's a new file pushed today (ipqt_popups.py) which will contain every
extra widget, until today it hast the stdin linedit to handle request from
raw_input (which I don't really know how to do that) and the foreign stream
to handle ouputs and inputs from other clients.
There're also some graphical features still to implement such as the
debugging, magic toolbar and function and tab popups. And another one very
important, every output cell has to be related to the input cell it came so
if the input cell is edited, the new output overwrites the old one in the
same cell or if there's no output,the cell is erased. I don't really know a
good way to achieve this, I think that with a relating attribute will be
good enough.


Thanks in advance for your help and comments.



Best regards.
--
Gerardo Gutiérrez Gutiérrez <http://he1.udea.edu.co/gweb>
Physics student
Universidad de Antioquia
Computational physics and astrophysics group
(FACom<http://urania.udea.edu.co/sites/sites.php>
)
Computational science and development
branch(FACom-dev<http://urania.udea.edu.co/sites/facom-dev/>
)
Usuario Linux #492295
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20100623/cf958b4e/attachment.html>


More information about the IPython-dev mailing list