Skip to main content

unredoable

Python package providing object-specific undoing & redoing functionality through wrapper class

Build codecov Python 3.6 PyPI MIT License

Download

pip install unredoable

Usage

from unredoable import Unredoable

class StateManager:
    def __init__(self, state_variable):
        self.unredoable_state_variable = Unredoable(state_variable, max_stack_depths=10, craft_deep_copies=False)
        
        # state_variable may be of whatever type, whether custom or not, 
        # the sole restraint it's subject to, is that is needs to implement 
        # either __copy__ or __deepcopy__, depending on the passed 
        # 'craft_deep_copies' parameter
        
    def alter_state_variable(self):
        self.unredoable_state_variable.push_state()
        
        self.unredoable_state_variable.obj += 1

if __name__ == '__main__':
    manager = StateManager(69)
    
    manager.alter_state_variable()
    manager.alter_state_variable()
    
    manager.unredoable_state_variable.undo()  # unredoable_state_variable = 70
    manager.unredoable_state_variable.redo()  # unredoable_state_variable = 71

Author

Janek Zangenberg

License

MIT

Metadata

Release files for unredoable 0.0.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for unredoable 0.0.5
File Size Uploaded
unredoable-0.0.5.tar.gz 3.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for unredoable 0.0.5
File Interpreter ABI Platform
unredoable-0.0.5-py3-none-any.whl Python 3 none any Details

Total release size: 7.7 kB

Release files / unredoable-0.0.5.tar.gz

Download URL unredoable-0.0.5.tar.gz
Size 3.8 kB
Tags Source
SHA-256 checksum
How to use checksums
6a950d6e77f1db18075b089c27e231a83eb0c4907ecbe9e304709a0d4bb3e9b1
BLAKE2b-256 checksum
How to use checksums
2644a7e6271c503b66f089dcf5a79fb2bd15816a26e756dca07646366247ba1f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.14 CPython/3.8.13 Linux/5.15.0-46-generic

Release files / unredoable-0.0.5-py3-none-any.whl

Download URL unredoable-0.0.5-py3-none-any.whl
Size 3.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
df242d3e0b72eacb830e74fff42ca36536ceb7c8b5a171ad8e653d689e968ad9
BLAKE2b-256 checksum
How to use checksums
788e3fef64590465f9182b25669048654fbb518b6a7e584bc6a080e8e875d5d7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.14 CPython/3.8.13 Linux/5.15.0-46-generic

Release history Release notifications | RSS feed

This release

0.0.5 This release

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page