A Pretty Project Framework
Project description
A pretty project framework for Python3 & PySide6.
I hope it is useful for you, too. :D
Dict Storage
All the project items’ values are stored in the project.value dict. The key is the item name. Generally this dict can be serialized and stored in the file if the dict can be pickled directly.
import prett
class ItemDemo(prett.IntProjectItem):
pass
class ProjectDemo(prett.AbstractProject):
def __init__(self):
self.width = ItemDemo(self)
self.height = ItemDemo(self)
p = ProjectDemo()
p.width.int.value = 16
p.height.int.value = 20
print(p.value) # {'width': '16', 'height': '20'}
Type Conversion
In prett, there are default type conversion in string-int and string-float. When the item is inherited from StringIntItem, the item value is stored in string type, and its int property will automatically convert to or from string type.
import prett
class ItemDemo(prett.IntProjectItem):
pass
class ProjectDemo(prett.AbstractProject):
def __init__(self):
self.length = ItemDemo(self)
p = ProjectDemo()
p.length.string.value = '200'
print(p.length.int.value) # 200, type is int
Changed Signal
When the value of property change, the changed signals of project, item, and properties will be emitted.
import prett
class ItemDemo(prett.IntProjectItem):
pass
class ProjectDemo(prett.AbstractProject):
def __init__(self):
self.width = ItemDemo(self)
self.height = ItemDemo(self)
p = ProjectDemo()
p.width.int.value = 16 # p.changed signal emitted, p.width.changed emitted
# then p.width.string.changed emitted, p.width.int.changed emitted
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file prett6-1.0.0.tar.gz
.
File metadata
- Download URL: prett6-1.0.0.tar.gz
- Upload date:
- Size: 10.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.10.14
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7f6c2e1eeeaf775fc8cb333e7386f95abbbd4906f3443a688eb4a34736a111c9 |
|
MD5 | 49de0e554587fbacabc347b19caca1ac |
|
BLAKE2b-256 | 4f776af01a23a0922e47752cb976a551f0bc69900c5c77618625fb45f04a4b74 |
File details
Details for the file prett6-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: prett6-1.0.0-py3-none-any.whl
- Upload date:
- Size: 14.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.10.14
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4ed44277d81b222301a24ea08f59f8d0c7d512a58ebbdc3c3ba62065c7a14826 |
|
MD5 | d4273aaf7d128b4dd532448d353dcedd |
|
BLAKE2b-256 | ceb80b3e6c7947f619d103f507deeba16a5b4e89746b66153322d43cf6dbb18f |