Accepting request 109897 from devel:languages:python
- Cleaned up spec file formatting - Removed tests for obsolete openSUSE versions - Added Qt Designer plugin from Python(x,y) project (forwarded request 109846 from TheBlackCat) OBS-URL: https://build.opensuse.org/request/show/109897 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-matplotlib?expand=0&rev=17
This commit is contained in:
committed by
Git OBS Bridge
parent
e6f3e8423e
commit
19b8da8351
66
matplotlibplugin.py
Normal file
66
matplotlibplugin.py
Normal file
@@ -0,0 +1,66 @@
|
||||
# -*- 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_())
|
||||
Reference in New Issue
Block a user