https://github.com/greatfruitomsk/qrc_pathlib
Extension for pathlib that implements Path and PurePath for Qt Resources Syste.
https://github.com/greatfruitomsk/qrc_pathlib
Last synced: 3 months ago
JSON representation
Extension for pathlib that implements Path and PurePath for Qt Resources Syste.
- Host: GitHub
- URL: https://github.com/greatfruitomsk/qrc_pathlib
- Owner: GreatFruitOmsk
- License: mit
- Created: 2016-04-28T22:59:27.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2016-04-30T20:51:14.000Z (about 9 years ago)
- Last Synced: 2025-02-05T06:44:39.261Z (4 months ago)
- Language: Python
- Size: 10.7 KB
- Stars: 0
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
.. image:: https://travis-ci.org/GreatFruitOmsk/qrc_pathlib.svg?branch=master
qrc_pathlib
===========`Qt Resource System `_ allows to store files
inside binaries and read them by using Qt's file system abstraction (QFile, QDir etc).This package extends `pathlib `_ introduced in Python 3.4
by implementing ``Path`` and ``PurePath`` for QRS:.. code-block:: python
from qrc_pathlib import QrcPath
QrcPath(':my_resource.svg').read_bytes()
with QrcPath(':hello.txt').open() as f:
print(f.read())Since QRS is read-only all methods that are supposed to modify files raise ``PermissionError``. Other inapplicable methods
such as ``stat`` will raise ``NotImplementedError``.