Re: [matplotlib-devel] Backend for Pyside

2011-03-17 Thread Gerald Storer
It turns out that it was also trivial to get the figure options editor 
working with PySide.


All that needed to be done was (in formlayout.py):

   * Replace the references to PyQt with PySide
   * Change: from PyQt.QtCore import (Qt, SIGNAL, SLOT, QSize, QString,
pyqtSignature, pyqtProperty)
 to: from PySide.QtCore import (Qt, SIGNAL, SLOT, QSize, #QString,
#pyqtSignature, pyqtProperty)
 Slot as pyqtSignature, Property as
 pyqtProperty)
   * Add the following after the import statements:
 # Hacks to emulate PyQt
 QString = str
 class QColorDialog(QColorDialog):
  @staticmethod
  def getRgba(color,parent):
  result =
 QColorDialog.getColor(QColor.fromRgba(color),parent,'')
  return result.rgba(),result.isValid()

Formlayout could probably be updated so it doesn't need the hacks but I 
wanted to keep changes to a minimum.


Gerald.

On 17/03/2011 11:21 AM, Gerald Storer wrote:

On 01/18/2011 08:13 PM, Jed Ludlow wrote:
> Please forgive me if I'm raising a heretical question with this since I
> understand the topic of competing Qt bindings for Python gets a little
> touchy in and of itself. Nonetheless, the elephant is in the room. I
> searched the archives and found only a few comments on the subject:
> matplotlib-us...@lists.sourceforge.net/msg18652.html" 
target="_new">http://www.mail-archive.com/matplotlib-users@lists.sourceforge.net/msg18652.html>

> Has there been any additional discussion among the developers about
> creating a formal backend for Pyside?

Its actually a fairly easy to get the PyQt backend working with 
PySide.  It would have been laughably easy if not for a couple of bugs 
in PySide that took awhile to track down.


To get it working PySide working you need to:

* Obviously replace the reference to PyQt with PySide
* Remove the reference to PyQt/Pyside.Qt and Qt.qApp by replacing
  it with QtGui.qApp (I think this is already done in the most
  recent Git version)
* Replace the toolbar message signal with a new style signal by:
  o adding 'message = QtCore.Signal(str)' to the
NavigationToolbar2QT class definition
  o replacing: QtCore.QObject.connect(self.toolbar,
QtCore.SIGNAL("message"),
 
self.window.statusBar().showMessage)


with:self.toolbar.message.connect(self.window.statusBar().showMessage)
  o replacing: self.emit(QtCore.SIGNAL("message"), s)
with: self.message.emit(s)
* Work around the PySide bug with QImage and convert the string
  passed from the Agg backend into a python buffer with
  buffer(stringBuffer) or wait for PySide to fix bug 489.
* Work around a PySide bug (738) by creating functions to perform
  the slider.setMaxiumum/setMinimum tasks or ignore the runtime
  errors for now and wait for a bug fix.
* I haven't bothered with the figure options editor at this point
  - I just commented out the references to it.

It might also be a good idea to convert all the signals/slots into the 
new style but it seems to work just fine with only the above changes.


Regards,
Gerald.
--
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] Patch for matplotlib-py3

2011-03-17 Thread Michael Droettboom
I have added these as pull requests to matplotlib/matplotlib-py3.

To save us all time and make it easier to do code review, you may want to 
follow the instructions here to create your own pull requests:

http://matplotlib.github.com/devel/gitwash/development_workflow.html

Cheers,
Mike


From: Christoph Gohlke [cgoh...@uci.edu]
Sent: Wednesday, March 16, 2011 3:01 PM
To: matplotlib development list
Subject: [matplotlib-devel] Patch for matplotlib-py3

Hello,

please consider the attached patch for the matplotlib-py3 fork on
github. It corrects some build and test failures and removes unnecessary
'extern "C"' statements from PyMODINIT_FUNC functions.

 From :
Note that PyMODINIT_FUNC declares the function as void return type,
declares any special linkage declarations required by the platform, and
for C++ declares the function as extern "C".

Christoph

--
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] Patch for matplotlib-py3

2011-03-17 Thread Christoph Gohlke
I thought the workflow/process of contributing to matplotlib did not change:




Christoph


On 3/17/2011 6:40 AM, Michael Droettboom wrote:
> I have added these as pull requests to matplotlib/matplotlib-py3.
>
> To save us all time and make it easier to do code review, you may want to 
> follow the instructions here to create your own pull requests:
>
> http://matplotlib.github.com/devel/gitwash/development_workflow.html
>
> Cheers,
> Mike
>
> 
> From: Christoph Gohlke [cgoh...@uci.edu]
> Sent: Wednesday, March 16, 2011 3:01 PM
> To: matplotlib development list
> Subject: [matplotlib-devel] Patch for matplotlib-py3
>
> Hello,
>
> please consider the attached patch for the matplotlib-py3 fork on
> github. It corrects some build and test failures and removes unnecessary
> 'extern "C"' statements from PyMODINIT_FUNC functions.
>
>   From:
> Note that PyMODINIT_FUNC declares the function as void return type,
> declares any special linkage declarations required by the platform, and
> for C++ declares the function as extern "C".
>
> Christoph
>
>

--
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] Patch for matplotlib-py3

2011-03-17 Thread Michael Droettboom
Things are still very much in flux as we get our git legs -- so I didn't mean 
to imply any sort of "must do".  It's not a problem to continue doing what 
you're doing, you just might see faster service by using github pull requests 
and the code review facility there is very cool.  There's some information on 
this in the newly updated docs here:

http://matplotlib.github.com/devel/gitwash/patching.html

Cheers,
Mike


From: Christoph Gohlke [cgoh...@uci.edu]
Sent: Thursday, March 17, 2011 12:21 PM
Cc: matplotlib development list
Subject: Re: [matplotlib-devel] Patch for matplotlib-py3

I thought the workflow/process of contributing to matplotlib did not change:




Christoph


On 3/17/2011 6:40 AM, Michael Droettboom wrote:
> I have added these as pull requests to matplotlib/matplotlib-py3.
>
> To save us all time and make it easier to do code review, you may want to 
> follow the instructions here to create your own pull requests:
>
> http://matplotlib.github.com/devel/gitwash/development_workflow.html
>
> Cheers,
> Mike
>
> 
> From: Christoph Gohlke [cgoh...@uci.edu]
> Sent: Wednesday, March 16, 2011 3:01 PM
> To: matplotlib development list
> Subject: [matplotlib-devel] Patch for matplotlib-py3
>
> Hello,
>
> please consider the attached patch for the matplotlib-py3 fork on
> github. It corrects some build and test failures and removes unnecessary
> 'extern "C"' statements from PyMODINIT_FUNC functions.
>
>   From:
> Note that PyMODINIT_FUNC declares the function as void return type,
> declares any special linkage declarations required by the platform, and
> for C++ declares the function as extern "C".
>
> Christoph
>
>

--
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel

--
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel