[guidata] 02/07: Imported Upstream version 1.7.0~b2
Frédéric-Emmanuel Picca
picca at moszumanska.debian.org
Mon Aug 24 08:38:11 UTC 2015
This is an automated email from the git hooks/post-receive script.
picca pushed a commit to branch master
in repository guidata.
commit e5f4845fd39424a0385b1eeea9c0115c75116398
Author: Picca Frédéric-Emmanuel <picca at debian.org>
Date: Mon Aug 24 09:15:18 2015 +0200
Imported Upstream version 1.7.0~b2
---
PKG-INFO | 11 ++-
README | 2 +-
changelog | 8 +++
doc/installation.rst | 2 +-
PKG-INFO => guidata.egg-info/PKG-INFO | 11 ++-
guidata.egg-info/SOURCES.txt | 130 ++++++++++++++++++++++++++++++++++
guidata.egg-info/dependency_links.txt | 1 +
guidata.egg-info/top_level.txt | 1 +
guidata/__init__.py | 13 ++--
guidata/dataset/qtitemwidgets.py | 33 ++++-----
guidata/dataset/qtwidgets.py | 18 ++---
guidata/disthelpers.py | 65 ++++++++++++++---
guidata/guitest.py | 17 +++--
guidata/qt/QtCore.py | 37 +++++-----
guidata/qt/QtDesigner.py | 14 ++++
guidata/qt/QtGui.py | 15 ++--
guidata/qt/QtSvg.py | 14 ++++
guidata/qt/QtWebKit.py | 12 ++--
guidata/qt/__init__.py | 105 ++++++++++++++-------------
guidata/qthelpers.py | 12 ++--
guidata/qtwidgets.py | 13 ++--
guidata/tests/editgroupbox.py | 4 +-
setup.cfg | 5 ++
setup.py | 17 +++--
24 files changed, 399 insertions(+), 161 deletions(-)
diff --git a/PKG-INFO b/PKG-INFO
index 8d5f261..404d246 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,19 +1,18 @@
Metadata-Version: 1.1
Name: guidata
-Version: 1.6.1
+Version: 1.7.0b2
Summary: guidata is a set of basic GUIs to edit and display objects of many kinds
-Home-page: http://www.cea.fr
+Home-page: https://github.com/PierreRaybaut/guidata
Author: Pierre Raybaut
-Author-email: pierre.raybaut at cea.fr
-License: UNKNOWN
-Download-URL: http://guidata.googlecode.com/files/guidata-1.6.1.zip
+Author-email: pierre.raybaut at gmail.com
+License: CeCILL V2
Description: Set of basic GUIs to edit and display objects of many kinds:
- integers, floats, strings ;
- ndarrays (NumPy's n-dimensional arrays) ;
- etc.
Platform: UNKNOWN
-Classifier: Development Status :: 5 - Production/Stable
Classifier: Topic :: Scientific/Engineering
+Classifier: Development Status :: 4 - Beta
Classifier: Operating System :: MacOS
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: OS Independent
diff --git a/README b/README
index e24086d..753a20a 100644
--- a/README
+++ b/README
@@ -28,7 +28,7 @@ Licensed under the terms of the CECILL License (see Licence_CeCILL_V2-en.txt)
Requirements
Python >=2.6 or Python >=3.0
- PyQt4 4.x (x>=3 ; recommended x>=4)
+ PyQt4 4.x (x>=3 ; recommended x>=4) or PyQt5 5.x (x>=5)
spyderlib >=v2.0.10 (test launcher and array/dictionnary editors)
Optional Python modules
diff --git a/changelog b/changelog
index 07f6ad4..4044659 100644
--- a/changelog
+++ b/changelog
@@ -1,3 +1,11 @@
+== Version 1.7.0 ==
+
+=== Possible API compatibility issues (since v1.6.2) ===
+
+ * Added PyQt5 support (there may be side effects).
+
+----
+
== Version 1.6.1 ==
=== Possible API compatibility issues (since v1.6.0) ===
diff --git a/doc/installation.rst b/doc/installation.rst
index 1c32da0..b5667c8 100644
--- a/doc/installation.rst
+++ b/doc/installation.rst
@@ -6,7 +6,7 @@ Dependencies
Requirements:
* Python >=v2.5
- * PyQt4 4.x (x>=3 ; recommended x>=4)
+ * PyQt4 4.x (x>=3 ; recommended x>=4) or PyQt5 5.x (x>=5)
* spyderlib >=v2.0.10 for the test launcher and array/dictionnary editors
Optional Python modules:
diff --git a/PKG-INFO b/guidata.egg-info/PKG-INFO
similarity index 75%
copy from PKG-INFO
copy to guidata.egg-info/PKG-INFO
index 8d5f261..404d246 100644
--- a/PKG-INFO
+++ b/guidata.egg-info/PKG-INFO
@@ -1,19 +1,18 @@
Metadata-Version: 1.1
Name: guidata
-Version: 1.6.1
+Version: 1.7.0b2
Summary: guidata is a set of basic GUIs to edit and display objects of many kinds
-Home-page: http://www.cea.fr
+Home-page: https://github.com/PierreRaybaut/guidata
Author: Pierre Raybaut
-Author-email: pierre.raybaut at cea.fr
-License: UNKNOWN
-Download-URL: http://guidata.googlecode.com/files/guidata-1.6.1.zip
+Author-email: pierre.raybaut at gmail.com
+License: CeCILL V2
Description: Set of basic GUIs to edit and display objects of many kinds:
- integers, floats, strings ;
- ndarrays (NumPy's n-dimensional arrays) ;
- etc.
Platform: UNKNOWN
-Classifier: Development Status :: 5 - Production/Stable
Classifier: Topic :: Scientific/Engineering
+Classifier: Development Status :: 4 - Beta
Classifier: Operating System :: MacOS
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: OS Independent
diff --git a/guidata.egg-info/SOURCES.txt b/guidata.egg-info/SOURCES.txt
new file mode 100644
index 0000000..ebb3eee
--- /dev/null
+++ b/guidata.egg-info/SOURCES.txt
@@ -0,0 +1,130 @@
+Licence_CeCILL_V2-en.txt
+MANIFEST.in
+README
+changelog
+guidata-tests
+guidata-tests.bat
+setup.py
+doc/basic_example.py
+doc/conf.py
+doc/development.rst
+doc/examples.rst
+doc/index.rst
+doc/installation.rst
+doc/overview.rst
+doc/reference.rst
+doc/_static/favicon.ico
+doc/images/basic_example.png
+doc/images/guidata.png
+doc/images/screenshots/__init__.png
+doc/images/screenshots/activable_dataset.png
+doc/images/screenshots/all_features.png
+doc/images/screenshots/all_items.png
+doc/images/screenshots/bool_selector.png
+doc/images/screenshots/datasetgroup.png
+doc/images/screenshots/editgroupbox.png
+guidata/__init__.py
+guidata/config.py
+guidata/configtools.py
+guidata/disthelpers.py
+guidata/gettext_helpers.py
+guidata/guitest.py
+guidata/hdf5io.py
+guidata/py3compat.py
+guidata/qthelpers.py
+guidata/qtwidgets.py
+guidata/userconfig.py
+guidata/userconfigio.py
+guidata/utils.py
+guidata.egg-info/PKG-INFO
+guidata.egg-info/SOURCES.txt
+guidata.egg-info/dependency_links.txt
+guidata.egg-info/top_level.txt
+guidata/dataset/__init__.py
+guidata/dataset/dataitems.py
+guidata/dataset/datatypes.py
+guidata/dataset/qtitemwidgets.py
+guidata/dataset/qtwidgets.py
+guidata/dataset/textedit.py
+guidata/images/apply.png
+guidata/images/arredit.png
+guidata/images/busy.png
+guidata/images/cell_edit.png
+guidata/images/copy.png
+guidata/images/delete.png
+guidata/images/dictedit.png
+guidata/images/edit.png
+guidata/images/exit.png
+guidata/images/expander_down.png
+guidata/images/expander_right.png
+guidata/images/file.png
+guidata/images/fileclose.png
+guidata/images/fileimport.png
+guidata/images/filenew.png
+guidata/images/fileopen.png
+guidata/images/filesave.png
+guidata/images/filesaveas.png
+guidata/images/guidata.svg
+guidata/images/max.png
+guidata/images/min.png
+guidata/images/none.png
+guidata/images/not_found.png
+guidata/images/python.png
+guidata/images/quickview.png
+guidata/images/save_all.png
+guidata/images/selection.png
+guidata/images/settings.png
+guidata/images/shape.png
+guidata/images/xmax.png
+guidata/images/xmin.png
+guidata/images/editors/edit.png
+guidata/images/editors/edit_add.png
+guidata/images/editors/editcopy.png
+guidata/images/editors/editdelete.png
+guidata/images/editors/editpaste.png
+guidata/images/editors/fileimport.png
+guidata/images/editors/filesave.png
+guidata/images/editors/imshow.png
+guidata/images/editors/insert.png
+guidata/images/editors/plot.png
+guidata/images/editors/rename.png
+guidata/images/filetypes/doc.png
+guidata/images/filetypes/gif.png
+guidata/images/filetypes/html.png
+guidata/images/filetypes/jpg.png
+guidata/images/filetypes/pdf.png
+guidata/images/filetypes/png.png
+guidata/images/filetypes/pps.png
+guidata/images/filetypes/ps.png
+guidata/images/filetypes/tar.png
+guidata/images/filetypes/tgz.png
+guidata/images/filetypes/tif.png
+guidata/images/filetypes/txt.png
+guidata/images/filetypes/xls.png
+guidata/images/filetypes/zip.png
+guidata/locale/fr/LC_MESSAGES/guidata.mo
+guidata/locale/fr/LC_MESSAGES/guidata.po
+guidata/qt/QtCore.py
+guidata/qt/QtDesigner.py
+guidata/qt/QtGui.py
+guidata/qt/QtSvg.py
+guidata/qt/QtWebKit.py
+guidata/qt/__init__.py
+guidata/qt/compat.py
+guidata/tests/__init__.py
+guidata/tests/activable_dataset.py
+guidata/tests/activable_items.py
+guidata/tests/all_features.py
+guidata/tests/all_items.py
+guidata/tests/bool_selector.py
+guidata/tests/callbacks.py
+guidata/tests/config.py
+guidata/tests/data.py
+guidata/tests/datasetgroup.py
+guidata/tests/disthelpers.py
+guidata/tests/editgroupbox.py
+guidata/tests/hdf5.py
+guidata/tests/inheritance.py
+guidata/tests/rotatedlabel.py
+guidata/tests/text.py
+guidata/tests/translations.py
\ No newline at end of file
diff --git a/guidata.egg-info/dependency_links.txt b/guidata.egg-info/dependency_links.txt
new file mode 100644
index 0000000..8b13789
--- /dev/null
+++ b/guidata.egg-info/dependency_links.txt
@@ -0,0 +1 @@
+
diff --git a/guidata.egg-info/top_level.txt b/guidata.egg-info/top_level.txt
new file mode 100644
index 0000000..4e65bf1
--- /dev/null
+++ b/guidata.egg-info/top_level.txt
@@ -0,0 +1 @@
+guidata
diff --git a/guidata/__init__.py b/guidata/__init__.py
index 34b1a01..9d40af1 100644
--- a/guidata/__init__.py
+++ b/guidata/__init__.py
@@ -15,6 +15,12 @@ External resources:
.. _GoogleGroup: http://groups.google.fr/group/guidata_guiqwt
"""
+__version__ = '1.7.0b2'
+
+# Dear (Debian, RPM, ...) package makers, please feel free to customize the
+# following path to module's data (images) and translations:
+DATAPATH = LOCALEPATH = ''
+
# Copyright © 2009-2010 CEA
# Pierre Raybaut
@@ -529,13 +535,6 @@ External resources:
#
# Version 2.0 dated 2006-09-05.
-
-__version__ = '1.6.1'
-
-# Dear (Debian, RPM, ...) package makers, please feel free to customize the
-# following path to module's data (images) and translations:
-DATAPATH = LOCALEPATH = ''
-
import guidata.config
def qapplication():
diff --git a/guidata/dataset/qtitemwidgets.py b/guidata/dataset/qtitemwidgets.py
index 0885238..cc676e2 100644
--- a/guidata/dataset/qtitemwidgets.py
+++ b/guidata/dataset/qtitemwidgets.py
@@ -31,12 +31,11 @@ try:
except ImportError:
pass
-from guidata.qt.QtGui import (QIcon, QPixmap, QHBoxLayout, QGridLayout,
+from guidata.qt.QtGui import (QIcon, QPixmap, QHBoxLayout, QGridLayout, QColor,
QColorDialog, QPushButton, QLineEdit, QCheckBox,
- QComboBox, QWidget, QTabWidget, QGroupBox,
- QLabel, QTextEdit, QFrame, QDateEdit, QSlider,
- QDateTimeEdit, QColor)
-from guidata.qt.QtCore import Qt, QObject, SIGNAL
+ QComboBox, QTabWidget, QGroupBox, QDateTimeEdit,
+ QLabel, QTextEdit, QFrame, QDateEdit, QSlider)
+from guidata.qt.QtCore import Qt
from guidata.qt.compat import getexistingdirectory
try:
from guidata.qt.QtCore import QStringList
@@ -239,8 +238,7 @@ class LineEditWidget(AbstractDataSetWidget):
if item.check_item():
self.edit.setEnabled(False)
self.edit.setToolTip(_("Value is forced to %d") % item.get_max())
- QObject.connect(self.edit, SIGNAL("textChanged(QString)"),
- self.line_edit_changed)
+ self.edit.textChanged.connect(self.line_edit_changed)
def get(self):
"""Override AbstractDataSetWidget method"""
@@ -299,7 +297,7 @@ class TextEditWidget(AbstractDataSetWidget):
if item.check_item():
self.edit.setEnabled(False)
self.edit.setToolTip(_("Value is forced to %d") % item.get_max())
- QObject.connect(self.edit, SIGNAL("textChanged()"), self.text_changed)
+ self.edit.textChanged.connect(self.text_changed)
def __get_text(self):
"""Get QTextEdit text, replacing UTF-8 EOL chars by os.linesep"""
@@ -347,8 +345,7 @@ class CheckBoxWidget(AbstractDataSetWidget):
self.store = self.item.get_prop("display", "store", None)
if self.store:
- QWidget.connect(self.checkbox, SIGNAL("stateChanged(int)"),
- self.do_store)
+ self.checkbox.stateChanged.connect(self.do_store)
def get(self):
"""Override AbstractDataSetWidget method"""
@@ -460,7 +457,7 @@ class ColorWidget(HLayoutMixin, LineEditWidget):
super(ColorWidget, self).__init__(item, parent_layout)
self.button = QPushButton("")
self.button.setMaximumWidth(32)
- QObject.connect(self.button, SIGNAL("clicked()"), self.select_color)
+ self.button.clicked.connect(self.select_color)
self.group.addWidget(self.button)
def update(self, value):
@@ -504,8 +501,7 @@ class SliderWidget(HLayoutMixin, LineEditWidget):
self.slider.setRange(0, int((vmax-vmin)/vstep))
self.convert_value = lambda v: v*vstep + vmin
- QObject.connect(self.slider, SIGNAL("valueChanged(int)"),
- self.value_changed)
+ self.slider.valueChanged.connect(self.value_changed)
self.group.addWidget(self.slider)
else:
self.slider = None
@@ -548,7 +544,7 @@ class FileWidget(HLayoutMixin, LineEditWidget):
button = QPushButton()
fmt = item.get_prop_value("data", "formats")
button.setIcon(get_icon('%s.png' % fmt[0].lower(), default='file.png'))
- QObject.connect(button, SIGNAL("clicked()"), self.select_file)
+ button.clicked.connect(self.select_file)
self.group.addWidget(button)
self.basedir = item.get_prop_value("data", "basedir")
self.all_files_first = item.get_prop_value("data", "all_files_first")
@@ -593,7 +589,7 @@ class DirectoryWidget(HLayoutMixin, LineEditWidget):
super(DirectoryWidget, self).__init__(item, parent_layout)
button = QPushButton()
button.setIcon(get_std_icon('DirOpenIcon'))
- QObject.connect(button, SIGNAL("clicked()"), self.select_directory)
+ button.clicked.connect(self.select_directory)
self.group.addWidget(button)
def select_directory(self):
@@ -617,8 +613,7 @@ class ChoiceWidget(AbstractDataSetWidget):
self.__first_call = True
self.store = self.item.get_prop("display", "store", None)
- QWidget.connect(self.combobox, SIGNAL("currentIndexChanged(int)"),
- self.index_changed)
+ self.combobox.currentIndexChanged.connect(self.index_changed)
def index_changed(self, index):
if self.store:
@@ -761,7 +756,7 @@ class FloatArrayWidget(AbstractDataSetWidget):
_("Largest element in array"))
self.layout.addLayout(self.max_line, 2, 0)
- QObject.connect(edit_button, SIGNAL("clicked()"), self.edit_array )
+ edit_button.clicked.connect(self.edit_array)
self.arr = None # le tableau si il a été modifié
self.instance = None
@@ -842,7 +837,7 @@ class ButtonWidget(AbstractDataSetWidget):
if is_text_string(_icon):
_icon = get_icon(_icon)
self.button.setIcon(_icon)
- QObject.connect(self.button, SIGNAL("clicked()"), self.clicked)
+ self.button.clicked.connect(self.clicked)
self.cb_value = None
def get(self):
diff --git a/guidata/dataset/qtwidgets.py b/guidata/dataset/qtwidgets.py
index 5e1220e..7629f38 100644
--- a/guidata/dataset/qtwidgets.py
+++ b/guidata/dataset/qtwidgets.py
@@ -32,7 +32,7 @@ from guidata.qt.QtGui import (QDialog, QMessageBox, QDialogButtonBox, QWidget,
QVBoxLayout, QGridLayout, QLabel, QSpacerItem,
QColor, QTabWidget, QIcon, QApplication, QPainter,
QPicture, QBrush, QGroupBox, QPushButton)
-from guidata.qt.QtCore import SIGNAL, SLOT, Qt, QRect, QSize
+from guidata.qt.QtCore import Qt, QRect, QSize, Signal
from guidata.qt.compat import getopenfilename, getopenfilenames, getsavefilename
from guidata.configtools import get_icon
@@ -69,9 +69,9 @@ class DataSetEditDialog(QDialog):
bbox = QDialogButtonBox(QDialogButtonBox.Ok | QDialogButtonBox.Cancel
| apply_button )
self.bbox = bbox
- self.connect(bbox, SIGNAL("accepted()"), SLOT("accept()"))
- self.connect(bbox, SIGNAL("rejected()"), SLOT("reject()"))
- self.connect(bbox, SIGNAL("clicked(QAbstractButton*)"), self.button_clicked)
+ bbox.accepted.connect(self.accept)
+ bbox.rejected.connect(self.reject)
+ bbox.clicked.connect(self.button_clicked)
self.layout.addWidget(bbox)
self.setLayout(self.layout)
@@ -126,8 +126,8 @@ class DataSetEditDialog(QDialog):
is_ok = False
if not is_ok:
QMessageBox.warning(self, self.instance.get_title(),
- _("Some required entries are incorrect")+".\n",
- _("Please check highlighted fields."))
+ _("Some required entries are incorrect")+"\n"+\
+ _("Please check highlighted fields."))
return False
return True
@@ -474,6 +474,8 @@ class DataSetEditGroupBox(DataSetShowGroupBox):
button_text: action button text (default: "Apply")
button_icon: QIcon object or string (default "apply.png")
"""
+ SIG_APPLY_BUTTON_CLICKED = Signal()
+
def __init__(self, label, klass, button_text=None, button_icon=None,
show_button=True, wordwrap=False, **kwargs):
DataSetShowGroupBox.__init__(self, label, klass, wordwrap=wordwrap,
@@ -486,7 +488,7 @@ class DataSetEditGroupBox(DataSetShowGroupBox):
elif is_text_string(button_icon):
button_icon = get_icon(button_icon)
apply_btn = QPushButton(button_icon, button_text, self)
- self.connect(apply_btn, SIGNAL("clicked()"), self.set)
+ apply_btn.clicked.connect(self.set)
layout = self.edit.layout
layout.addWidget(apply_btn, layout.rowCount(),
0, 1, -1, Qt.AlignRight)
@@ -500,7 +502,7 @@ class DataSetEditGroupBox(DataSetShowGroupBox):
for widget in self.edit.widgets:
if widget.is_active() and widget.check():
widget.set()
- self.emit(SIGNAL("apply_button_clicked()"))
+ self.SIG_APPLY_BUTTON_CLICKED.emit()
def child_title(self, item):
"""Return data item title combined with QApplication title"""
diff --git a/guidata/disthelpers.py b/guidata/disthelpers.py
index 4c21fc7..46b4dcc 100644
--- a/guidata/disthelpers.py
+++ b/guidata/disthelpers.py
@@ -117,7 +117,23 @@ def get_msvc_version(python_version):
else:
raise RuntimeError("Unsupported Python version %s" % python_version)
-def get_msvc_dlls(msvc_version, architecture=None):
+def get_dll_architecture(path):
+ """Return DLL architecture (32 or 64bit) using Microsoft dumpbin.exe"""
+ os.environ['PATH'] += r';C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\;C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\;C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN'
+ process = Popen(['dumpbin', '/HEADERS', osp.basename(path)], stdout=PIPE,
+ stderr=PIPE, cwd=osp.dirname(path), shell=True)
+ output = process.stdout.read()
+ error = process.stderr.read()
+ if error:
+ raise RuntimeError(error)
+ elif 'x86' in output:
+ return 32
+ elif 'x64' in output:
+ return 64
+ else:
+ raise ValueError('Unable to get DLL architecture')
+
+def get_msvc_dlls(msvc_version, architecture=None, check_architecture=False):
"""Get the list of Microsoft Visual C++ DLLs associated to
architecture and Python version, create the manifest file.
@@ -126,6 +142,7 @@ def get_msvc_dlls(msvc_version, architecture=None):
current_architecture = 64 if sys.maxsize > 2**32 else 32
if architecture is None:
architecture = current_architecture
+ assert architecture in (32, 64)
filelist = []
@@ -196,14 +213,22 @@ def get_msvc_dlls(msvc_version, architecture=None):
# applications and is included on all 64-bit versions of Windows
# (source: http://en.wikipedia.org/wiki/WoW64)
#
- # In other words, "SysWOW64" contains 64-bit DLL and applications,
+ # In other words, "SysWOW64" contains 32-bit DLL and applications,
# whereas "System32" contains 64-bit DLL and applications on a 64-bit
# system.
- sysdir = "System32"
- if not is_64bit_windows and architecture == 64:
- raise RuntimeError("Can't find 64-bit MSVC DLLs on a 32-bit OS")
- if is_64bit_windows and architecture == 32:
- sysdir = "SysWOW64"
+ if architecture == 64:
+ # 64-bit DLLs are located in...
+ if is_64bit_windows:
+ sysdir = "System32" # on a 64-bit OS
+ else:
+ # ...no directory to be found!
+ raise RuntimeError("Can't find 64-bit DLLs on a 32-bit OS")
+ else:
+ # 32-bit DLLs are located in...
+ if is_64bit_windows:
+ sysdir = "SysWOW64" # on a 64-bit OS
+ else:
+ sysdir = "System32" # on a 32-bit OS
for dllname in namelist:
fname = osp.join(windir, sysdir, dllname)
@@ -215,9 +240,21 @@ def get_msvc_dlls(msvc_version, architecture=None):
else:
raise RuntimeError("Unsupported MSVC version %s" % msvc_version)
-
+
+ if check_architecture:
+ for path in filelist:
+ if path.endswith('.dll'):
+ try:
+ arch = get_dll_architecture(path)
+ except RuntimeError:
+ return
+ if arch != architecture:
+ raise RuntimeError("%s: expecting %dbit, found %dbit"\
+ % (path, architecture, arch))
+
return filelist
+
def create_msvc_data_files(architecture=None, python_version=None,
verbose=False):
"""Including Microsoft Visual C++ DLLs"""
@@ -738,3 +775,15 @@ class Distribution(object):
options=dict(build_exe=build_exe))
if create_archive:
self.__create_archive(create_archive)
+
+
+if __name__ == '__main__':
+ for python_version in ('2.7', '3.3'):
+ for arch in (32, 64):
+ print('Python %s %dbit' % (python_version, arch))
+ msvc_version = get_msvc_version(python_version)
+ filelist = get_msvc_dlls(msvc_version, architecture=arch)
+ for fname in filelist:
+ if '.dll' in fname:
+ print(get_dll_architecture(fname))
+ print()
diff --git a/guidata/guitest.py b/guidata/guitest.py
index 6e6869c..0e9db70 100644
--- a/guidata/guitest.py
+++ b/guidata/guitest.py
@@ -20,7 +20,7 @@ from spyderlib.widgets.sourcecode.codeeditor import CodeEditor
from guidata.qt.QtGui import (QWidget, QVBoxLayout, QSplitter, QFont,
QListWidget, QPushButton, QLabel, QGroupBox,
QHBoxLayout, QShortcut, QKeySequence)
-from guidata.qt.QtCore import SIGNAL, Qt, QSize
+from guidata.qt.QtCore import Qt, QSize
from guidata.config import _
from guidata.configtools import get_icon, get_family, MONOSPACE
@@ -140,14 +140,13 @@ class TestLauncherWindow(QSplitter):
self.addWidget(listwidget)
self.addWidget(self.properties)
- self.connect(self.properties.run_button, SIGNAL("clicked()"),
- lambda: tests[listwidget.currentRow()].run())
- self.connect(self.properties.quit_button, SIGNAL("clicked()"),
- self.close)
- self.connect(listwidget, SIGNAL('currentRowChanged(int)'),
- lambda row: self.properties.set_item(tests[row]))
- self.connect(listwidget, SIGNAL('itemActivated(QListWidgetItem*)'),
- lambda: tests[listwidget.currentRow()].run())
+ self.properties.run_button.clicked.connect(
+ lambda: tests[listwidget.currentRow()].run())
+ self.properties.quit_button.clicked.connect(self.close)
+ listwidget.currentRowChanged.connect(
+ lambda row: self.properties.set_item(tests[row]))
+ listwidget.itemActivated.connect(
+ lambda: tests[listwidget.currentRow()].run())
listwidget.setCurrentRow(0)
QShortcut(QKeySequence("Escape"), self, self.close)
diff --git a/guidata/qt/QtCore.py b/guidata/qt/QtCore.py
index 7e79caa..652d471 100644
--- a/guidata/qt/QtCore.py
+++ b/guidata/qt/QtCore.py
@@ -5,24 +5,25 @@
# (copied from Spyder source code [spyderlib.qt])
import os
-if os.environ['QT_API'] == 'pyqt':
- from PyQt4.QtCore import *
- from PyQt4.Qt import QCoreApplication
- from PyQt4.Qt import Qt
- # <!> WARNING <!>
- # try...except statement for compatibility with PyQt 4.4 (see Issue 14)
- try:
- from PyQt4.QtCore import pyqtSignal as Signal
- from PyQt4.QtCore import pyqtSlot as Slot
- except ImportError:
- # PyQt v4.4: not a problem for guidata as Signal and Slot are not used
- # but it would be a problem for spyderlib for example
- pass
-
- from PyQt4.QtCore import pyqtProperty as Property
- from PyQt4.QtCore import QT_VERSION_STR as __version__
+if os.environ['QT_API'] == 'pyqt5':
+ from PyQt5.QtCore import * # analysis:ignore
+ from PyQt5.QtCore import QCoreApplication
+ from PyQt5.QtCore import pyqtSignal as Signal
+ from PyQt5.QtCore import pyqtSlot as Slot
+ from PyQt5.QtCore import pyqtProperty as Property
+ from PyQt5.QtCore import QT_VERSION_STR as __version__
+elif os.environ['QT_API'] == 'pyqt':
+ from PyQt4.QtCore import * # analysis:ignore
+ from PyQt4.Qt import QCoreApplication # analysis:ignore
+ from PyQt4.Qt import Qt # analysis:ignore
+ from PyQt4.QtCore import pyqtSignal as Signal # analysis:ignore
+ from PyQt4.QtCore import pyqtSlot as Slot # analysis:ignore
+ from PyQt4.QtCore import pyqtProperty as Property # analysis:ignore
+ from PyQt4.QtCore import QT_VERSION_STR as __version__ # analysis:ignore
+ # Forces new modules written by PyQt4 developers to be PyQt5-compatible
+ del SIGNAL, SLOT
else:
import PySide.QtCore
- __version__ = PySide.QtCore.__version__
- from PySide.QtCore import *
+ __version__ = PySide.QtCore.__version__ # analysis:ignore
+ from PySide.QtCore import * # analysis:ignore
diff --git a/guidata/qt/QtDesigner.py b/guidata/qt/QtDesigner.py
new file mode 100644
index 0000000..1c53293
--- /dev/null
+++ b/guidata/qt/QtDesigner.py
@@ -0,0 +1,14 @@
+# -*- coding: utf-8 -*-
+#
+# Copyright © 2012 Pierre Raybaut
+# Licensed under the terms of the MIT License
+# (see spyderlib/__init__.py for details)
+
+import os
+
+if os.environ['QT_API'] == 'pyqt5':
+ from PyQt5.QtDesigner import * # analysis:ignore
+elif os.environ['QT_API'] == 'pyqt':
+ from PyQt4.QtDesigner import * # analysis:ignore
+else:
+ from PySide.QtDesigner import * # analysis:ignore
diff --git a/guidata/qt/QtGui.py b/guidata/qt/QtGui.py
index c9e25b5..2ac4bb5 100644
--- a/guidata/qt/QtGui.py
+++ b/guidata/qt/QtGui.py
@@ -6,8 +6,15 @@
import os
-if os.environ['QT_API'] == 'pyqt':
- from PyQt4.Qt import QKeySequence, QTextCursor
- from PyQt4.QtGui import *
+if os.environ['QT_API'] == 'pyqt5':
+ from PyQt5.QtCore import QSortFilterProxyModel # analysis:ignore
+ from PyQt5.QtPrintSupport import (QPrinter, QPrintDialog, # analysis:ignore
+ QAbstractPrintDialog)
+ from PyQt5.QtPrintSupport import QPrintPreviewDialog # analysis:ignore
+ from PyQt5.QtGui import * # analysis:ignore
+ from PyQt5.QtWidgets import * # analysis:ignore
+elif os.environ['QT_API'] == 'pyqt':
+ from PyQt4.Qt import QKeySequence, QTextCursor # analysis:ignore
+ from PyQt4.QtGui import * # analysis:ignore
else:
- from PySide.QtGui import *
+ from PySide.QtGui import * # analysis:ignore
diff --git a/guidata/qt/QtSvg.py b/guidata/qt/QtSvg.py
new file mode 100644
index 0000000..f4443b6
--- /dev/null
+++ b/guidata/qt/QtSvg.py
@@ -0,0 +1,14 @@
+# -*- coding: utf-8 -*-
+#
+# Copyright © 2012 Pierre Raybaut
+# Licensed under the terms of the MIT License
+# (see spyderlib/__init__.py for details)
+
+import os
+
+if os.environ['QT_API'] == 'pyqt5':
+ from PyQt5.QtSvg import * # analysis:ignore
+elif os.environ['QT_API'] == 'pyqt':
+ from PyQt4.QtSvg import * # analysis:ignore
+else:
+ from PySide.QtSvg import * # analysis:ignore
diff --git a/guidata/qt/QtWebKit.py b/guidata/qt/QtWebKit.py
index 5fc81c8..60c6dca 100644
--- a/guidata/qt/QtWebKit.py
+++ b/guidata/qt/QtWebKit.py
@@ -2,11 +2,15 @@
#
# Copyright © 2011 Pierre Raybaut
# Licensed under the terms of the MIT License
-# (copied from Spyder source code [spyderlib.qt])
+# (see spyderlib/__init__.py for details)
import os
-if os.environ['QT_API'] == 'pyqt':
- from PyQt4.QtWebKit import *
+if os.environ['QT_API'] == 'pyqt5':
+ from PyQt5.QtWebKitWidgets import QWebPage, QWebView # analysis:ignore
+ from PyQt5.QtWebKit import QWebSettings # analysis:ignore
+elif os.environ['QT_API'] == 'pyqt':
+ from PyQt4.QtWebKit import (QWebPage, QWebView, # analysis:ignore
+ QWebSettings)
else:
- from PySide.QtWebKit import *
\ No newline at end of file
+ from PySide.QtWebKit import * # analysis:ignore
diff --git a/guidata/qt/__init__.py b/guidata/qt/__init__.py
index 9e6b8a4..d970de8 100644
--- a/guidata/qt/__init__.py
+++ b/guidata/qt/__init__.py
@@ -1,60 +1,65 @@
# -*- coding: utf-8 -*-
#
-# Copyright © 2011 Pierre Raybaut
+# Copyright © 2011-2012 Pierre Raybaut
+# © 2012-2014 anatoly techtonik
# Licensed under the terms of the MIT License
-# (copied from Spyder source code [spyderlib.qt])
+# (see spyderlib/__init__.py for details)
"""Transitional package (PyQt4 --> PySide)"""
import os
-import warnings
-
-_modname = os.environ.setdefault('QT_API', 'pyqt')
-assert _modname in ('pyqt', 'pyside')
-
-if _modname == 'pyqt':
- # [June 2011]
- # For now, we do not force the QString, QVariant, (...) API number because
- # `guidata` and its visualization counterpart `guiqwt` are compatible
- # with both API #1 and API #2. Moreover, `guiqwt` is currently based on
- # PyQwt, so unless we switch to Python 3 (probably not until 2012-2013),
- # there is absolutely no point forcing API to #2 because it wouldn't work
- # with PySide anyway (because a PySideQwt library would be needed).
- # But note that `guidata` itself already works with PySide (a few things
- # need to be done to officially support PySide, like the file dialogs
- # compatibility issues).
- #
- # As a consequence, with Python 2.x, the default PyQt API will be API #1
- # (i.e. with QString and QVariant objects), unless the API has been set
- # before importing this module.
- #
-# try:
-# import sip
-# sip.setapi('QString', 2)
-# sip.setapi('QVariant', 2)
-# except AttributeError:
-# warnings.warn("PyQt version is < v4.6\n"
-# "We try to keep guidata compatible with PyQt >=4.4, "
-# "so please report any compatibility issue.",
-# PendingDeprecationWarning, stacklevel=2)
-# except ValueError, error:
-# warnings.warn("PyQt has been set to API#1\n"
-# "Note that, even if guidata is designed for API#2, "
-# "we try to keep it compatible with API#1, "
-# "so please report any compatibility issue.",
-# PendingDeprecationWarning, stacklevel=2)
+
+os.environ.setdefault('QT_API', 'pyqt')
+assert os.environ['QT_API'] in ('pyqt5', 'pyqt', 'pyside')
+
+API = os.environ['QT_API']
+API_NAME = {'pyqt5': 'PyQt5', 'pyqt': 'PyQt4', 'pyside': 'PySide'}[API]
+
+PYQT5 = False
+
+if API == 'pyqt5':
try:
- from PyQt4.QtCore import PYQT_VERSION_STR as __version__
- __version_info__ = tuple(__version__.split('.')+['final', 1])
- is_pyqt46 = __version__.startswith('4.6')
+ from PyQt5.QtCore import PYQT_VERSION_STR as __version__
+ is_old_pyqt = False
+ is_pyqt46 = False
+ PYQT5 = True
+ except ImportError:
+ pass
+ from PyQt5 import uic # analysis:ignore
+elif API == 'pyqt':
+ # Spyder 2.3 is compatible with both #1 and #2 PyQt API,
+ # but to avoid issues with IPython and other Qt plugins
+ # we choose to support only API #2 for 2.4+
+ import sip
+ try:
+ sip.setapi('QString', 2)
+ sip.setapi('QVariant', 2)
+ except AttributeError:
+ # PyQt < v4.6. The actual check is done by requirements.check_qt()
+ # call from spyder.py
+ pass
+
+ try:
+ from PyQt4.QtCore import PYQT_VERSION_STR as __version__ # analysis:ignore
except ImportError:
# Switching to PySide
- os.environ['QT_API'] = _modname = 'pyside'
-
-if _modname == 'pyside':
- warnings.warn("guidata is still not fully compatible with PySide",
- RuntimeWarning)
- import PySide
- __version__ = PySide.__version__
- from PySide import *
- is_pyqt46 = False
+ API = os.environ['QT_API'] = 'pyside'
+ API_NAME = 'PySide'
+ else:
+ is_old_pyqt = __version__.startswith(('4.4', '4.5', '4.6', '4.7'))
+ is_pyqt46 = __version__.startswith('4.6')
+ import sip
+ try:
+ API_NAME += (" (API v%d)" % sip.getapi('QString'))
+ except AttributeError:
+ pass
+ from PyQt4 import uic # analysis:ignore
+
+
+if API == 'pyside':
+ try:
+ from PySide import __version__ # analysis:ignore
+ except ImportError:
+ raise ImportError("Spyder requires PySide or PyQt to be installed")
+ else:
+ is_old_pyqt = is_pyqt46 = False
diff --git a/guidata/qthelpers.py b/guidata/qthelpers.py
index 0bebc97..9d42ee2 100644
--- a/guidata/qthelpers.py
+++ b/guidata/qthelpers.py
@@ -20,7 +20,7 @@ from guidata.qt.QtGui import (QAction, QApplication, QColor, QHBoxLayout, QIcon,
QKeySequence, QLabel, QLineEdit, QMenu,
QPushButton, QStyle, QToolButton, QVBoxLayout,
QWidget, QGroupBox)
-from guidata.qt.QtCore import SIGNAL, Qt
+from guidata.qt.QtCore import Qt
# Local imports:
from guidata.configtools import get_icon
@@ -50,12 +50,12 @@ def create_action(parent, title, triggered=None, toggled=None,
"""
action = QAction(title, parent)
if triggered:
- parent.connect(action, SIGNAL("triggered(bool)"), triggered)
+ action.triggered.connect(triggered)
if checkable is not None:
# Action may be checkable even if the toggled signal is not connected
action.setCheckable(checkable)
if toggled:
- parent.connect(action, SIGNAL("toggled(bool)"), toggled)
+ action.toggled.connect(toggled)
action.setCheckable(True)
if icon is not None:
assert isinstance(icon, QIcon)
@@ -90,9 +90,9 @@ def create_toolbutton(parent, icon=None, text=None, triggered=None, tip=None,
button.setToolButtonStyle(Qt.ToolButtonTextBesideIcon)
button.setAutoRaise(True)
if triggered is not None:
- parent.connect(button, SIGNAL('clicked()'), triggered)
+ button.clicked.connect(triggered)
if toggled is not None:
- parent.connect(button, SIGNAL("toggled(bool)"), toggled)
+ button.toggled.connect(toggled)
button.setCheckable(True)
if shortcut is not None:
button.setShortcut(shortcut)
@@ -112,7 +112,7 @@ def create_groupbox(parent, title=None, toggled=None, checked=None,
group.setCheckable(True)
if checked is not None:
group.setChecked(checked)
- parent.connect(group, SIGNAL("toggled(bool)"), toggled)
+ group.toggled.connect(toggled)
if layout is not None:
group.setLayout(layout)
return group
diff --git a/guidata/qtwidgets.py b/guidata/qtwidgets.py
index 656d6ee..b7c297e 100644
--- a/guidata/qtwidgets.py
+++ b/guidata/qtwidgets.py
@@ -14,8 +14,9 @@ for developing easily Qt-based graphical user interfaces.
"""
from math import cos, sin, pi
+from guidata.qt import PYQT5
from guidata.qt.QtGui import QLabel, QPainter, QPen, QWidget, QDockWidget
-from guidata.qt.QtCore import SIGNAL, QSize, Qt
+from guidata.qt.QtCore import QSize, Qt
# Local imports:
from guidata.configtools import get_family
@@ -102,8 +103,7 @@ class DockableWidgetMixin(object):
dock.setAllowedAreas(self._allowed_areas)
dock.setFeatures(self._features)
dock.setWidget(self)
- self.connect(dock, SIGNAL('visibilityChanged(bool)'),
- self.visibility_changed)
+ dock.visibilityChanged.connect(self.visibility_changed)
self.dockwidget = dock
return (dock, self._location)
@@ -121,5 +121,8 @@ class DockableWidgetMixin(object):
class DockableWidget(QWidget, DockableWidgetMixin):
def __init__(self, parent):
- QWidget.__init__(self, parent)
- DockableWidgetMixin.__init__(self, parent)
+ if PYQT5:
+ super(DockableWidget, self).__init__(parent, parent=parent)
+ else:
+ QWidget.__init__(self, parent)
+ DockableWidgetMixin.__init__(self, parent)
diff --git a/guidata/tests/editgroupbox.py b/guidata/tests/editgroupbox.py
index 3650ba5..298d23b 100644
--- a/guidata/tests/editgroupbox.py
+++ b/guidata/tests/editgroupbox.py
@@ -15,7 +15,6 @@ layout, showing read-only parameter sets or allowing to edit parameter values.
SHOW = True # Show test in GUI-based test launcher
from guidata.qt.QtGui import QMainWindow, QSplitter
-from guidata.qt.QtCore import SIGNAL
from guidata.dataset.datatypes import (DataSet, BeginGroup, EndGroup,
BeginTabGroup, EndTabGroup)
@@ -79,8 +78,7 @@ class MainWindow(QMainWindow):
OtherDataSet, comment='')
self.groupbox4 = DataSetEditGroupBox("Standard dataset",
ExampleMultiGroupDataSet, comment='')
- self.connect(self.groupbox3, SIGNAL("apply_button_clicked()"),
- self.update_window)
+ self.groupbox3.SIG_APPLY_BUTTON_CLICKED.connect(self.update_window)
self.update_groupboxes()
splitter = QSplitter(self)
diff --git a/setup.cfg b/setup.cfg
new file mode 100644
index 0000000..b14b0bc
--- /dev/null
+++ b/setup.cfg
@@ -0,0 +1,5 @@
+[egg_info]
+tag_build =
+tag_date = 0
+tag_svn_revision = 0
+
diff --git a/setup.py b/setup.py
index 7e9e3dd..30a73b6 100644
--- a/setup.py
+++ b/setup.py
@@ -22,6 +22,7 @@ Licensed under the terms of the CECILL License
from __future__ import print_function
+import setuptools # analysis:ignore
from distutils.core import setup
import os
@@ -37,8 +38,13 @@ LONG_DESCRIPTION = """Set of basic GUIs to edit and display objects of many kind
- ndarrays (NumPy's n-dimensional arrays) ;
- etc."""
KEYWORDS = ''
-CLASSIFIERS = ['Development Status :: 5 - Production/Stable',
- 'Topic :: Scientific/Engineering']
+CLASSIFIERS = ['Topic :: Scientific/Engineering']
+if 'beta' in version or 'b' in version:
+ CLASSIFIERS += ['Development Status :: 4 - Beta']
+elif 'alpha' in version or 'a' in version:
+ CLASSIFIERS += ['Development Status :: 3 - Alpha']
+else:
+ CLASSIFIERS += ['Development Status :: 5 - Production/Stable']
if os.name == 'nt':
SCRIPTS = ['guidata-tests', 'guidata-tests.bat']
@@ -83,8 +89,6 @@ if sphinx:
setup(name=LIBNAME, version=version,
- download_url='http://%s.googlecode.com/files/%s-%s.zip' % (
- LIBNAME, LIBNAME, version),
description=DESCRIPTION, long_description=LONG_DESCRIPTION,
packages=get_subpackages(LIBNAME),
package_data={LIBNAME:
@@ -92,8 +96,9 @@ setup(name=LIBNAME, version=version,
scripts=SCRIPTS,
requires=["PyQt4 (>4.3)",],
author = "Pierre Raybaut",
- author_email = 'pierre.raybaut at cea.fr',
- url = 'http://www.cea.fr',
+ author_email = 'pierre.raybaut at gmail.com',
+ url = 'https://github.com/PierreRaybaut/%s' % LIBNAME,
+ license = 'CeCILL V2',
classifiers=CLASSIFIERS + [
'Operating System :: MacOS',
'Operating System :: Microsoft :: Windows',
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/guidata.git
More information about the debian-science-commits
mailing list