This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Utilities for building concurrent PyQt5 applications. | |
""" | |
from __future__ import absolute_import | |
import threading | |
import weakref | |
import logging | |
import warnings |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
usage() { | |
echo "$0 [ --version VERSION ] FRAMEWORKPATH | |
Fetch, extract and layout a macOS relocatable Python framework at FRAMEWORKPATH | |
Options: | |
--version VERSION Python version (default ${VERSION}) | |
--macos MACOSVER Minimum supported macOS version (as of 3.6.5 and |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Check Combo Box | |
--------------- | |
A QComboBox subclass designed for multiple item selection. | |
The combo box popup allows the user to check/uncheck multiple items at | |
once. | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
An experiment to fix PyQt QObject.tr context override | |
https://www.riverbankcomputing.com/static/Docs/PyQt5/i18n.html#differences-between-pyqt5-and-qt | |
.. note:: | |
Known deficiencies: | |
* No support for @property, @pyQtSlot, etc. decorators |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Inspect/config numpy-linked OpenBLAS | |
""" | |
import re | |
import ctypes | |
import numpy.core | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Utilities for inspecting/modifying widget geometry state as returned/set by | |
`QWidget.saveGeometry` and `QWidget.restoreGeometry` | |
""" | |
import struct | |
from collections import namedtuple | |
#: Parsed geometry state (version 1; Qt < 5.4) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from functools import singledispatch | |
def singledispatch_next(f): | |
""" | |
Decorate a `singledispatch` function f with a `next` method. | |
`f.next(__class__)` dispatches to the 'base' or next implementation in | |
the __class__'s mro chain. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Read the IDX file format as described by http://yann.lecun.com/exdb/mnist/ | |
""" | |
import os | |
import io | |
import struct | |
import mmap | |
from functools import reduce | |
from typing import IO, Tuple, Union |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from typing import overload, Union, Type, TypeVar, Any | |
from functools import lru_cache | |
from PyQt5.QtCore import QObject, pyqtProperty as Property | |
@lru_cache(maxsize=200) | |
def _converter(type_: Union[type, str]): | |
class Obj(QObject): | |
__slots__ = ("field",) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from PyQt5.QtCore import QObject, pyqtProperty | |
class Q_Property(pyqtProperty): | |
""" | |
A descriptor that more closely resembles the Q_PROPERTY macro. | |
Encourage a coding style which is consistent with Qt. | |
Example: |
NewerOlder