Fwd: Developing a Python plugin for Avogadro on Windows

I don’t think there was any discussion on these points, and I wanted to address some of these points.

  • I don’t know why the Windows version doesn’t allow access to Pybel, etc.
  • The script menu bug is clearly an issue with translations. I think I have a fix for that, both in the example.py script, and in the Avogadro mainwindow.cpp code (which now strips “&” off when doing comparisons).
  • I think debug messages would be a great addition – they should show up in the general Message log in the main window. I believe it’s there, but there aren’t examples of this.
  • For the python prompt, all I can imagine is that we need to evaluate the string and then run a “print repr(RESULT)” where RESULT is the end of the evaluation.

-Geoff

Begin forwarded message:

From: “Noel O’Boyle” baoilleach@gmail.com
Date: April 12, 2010 2:04:55 PM EDT
To: avogadro-discuss@lists.sourceforge.net
Subject: [Avogadro-Discuss] Developing a Python plugin for Avogadro on Windows

Hello all,

I’ve written up my experience developing a plugin that allows the user
to open files with cclib at
http://baoilleach.blogspot.com/2010/04/plug-cclib-into-avogadro.html.
It worked up to a point, but I ran into a couple of problems/strange
behaviour:

  • There should be no need to have the OpenBabel Python bindings
    installed separately, but there is no way to access the OpenBabel
    library in Avogadro (at least on Windows). This prevents me, for
    example, from calling ConnectTheDots (I had to use my own installation
    of OpenBabel) or to add Conformers (which was what I wanted to do).
  • There are two Script menus after installing this plugin!
  • How do I emit a debug message?
  • The Python prompt in Avogadro requires you to “print” everything
    to see its value. This should not be necessary.
  • Cutting and pasting multiple lines into the Python prompt works
    fine, but it looks pretty weird as the prompt (>>>) is missing.
  • Noel

Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev


Avogadro-Discuss mailing list
Avogadro-Discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/avogadro-discuss