Hello community, here is the log from the commit of package python-matplotlib for openSUSE:Factory checked in at 2012-03-20 11:33:39 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-matplotlib (Old) and /work/SRC/openSUSE:Factory/.python-matplotlib.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-matplotlib", Maintainer is "" Changes: -------- --- /work/SRC/openSUSE:Factory/python-matplotlib/python-matplotlib.changes 2012-01-19 16:57:57.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.python-matplotlib.new/python-matplotlib.changes 2012-03-20 11:33:40.000000000 +0100 @@ -1,0 +2,7 @@ +Fri Mar 16 15:13:32 UTC 2012 - toddrme2...@gmail.com + +- Cleaned up spec file formatting +- Removed tests for obsolete openSUSE versions +- Added Qt Designer plugin from Python(x,y) project + +------------------------------------------------------------------- New: ---- matplotlibplugin.py matplotlibwidget.py ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-matplotlib.spec ++++++ --- /var/tmp/diff_new_pack.4KM2jz/_old 2012-03-20 11:33:42.000000000 +0100 +++ /var/tmp/diff_new_pack.4KM2jz/_new 2012-03-20 11:33:42.000000000 +0100 @@ -15,16 +15,19 @@ # Please submit bugfixes or comments via http://bugs.opensuse.org/ # -Name: python-matplotlib +%define modname matplotlib +Name: python-%{modname} Version: 1.1.0 Release: 0 Summary: Plotting Library for Python License: BSD-2-Clause Group: Development/Libraries/Python -Url: http://sourceforge.net/projects/matplotlib -Source: matplotlib-%{version}.tar.bz2 -Source1: matplotlib-setup.cfg +Url: http://sourceforge.net/projects/%{modname} +Source: %{modname}-%{version}.tar.bz2 +Source1: %{modname}-setup.cfg +Source2: %{modname}plugin.py +Source3: %{modname}widget.py BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: fltk-devel @@ -33,6 +36,7 @@ BuildRequires: gtk2-devel BuildRequires: libpng-devel BuildRequires: python-gtk +BuildRequires: python-gtk-devel BuildRequires: python-numpy-devel >= 1.2.1 BuildRequires: python-tk BuildRequires: tcl @@ -44,25 +48,16 @@ Requires: python-numpy >= 1.2.1 Requires: python-tz %py_requires -%if %suse_version > 1130 -BuildRequires: python-wxWidgets -BuildRequires: wxWidgets-devel -%else +%if 0%{?sles_version} == 11 +BuildRequires: gnome-libs-devel +BuildRequires: python-qt BuildRequires: python-wxGTK BuildRequires: wxGTK-devel -%endif -BuildRequires: python-gtk-devel -%if 0%{?suse_version} >= 1120 -BuildRequires: python-qt4 %else -BuildRequires: python-qt -%endif -%if 0%{?suse_version} >= 1130 BuildRequires: libgnome-devel -%else -BuildRequires: gnome-libs-devel -%endif -%if %suse_version > 1130 +BuildRequires: python-qt4 +BuildRequires: python-wxWidgets +BuildRequires: wxWidgets-devel %define _use_internal_dependency_generator 0 %define __find_requires %wx_requires %endif @@ -81,26 +76,40 @@ application servers, and six graphical user interface toolkits. %package tk -Summary: Tk backend for python-matplotlib +Summary: Tk backend for %{name} Group: Development/Libraries/Python Requires: %{name} = %{version} Requires: python-tk %description tk -Tk backend for python-matplotlib plotting package +Tk backend for %{name} plotting package %package wx -Summary: Wx backend for python-matplotlib +Summary: Wx backend for %{name} Group: Development/Libraries/Python Requires: %{name} = %{version} Requires: python-wxGTK %description wx -wxWidgets backend for python-matplotlib plotting package +wxWidgets backend for %{name} plotting package + +%package designer +Summary: %{name} widget for Qt Designer +Group: Development/Libraries/Python +License: MIT +Requires: %{name} = %{version} +Requires: python-qt4 +Requires: qt-creator + +%description designer +This is a plugin and widget to let you use %{name} +plots as widget in PyQt4 GUIs using Qt Designer + +This plugin comes from Python(x,y) %prep %setup -n matplotlib-%{version} -chmod -x lib/matplotlib/mpl-data/images/*.svg +chmod -x lib/%{modname}/mpl-data/images/*.svg %build cp %{SOURCE1} ./setup.cfg @@ -109,36 +118,45 @@ %install python setup.py install --root=%{buildroot} \ --record-rpm=INSTALLED_FILES --prefix=%{_prefix} +mkdir -p %{buildroot}%{_libdir}/qt4/PyQt4/plugins/ +cp -v %{SOURCE2} %{buildroot}%{_libdir}/qt4/PyQt4/plugins/ +cp -v %{SOURCE3} %{buildroot}%{py_sitedir}/%{modname}/ %clean rm -rf %{buildroot} %files %defattr(-,root,root,-) -%doc README.txt CHANGELOG INSTALL +%doc README.txt CHANGELOG %doc PKG-INFO TODO CXX examples -%{py_sitedir}/* -%exclude %{py_sitedir}/matplotlib/backends/backend_tkagg.* -%exclude %{py_sitedir}/matplotlib/backends/tkagg.* -%exclude %{py_sitedir}/matplotlib/backends/_tkagg.so -%exclude %{py_sitedir}/matplotlib/backends/backend_wx.* -%exclude %{py_sitedir}/matplotlib/backends/backend_wxagg.* -%if %suse_version <= 1020 -%exclude %{py_sitedir}/matplotlib/backends/_wxagg.so -%endif +%{py_sitedir}/%{modname}-%{version}-py%{py_ver}.egg-info +%{py_sitedir}/%{modname}/ +%{py_sitedir}/mpl_toolkits +%{py_sitedir}/pylab.py +%{py_sitedir}/pylab.pyc +%exclude %{py_sitedir}/%{modname}/backends/backend_tkagg.* +%exclude %{py_sitedir}/%{modname}/backends/tkagg.* +%exclude %{py_sitedir}/%{modname}/backends/_tkagg.so +%exclude %{py_sitedir}/%{modname}/backends/backend_wx.* +%exclude %{py_sitedir}/%{modname}/backends/backend_wxagg.* +%exclude %{py_sitedir}/%{modname}/%{modname}widget.py %files tk %defattr(-,root,root,-) -%{py_sitedir}/matplotlib/backends/backend_tkagg.* -%{py_sitedir}/matplotlib/backends/tkagg.* -%{py_sitedir}/matplotlib/backends/_tkagg.so +%{py_sitedir}/%{modname}/backends/backend_tkagg.* +%{py_sitedir}/%{modname}/backends/tkagg.* +%{py_sitedir}/%{modname}/backends/_tkagg.so %files wx %defattr(-,root,root,-) %{py_sitedir}/matplotlib/backends/backend_wx.* %{py_sitedir}/matplotlib/backends/backend_wxagg.* -%if %suse_version <= 1020 -%{py_sitedir}/matplotlib/backends/_wxagg.so -%endif + +%files designer +%defattr(-,root,root,-) +%dir %{_libdir}/qt4/PyQt4 +%dir %{_libdir}/qt4/PyQt4/plugins +%{_libdir}/qt4/PyQt4/plugins/%{modname}plugin.py +%{py_sitedir}/%{modname}/%{modname}widget.py %changelog ++++++ matplotlibplugin.py ++++++ # -*- coding: utf-8 -*- # # Copyright © 2009 Pierre Raybaut # Licensed under the terms of the MIT License from PyQt4.QtGui import QIcon from PyQt4.QtDesigner import QPyDesignerCustomWidgetPlugin import os from matplotlib import rcParams from matplotlibwidget import MatplotlibWidget rcParams['font.size'] = 9 class MatplotlibPlugin(QPyDesignerCustomWidgetPlugin): def __init__(self, parent=None): QPyDesignerCustomWidgetPlugin.__init__(self) self._initialized = False def initialize(self, formEditor): if self._initialized: return self._initialized = True def isInitialized(self): return self._initialized def createWidget(self, parent): return MatplotlibWidget(parent) def name(self): return "MatplotlibWidget" def group(self): return "Python(x,y)" def icon(self): image = os.path.join(rcParams['datapath'], 'images', 'matplotlib.png') return QIcon(image) def toolTip(self): return "" def whatsThis(self): return "" def isContainer(self): return False def domXml(self): return '<widget class="MatplotlibWidget" name="mplwidget">\n' \ '</widget>\n' def includeFile(self): return "matplotlibwidget" if __name__ == '__main__': import sys from PyQt4.QtGui import QApplication app = QApplication(sys.argv) widget = MatplotlibWidget() widget.show() sys.exit(app.exec_()) ++++++ matplotlibwidget.py ++++++ # -*- coding: utf-8 -*- # # Copyright © 2009 Pierre Raybaut # Licensed under the terms of the MIT License """ MatplotlibWidget ================ Example of matplotlib widget for PyQt4 Copyright © 2009 Pierre Raybaut This software is licensed under the terms of the MIT License Derived from 'embedding_in_pyqt4.py': Copyright © 2005 Florent Rougon, 2006 Darren Dale """ __version__ = "1.0.0" from PyQt4.QtGui import QSizePolicy from PyQt4.QtCore import QSize from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as Canvas from matplotlib.figure import Figure from matplotlib import rcParams rcParams['font.size'] = 9 class MatplotlibWidget(Canvas): """ MatplotlibWidget inherits PyQt4.QtGui.QWidget and matplotlib.backend_bases.FigureCanvasBase Options: option_name (default_value) ------- parent (None): parent widget title (''): figure title xlabel (''): X-axis label ylabel (''): Y-axis label xlim (None): X-axis limits ([min, max]) ylim (None): Y-axis limits ([min, max]) xscale ('linear'): X-axis scale yscale ('linear'): Y-axis scale width (4): width in inches height (3): height in inches dpi (100): resolution in dpi hold (False): if False, figure will be cleared each time plot is called Widget attributes: ----------------- figure: instance of matplotlib.figure.Figure axes: figure axes Example: ------- self.widget = MatplotlibWidget(self, yscale='log', hold=True) from numpy import linspace x = linspace(-10, 10) self.widget.axes.plot(x, x**2) self.wdiget.axes.plot(x, x**3) """ def __init__(self, parent=None, title='', xlabel='', ylabel='', xlim=None, ylim=None, xscale='linear', yscale='linear', width=4, height=3, dpi=100, hold=False): self.figure = Figure(figsize=(width, height), dpi=dpi) self.axes = self.figure.add_subplot(111) self.axes.set_title(title) self.axes.set_xlabel(xlabel) self.axes.set_ylabel(ylabel) if xscale is not None: self.axes.set_xscale(xscale) if yscale is not None: self.axes.set_yscale(yscale) if xlim is not None: self.axes.set_xlim(*xlim) if ylim is not None: self.axes.set_ylim(*ylim) self.axes.hold(hold) Canvas.__init__(self, self.figure) self.setParent(parent) Canvas.setSizePolicy(self, QSizePolicy.Expanding, QSizePolicy.Expanding) Canvas.updateGeometry(self) def sizeHint(self): w, h = self.get_width_height() return QSize(w, h) def minimumSizeHint(self): return QSize(10, 10) #=============================================================================== # Example #=============================================================================== if __name__ == '__main__': import sys from PyQt4.QtGui import QMainWindow, QApplication from numpy import linspace class ApplicationWindow(QMainWindow): def __init__(self): QMainWindow.__init__(self) self.mplwidget = MatplotlibWidget(self, title='Example', xlabel='Linear scale', ylabel='Log scale', hold=True, yscale='log') self.mplwidget.setFocus() self.setCentralWidget(self.mplwidget) self.plot(self.mplwidget.axes) def plot(self, axes): x = linspace(-10, 10) axes.plot(x, x**2) axes.plot(x, x**3) app = QApplication(sys.argv) win = ApplicationWindow() win.show() sys.exit(app.exec_()) -- To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org For additional commands, e-mail: opensuse-commit+h...@opensuse.org