cutcutcodec 1.0.post3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of cutcutcodec might be problematic. Click here for more details.
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/__init__.py +6 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/__main__.py +38 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/c_build.py +33 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/analysis/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/analysis/_helper_properties.py +52 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/analysis/audio/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/analysis/audio/properties/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/analysis/audio/properties/duration.py +83 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/analysis/ffprobe.py +637 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/analysis/graph/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/analysis/graph/find.py +82 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/analysis/graph/time_backprop.py +68 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/analysis/stream/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/analysis/stream/rate_audio.py +239 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/analysis/stream/rate_video.py +97 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/analysis/stream/shape.py +107 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/analysis/stream/time_backprop.py +183 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/analysis/video/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/analysis/video/properties/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/analysis/video/properties/duration.py +162 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/analysis/video/properties/nb_frames.py +159 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/analysis/video/properties/rate.py +102 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/analysis/video/properties/timestamps.py +194 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/classes/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/classes/container.py +40 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/classes/encoder.py +152 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/classes/filter.py +33 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/classes/frame.py +127 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/classes/frame_audio.py +205 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/classes/frame_video.py +322 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/classes/layout.py +206 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/classes/meta_filter.py +41 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/classes/muxer.py +184 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/classes/node.py +164 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/classes/stream.py +182 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/classes/stream_audio.py +130 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/classes/stream_video.py +193 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/compilation/__init__.py +7 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/compilation/ast_to_file.py +125 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/compilation/export/__init__.py +6 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/compilation/export/compatibility.py +734 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/compilation/export/default.py +99 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/compilation/export/encodec.py +40 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/compilation/export/muxer.py +8 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/compilation/export/rate.py +133 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/compilation/graph_to_ast.py +477 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/compilation/graph_to_json.py +104 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/compilation/graph_to_tree.py +190 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/compilation/json_to_graph.py +114 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/compilation/parse.py +123 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/compilation/sympy_to_torch/__init__.py +15 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/compilation/sympy_to_torch/dynamic.py +544 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/compilation/sympy_to_torch/lambdify.py +612 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/compilation/sympy_to_torch/preprocess.py +698 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/compilation/sympy_to_torch/printer.py +926 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/compilation/tree_to_graph.py +168 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/edit/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/edit/decision/__init__.py +8 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/edit/operation/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/edit/operation/add.py +73 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/edit/operation/remove.py +476 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/exceptions.py +60 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/filters/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/filters/audio/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/filters/audio/add.py +170 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/filters/audio/cat.py +60 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/filters/audio/cut.py +112 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/filters/audio/delay.py +85 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/filters/audio/equation.py +261 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/filters/audio/fir.py +231 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/filters/audio/identity.py +48 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/filters/audio/resample.py +451 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/filters/audio/subclip.py +91 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/filters/cut.py +74 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/filters/mix/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/filters/mix/audio_cast.py +208 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/filters/mix/video_cast.py +197 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/filters/subclip.py +53 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/filters/video/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/filters/video/add.py +331 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/filters/video/cat.py +60 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/filters/video/cut.py +113 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/filters/video/delay.py +84 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/filters/video/equation.py +265 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/filters/video/identity.py +48 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/filters/video/pad.py +99 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/filters/video/subclip.py +91 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/generation/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/generation/audio/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/generation/audio/empty.py +73 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/generation/audio/equation.py +56 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/generation/audio/noise.py +243 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/generation/video/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/generation/video/c_fractal.cpython-312-x86_64-linux-gnu.so +0 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/generation/video/empty.py +69 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/generation/video/equation.py +109 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/generation/video/fractal/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/generation/video/fractal/fractal.c +116 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/generation/video/fractal/geometry.py +100 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/generation/video/fractal/mandelbrot.py +176 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/generation/video/noise.py +112 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/interfaces/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/interfaces/seedable.py +82 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/io/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/io/read_ffmpeg.py +904 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/io/read_svg.py +145 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/io/scheduler.py +356 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/io/write.py +340 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/opti/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/opti/cache/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/opti/cache/basic.py +35 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/opti/cache/clean/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/opti/cache/clean/graph.py +80 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/opti/cache/hashes/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/opti/cache/hashes/graph.py +81 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/opti/cache/singleton.py +47 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/opti/cuda/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/opti/factor/__init__.py +5 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/opti/factor/proba.py +189 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/opti/generalize/__init__.py +5 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/opti/generalize/delay_to_fir.py +88 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/opti/graph.py +17 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/opti/parallel/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/opti/parallel/buffer.py +90 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/opti/utils.py +34 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/examples/audio_5.1_narration.oga +0 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/examples/intro.webm +0 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/examples/logo.svg +13 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/examples/project.json +226 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/examples/video.mp4 +0 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/__init__.py +8 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/__main__.py +25 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/actions.py +63 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/app/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/app/app.py +248 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/base.py +50 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/edit_node_state/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/edit_node_state/all/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/edit_node_state/all/container_input_ffmpeg.py +90 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/edit_node_state/all/filter_audio_delay.py +9 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/edit_node_state/all/filter_audio_equation.py +45 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/edit_node_state/all/filter_audio_fir.py +58 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/edit_node_state/all/filter_audio_subclip.py +9 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/edit_node_state/all/filter_cut.py +82 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/edit_node_state/all/filter_delay.py +20 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/edit_node_state/all/filter_subclip.py +21 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/edit_node_state/all/filter_video_delay.py +9 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/edit_node_state/all/filter_video_equation.py +53 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/edit_node_state/all/filter_video_subclip.py +9 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/edit_node_state/all/generator_audio_equation.py +14 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/edit_node_state/all/generator_audio_noise.py +19 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/edit_node_state/all/generator_video_equation.py +13 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/edit_node_state/all/generator_video_mandelbrot.py +60 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/edit_node_state/all/generator_video_noise.py +18 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/edit_node_state/base.py +99 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/edit_node_state/default.py +27 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/edit_node_state/documentation.py +47 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/edit_node_state/general.py +71 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/edit_node_state/interface.py +305 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/edit_node_state/loader.py +41 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/edit_node_state/main.py +62 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/edition_tabs.py +34 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/entry/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/entry/base.py +122 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/entry/filters.py +42 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/entry/generators.py +42 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/entry_tabs.py +46 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/export/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/export/_helper.py +54 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/export/container.py +226 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/export/doc.py +67 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/export/encodec.py +289 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/export/main.py +173 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/flowchart/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/flowchart/edge_properties.py +56 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/flowchart/main.py +280 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/flowchart/node.py +44 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/main.py +151 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/menu.py +21 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/preferences/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/preferences/audio_settings.py +183 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/preferences/main.py +41 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/preferences/video_settings.py +257 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/run.py +71 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/timeline/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/timeline/main.py +30 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/timeline/slider.py +286 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/timeline/track.py +97 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/timeline/view.py +90 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/toolbar.py +29 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/tools.py +23 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/video_preview/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/video_preview/audio_player.py +103 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/video_preview/control.py +96 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/video_preview/frame_extractor.py +254 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/video_preview/main.py +115 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/testing/__init__.py +8 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/testing/__main__.py +27 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/testing/coding_style.py +49 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/testing/generation.py +52 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/testing/install.py +72 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/testing/run.py +58 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/testing/tests/abstract.py +215 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/testing/tests/audio_cast.py +35 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/testing/tests/audio_equation.py +71 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/testing/tests/c_memory.py +132 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/testing/tests/compatibility.py +27 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/testing/tests/compile.py +42 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/testing/tests/encoder.py +23 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/testing/tests/filter_cut.py +107 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/testing/tests/filter_delay.py +71 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/testing/tests/filter_empty.py +40 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/testing/tests/fir.py +143 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/testing/tests/hashes.py +23 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/testing/tests/initialisation.py +24 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/testing/tests/muxer.py +22 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/testing/tests/nan_snapshot.py +39 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/testing/tests/read.py +192 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/testing/tests/serialization_equality.py +50 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/testing/tests/snapshot_shape.py +21 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/testing/tests/sympy_to_torch.py +135 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/testing/tests/thread_safe.py +77 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/testing/tests/time_range.py +55 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/testing/tests/video_equation.py +77 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/testing/tests/write.py +95 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/utils.py +40 -0
- cutcutcodec-1.0.post3.dist-info/LICENSE +7 -0
- cutcutcodec-1.0.post3.dist-info/METADATA +271 -0
- cutcutcodec-1.0.post3.dist-info/RECORD +233 -0
- cutcutcodec-1.0.post3.dist-info/WHEEL +5 -0
- cutcutcodec-1.0.post3.dist-info/entry_points.txt +6 -0
- cutcutcodec-1.0.post3.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
|
|
3
|
+
"""Properties of a ``cutcutcodec.core.filter.basic.cut.FilterCut``."""
|
|
4
|
+
|
|
5
|
+
from fractions import Fraction
|
|
6
|
+
|
|
7
|
+
from qtpy import QtWidgets
|
|
8
|
+
|
|
9
|
+
from cutcutcodec.gui.edit_node_state.base import EditBase
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class EditFilterCut(EditBase):
|
|
13
|
+
"""Allow to view and modify the properties of a filter of type ``FilterCut``."""
|
|
14
|
+
|
|
15
|
+
def __init__(self, parent, node_name):
|
|
16
|
+
super().__init__(parent, node_name)
|
|
17
|
+
|
|
18
|
+
self.limit_textboxs = self.limit_labels = None
|
|
19
|
+
|
|
20
|
+
self.grid_layout = QtWidgets.QGridLayout()
|
|
21
|
+
self.init_limit(self.grid_layout)
|
|
22
|
+
self.setLayout(self.grid_layout)
|
|
23
|
+
|
|
24
|
+
def init_limit(self, grid_layout, ref_span=0):
|
|
25
|
+
"""Display and allows to modify the limits."""
|
|
26
|
+
class _Val:
|
|
27
|
+
|
|
28
|
+
def __init__(self, limit_index, window):
|
|
29
|
+
self.limit_index = limit_index
|
|
30
|
+
self.window = window
|
|
31
|
+
|
|
32
|
+
def __call__(self, text):
|
|
33
|
+
return self.window.update_limit(text, self.limit_index)
|
|
34
|
+
|
|
35
|
+
def __repr__(self): # for remove pylint R0903
|
|
36
|
+
return f"verification limit {self.limit_index}"
|
|
37
|
+
limits = self.state["limits"] + [""]
|
|
38
|
+
self.limit_labels = [QtWidgets.QLabel(f"Limit {i} (second)") for i in range(len(limits))]
|
|
39
|
+
self.limit_textboxs = [None for _ in limits]
|
|
40
|
+
for i, limit in enumerate(limits):
|
|
41
|
+
self.limit_textboxs[i] = QtWidgets.QLineEdit()
|
|
42
|
+
self.limit_textboxs[i].setText(str(limit))
|
|
43
|
+
self.limit_textboxs[i].textEdited.connect(_Val(i, self))
|
|
44
|
+
grid_layout.addWidget(self.limit_labels[i], ref_span, 0)
|
|
45
|
+
grid_layout.addWidget(self.limit_textboxs[i], ref_span, 1)
|
|
46
|
+
ref_span += 1
|
|
47
|
+
return ref_span
|
|
48
|
+
|
|
49
|
+
def update_limit(self, text, limit_index):
|
|
50
|
+
"""Check that the limit is correct and update all the limits."""
|
|
51
|
+
changed = False
|
|
52
|
+
if not text and limit_index >= 1 and limit_index + 1 == len(self.state["limits"]):
|
|
53
|
+
changed = True
|
|
54
|
+
new_limits = self.state["limits"][:limit_index]
|
|
55
|
+
else:
|
|
56
|
+
try:
|
|
57
|
+
limit = Fraction(text)
|
|
58
|
+
except (ValueError, ZeroDivisionError):
|
|
59
|
+
self.limit_textboxs[limit_index].setStyleSheet("background:red;")
|
|
60
|
+
return
|
|
61
|
+
new_limits = self.state["limits"].copy()
|
|
62
|
+
if limit_index < len(new_limits):
|
|
63
|
+
new_limits[limit_index] = str(limit)
|
|
64
|
+
else:
|
|
65
|
+
changed = True
|
|
66
|
+
new_limits.append(str(limit))
|
|
67
|
+
limits = list(map(Fraction, new_limits))
|
|
68
|
+
if sorted(limits) != limits or len(set(limits)) != len(limits):
|
|
69
|
+
self.limit_textboxs[limit_index].setStyleSheet("background:red;")
|
|
70
|
+
return
|
|
71
|
+
|
|
72
|
+
def setter(limits):
|
|
73
|
+
self.state["limits"] = limits
|
|
74
|
+
|
|
75
|
+
self.try_set_state(
|
|
76
|
+
self.get_updated_state((lambda: self.state["limits"]), setter, new_limits)
|
|
77
|
+
)
|
|
78
|
+
if changed: # redraw the limits fields
|
|
79
|
+
for widget in self.limit_textboxs + self.limit_labels:
|
|
80
|
+
if widget is not None:
|
|
81
|
+
widget.deleteLater()
|
|
82
|
+
self.init_limit(self.grid_layout)
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
|
|
3
|
+
"""Properties of a ``FilterDelay``."""
|
|
4
|
+
|
|
5
|
+
import math
|
|
6
|
+
|
|
7
|
+
from qtpy import QtWidgets
|
|
8
|
+
|
|
9
|
+
from cutcutcodec.gui.edit_node_state.base import EditBase
|
|
10
|
+
from cutcutcodec.gui.edit_node_state.interface import Numerable
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class EditFilterDelay(EditBase):
|
|
14
|
+
"""Allow to view and modify the properties of a filter of type ``FilterDelay``."""
|
|
15
|
+
|
|
16
|
+
def __init__(self, parent, node_name):
|
|
17
|
+
super().__init__(parent, node_name)
|
|
18
|
+
grid_layout = QtWidgets.QGridLayout()
|
|
19
|
+
Numerable(self, "delay", (-math.inf, math.inf), isfinite=True)(grid_layout)
|
|
20
|
+
self.setLayout(grid_layout)
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
|
|
3
|
+
"""Properties of ``FilterAudioSubclip`` and ``FilterVideoSubclip``."""
|
|
4
|
+
|
|
5
|
+
import math
|
|
6
|
+
|
|
7
|
+
from qtpy import QtWidgets
|
|
8
|
+
|
|
9
|
+
from cutcutcodec.gui.edit_node_state.base import EditBase
|
|
10
|
+
from cutcutcodec.gui.edit_node_state.interface import Numerable
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class EditFilterSubclip(EditBase):
|
|
14
|
+
"""Allow to view and modify the properties of a filter of type ``FilterSubclip``."""
|
|
15
|
+
|
|
16
|
+
def __init__(self, parent, node_name):
|
|
17
|
+
super().__init__(parent, node_name)
|
|
18
|
+
grid_layout = QtWidgets.QGridLayout()
|
|
19
|
+
ref_span = Numerable(self, "delay", (0, math.inf), isfinite=True)(grid_layout)
|
|
20
|
+
Numerable(self, "duration_max", (0, math.inf), isfinite=False)(grid_layout, ref_span)
|
|
21
|
+
self.setLayout(grid_layout)
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
|
|
3
|
+
"""Properties of a ``cutcutcodec.core.filter.audio.delay.FilterVideoDelay``."""
|
|
4
|
+
|
|
5
|
+
from cutcutcodec.gui.edit_node_state.all.filter_delay import EditFilterDelay
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class EditFilterVideoDelay(EditFilterDelay):
|
|
9
|
+
"""Allow to view and modify the properties of a filter of type ``FilterVideoDelay``."""
|
cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/edit_node_state/all/filter_video_equation.py
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
|
|
3
|
+
"""Properties of a ``cutcutcodec.core.filters.video.equation.FilterVideoEquation``."""
|
|
4
|
+
|
|
5
|
+
from qtpy import QtWidgets
|
|
6
|
+
|
|
7
|
+
from cutcutcodec.gui.edit_node_state.base import EditBase
|
|
8
|
+
from cutcutcodec.gui.edit_node_state.interface import Equationable
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class EditFilterVideoEquation(EditBase):
|
|
12
|
+
"""Allow to view and modify the properties of a node of type ``FilterVideoEquation``."""
|
|
13
|
+
|
|
14
|
+
def __init__(self, parent, node_name):
|
|
15
|
+
super().__init__(parent, node_name)
|
|
16
|
+
self.colors = []
|
|
17
|
+
self.re_symb = r"i|j|t|[bgra]\d+"
|
|
18
|
+
|
|
19
|
+
self.grid_layout = QtWidgets.QGridLayout()
|
|
20
|
+
self.init_colors(self.grid_layout)
|
|
21
|
+
self.setLayout(self.grid_layout)
|
|
22
|
+
|
|
23
|
+
def init_colors(self, grid_layout, ref_span=0):
|
|
24
|
+
"""Display and allows to modify the equations."""
|
|
25
|
+
if len(self.state["colors"]) == 1:
|
|
26
|
+
self.colors.append(Equationable(self, (0, "colors"), "Gray:", self.re_symb))
|
|
27
|
+
self.colors.append(Equationable(self, (1, "colors"), "Alpha:", self.re_symb))
|
|
28
|
+
elif len(self.state["colors"]) == 2:
|
|
29
|
+
self.colors.append(Equationable(self, (0, "colors"), "Gray (or Blue):", self.re_symb))
|
|
30
|
+
self.colors.append(Equationable(self, (1, "colors"), "Alpha (or Green):", self.re_symb))
|
|
31
|
+
self.colors.append(Equationable(self, (2, "colors"), "Red:", self.re_symb))
|
|
32
|
+
elif len(self.state["colors"]) == 3:
|
|
33
|
+
self.colors.append(Equationable(self, (0, "colors"), "Blue (or Gray):", self.re_symb))
|
|
34
|
+
self.colors.append(Equationable(self, (1, "colors"), "Green (or Alpha):", self.re_symb))
|
|
35
|
+
self.colors.append(Equationable(self, (2, "colors"), "Red:", self.re_symb))
|
|
36
|
+
self.colors.append(Equationable(self, (3, "colors"), "Alpha:", self.re_symb))
|
|
37
|
+
else:
|
|
38
|
+
self.colors.append(Equationable(self, (0, "colors"), "Blue:", self.re_symb))
|
|
39
|
+
self.colors.append(Equationable(self, (1, "colors"), "Green:", self.re_symb))
|
|
40
|
+
self.colors.append(Equationable(self, (2, "colors"), "Red:", self.re_symb))
|
|
41
|
+
self.colors.append(Equationable(self, (3, "colors"), "Alpha:", self.re_symb))
|
|
42
|
+
|
|
43
|
+
for equation in self.colors:
|
|
44
|
+
equation(grid_layout, ref_span)
|
|
45
|
+
ref_span += 1
|
|
46
|
+
return ref_span + 1
|
|
47
|
+
|
|
48
|
+
def reset(self):
|
|
49
|
+
"""Help when called by the colors interface."""
|
|
50
|
+
for color in self.colors:
|
|
51
|
+
color.delete()
|
|
52
|
+
self.colors = []
|
|
53
|
+
self.init_colors(self.grid_layout)
|
cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/edit_node_state/all/filter_video_subclip.py
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
|
|
3
|
+
"""Properties of a ``cutcutcodec.core.filter.video.subclip.FilterVideoSubclip``."""
|
|
4
|
+
|
|
5
|
+
from cutcutcodec.gui.edit_node_state.all.filter_subclip import EditFilterSubclip
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class EditFilterVideoSubclip(EditFilterSubclip):
|
|
9
|
+
"""Allow to view and modify the properties of a filter of type ``FilterVideoSubclip``."""
|
cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/edit_node_state/all/generator_audio_equation.py
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
|
|
3
|
+
"""Properties of a ``cutcutcodec.core.generation.audio.equation.GeneratorAudioEquation``."""
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
from cutcutcodec.gui.edit_node_state.all.filter_audio_equation import EditFilterAudioEquation
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class EditGeneratorAudioEquation(EditFilterAudioEquation):
|
|
10
|
+
"""Allow to view and modify the properties of a node of type ``GeneratorAudioEquation``."""
|
|
11
|
+
|
|
12
|
+
def __init__(self, parent, node_name):
|
|
13
|
+
super().__init__(parent, node_name)
|
|
14
|
+
self.re_symb = r"t"
|
cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/edit_node_state/all/generator_audio_noise.py
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
|
|
3
|
+
"""Properties of a ``cutcutcodec.core.generation.audio.noise.GeneratorAudioNoise``."""
|
|
4
|
+
|
|
5
|
+
from qtpy import QtWidgets
|
|
6
|
+
|
|
7
|
+
from cutcutcodec.gui.edit_node_state.base import EditBase
|
|
8
|
+
from cutcutcodec.gui.edit_node_state.interface import AudioLayoutable, Seedable
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class EditGeneratorAudioNoise(EditBase):
|
|
12
|
+
"""Allow to view and modify the properties of a generator of type ``GeneratorAudioNoise``."""
|
|
13
|
+
|
|
14
|
+
def __init__(self, parent, node_name):
|
|
15
|
+
EditBase.__init__(self, parent, node_name)
|
|
16
|
+
grid_layout = QtWidgets.QGridLayout()
|
|
17
|
+
ref_span = AudioLayoutable(self, enable_default=False)(grid_layout)
|
|
18
|
+
Seedable(self)(grid_layout, ref_span)
|
|
19
|
+
self.setLayout(grid_layout)
|
cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/edit_node_state/all/generator_video_equation.py
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
|
|
3
|
+
"""Properties of a ``cutcutcodec.core.generation.video.equation.GeneratorVideoEquation``."""
|
|
4
|
+
|
|
5
|
+
from cutcutcodec.gui.edit_node_state.all.filter_video_equation import EditFilterVideoEquation
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class EditGeneratorVideoEquation(EditFilterVideoEquation):
|
|
9
|
+
"""Allow to view and modify the properties of a node of type ``GeneratorVideoEquation``."""
|
|
10
|
+
|
|
11
|
+
def __init__(self, parent, node_name):
|
|
12
|
+
super().__init__(parent, node_name)
|
|
13
|
+
self.re_symb = r"i|j|t"
|
cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/edit_node_state/all/generator_video_mandelbrot.py
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
|
|
3
|
+
"""Props of ``cutcutcodec.core.generation.video.fractal.mandelbrot.GeneratorVideoMandelbrot``."""
|
|
4
|
+
|
|
5
|
+
from qtpy import QtWidgets
|
|
6
|
+
|
|
7
|
+
from cutcutcodec.gui.edit_node_state.base import EditBase
|
|
8
|
+
from cutcutcodec.gui.edit_node_state.interface import SingleEq
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class EditGeneratorVideoMandelbrot(EditBase):
|
|
12
|
+
"""View and modify the properties of a generator of type ``GeneratorVideoMandelbrot``."""
|
|
13
|
+
|
|
14
|
+
def __init__(self, parent, node_name):
|
|
15
|
+
super().__init__(parent, node_name)
|
|
16
|
+
grid_layout = QtWidgets.QGridLayout()
|
|
17
|
+
|
|
18
|
+
class _Getter:
|
|
19
|
+
|
|
20
|
+
def __init__(self, state, name):
|
|
21
|
+
self.state = state
|
|
22
|
+
self.name = name
|
|
23
|
+
|
|
24
|
+
def __call__(self):
|
|
25
|
+
return self.state["bounds"][self.name]
|
|
26
|
+
|
|
27
|
+
def __repr__(self):
|
|
28
|
+
return f"{self.name} bounds getter"
|
|
29
|
+
|
|
30
|
+
class _Setter:
|
|
31
|
+
|
|
32
|
+
def __init__(self, state, name):
|
|
33
|
+
self.state = state
|
|
34
|
+
self.name = name
|
|
35
|
+
|
|
36
|
+
def __call__(self, value):
|
|
37
|
+
self.state["bounds"][self.name] = value
|
|
38
|
+
|
|
39
|
+
def __repr__(self):
|
|
40
|
+
return f"{self.name} bounds setter"
|
|
41
|
+
|
|
42
|
+
ref_span = 0
|
|
43
|
+
for name in self.state["bounds"]:
|
|
44
|
+
ref_span = SingleEq(
|
|
45
|
+
self,
|
|
46
|
+
(_Getter(self.state, name), _Setter(self.state, name)),
|
|
47
|
+
f"Expr of {name}:",
|
|
48
|
+
r"t",
|
|
49
|
+
)(grid_layout, ref_span=ref_span)
|
|
50
|
+
|
|
51
|
+
def setter_iters(value):
|
|
52
|
+
self.state["iterations"] = value
|
|
53
|
+
|
|
54
|
+
SingleEq(
|
|
55
|
+
self,
|
|
56
|
+
((lambda: self.state["iterations"]), setter_iters),
|
|
57
|
+
"Iterations Max:",
|
|
58
|
+
r"t"
|
|
59
|
+
)(grid_layout, ref_span=ref_span)
|
|
60
|
+
self.setLayout(grid_layout)
|
cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/edit_node_state/all/generator_video_noise.py
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
|
|
3
|
+
"""Properties of a ``cutcutcodec.core.generation.video.noise.GeneratorVideoNoise``."""
|
|
4
|
+
|
|
5
|
+
from qtpy import QtWidgets
|
|
6
|
+
|
|
7
|
+
from cutcutcodec.gui.edit_node_state.base import EditBase
|
|
8
|
+
from cutcutcodec.gui.edit_node_state.interface import Seedable
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class EditGeneratorVideoNoise(EditBase):
|
|
12
|
+
"""Allow to view and modify the properties of a generator of type ``GeneratorVideoNoise``."""
|
|
13
|
+
|
|
14
|
+
def __init__(self, parent, node_name):
|
|
15
|
+
super().__init__(parent, node_name)
|
|
16
|
+
grid_layout = QtWidgets.QGridLayout()
|
|
17
|
+
Seedable(self)(grid_layout)
|
|
18
|
+
self.setLayout(grid_layout)
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
|
|
3
|
+
"""Allow to unify all node editing windows.
|
|
4
|
+
|
|
5
|
+
Defines several accessors that allow to lighten the code of child classes.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
import copy
|
|
9
|
+
|
|
10
|
+
from qtpy import QtWidgets
|
|
11
|
+
|
|
12
|
+
from cutcutcodec.gui.base import CutcutcodecWidget
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class EditBase(CutcutcodecWidget, QtWidgets.QWidget):
|
|
16
|
+
"""Common base class for all node editing classes."""
|
|
17
|
+
|
|
18
|
+
def __init__(self, parent, node_name):
|
|
19
|
+
super().__init__(parent)
|
|
20
|
+
self._parent = parent
|
|
21
|
+
assert node_name in self.app.graph.nodes, (node_name, set(self.app.graph.nodes))
|
|
22
|
+
self.node_name = node_name
|
|
23
|
+
self.ref = [] # for keeping the reference of the interfaces
|
|
24
|
+
|
|
25
|
+
def get_class(self) -> type:
|
|
26
|
+
"""Return the node class."""
|
|
27
|
+
return self.app.graph.nodes[self.node_name]["class"]
|
|
28
|
+
|
|
29
|
+
def get_updated_state(self, getter: callable, setter: callable, value) -> dict[str]:
|
|
30
|
+
"""Return an independant copy of the current state, with the new attribute."""
|
|
31
|
+
old_value = getter()
|
|
32
|
+
setter(value)
|
|
33
|
+
new_state = copy.deepcopy(self.state)
|
|
34
|
+
setter(old_value)
|
|
35
|
+
return new_state
|
|
36
|
+
|
|
37
|
+
def get_updated_state_dict(self, changes: dict[str]) -> dict[str]:
|
|
38
|
+
"""Return a copy of the old state with the new attribute."""
|
|
39
|
+
return {k: changes.get(k, o) for k, o in self.state.items()}
|
|
40
|
+
|
|
41
|
+
@property
|
|
42
|
+
def state(self) -> dict[str]:
|
|
43
|
+
"""Return a pointer of the node state.
|
|
44
|
+
|
|
45
|
+
Returns the updated reference of the graph state with the tree node state.
|
|
46
|
+
Dosen't change the graph dict id, change it inplace.
|
|
47
|
+
"""
|
|
48
|
+
updated_state = self.app.tree_node(self.node_name).getstate()
|
|
49
|
+
self.app.graph.nodes[self.node_name]["state"].clear()
|
|
50
|
+
self.app.graph.nodes[self.node_name]["state"].update(updated_state)
|
|
51
|
+
return self.app.graph.nodes[self.node_name]["state"]
|
|
52
|
+
|
|
53
|
+
def try_set_state(self, new_state: dict[str], textbox=None) -> bool:
|
|
54
|
+
"""If possible, try to apply the change to the node.
|
|
55
|
+
|
|
56
|
+
In case of AssertionError, the changes are not applied
|
|
57
|
+
and a popup window appears to display the error message.
|
|
58
|
+
Dosen't change the graph dict id, change it inplace.
|
|
59
|
+
|
|
60
|
+
Parameters
|
|
61
|
+
----------
|
|
62
|
+
new_state : dict
|
|
63
|
+
The new different state.
|
|
64
|
+
textbox : PyQt6.QWidget, optional
|
|
65
|
+
Must accepts the method setStyleSheet for changing the bakground color.
|
|
66
|
+
|
|
67
|
+
Returns
|
|
68
|
+
-------
|
|
69
|
+
failed : boolean
|
|
70
|
+
False if succes and True if AssertionError raise in check.
|
|
71
|
+
"""
|
|
72
|
+
state = self.state
|
|
73
|
+
old_state = state.copy()
|
|
74
|
+
assert new_state.keys() == old_state.keys(), (new_state, old_state)
|
|
75
|
+
|
|
76
|
+
# search and format differences
|
|
77
|
+
changes = {k: (o, new_state[k]) for k, o in old_state.items() if o != new_state[k]}
|
|
78
|
+
changes_str = "\n".join(f"change {k} from {o} to {n}" for k, (o, n) in changes.items())
|
|
79
|
+
|
|
80
|
+
# apply changes
|
|
81
|
+
state.clear()
|
|
82
|
+
state.update(new_state)
|
|
83
|
+
try:
|
|
84
|
+
self.app.tree_node(self.node_name)
|
|
85
|
+
self.main_window.refresh() # maybe can cause indirect errors
|
|
86
|
+
except AssertionError as err:
|
|
87
|
+
state.clear()
|
|
88
|
+
state.update(old_state)
|
|
89
|
+
if textbox is not None:
|
|
90
|
+
textbox.setStyleSheet("background:red;")
|
|
91
|
+
QtWidgets.QMessageBox.warning(
|
|
92
|
+
None,
|
|
93
|
+
f"Invalid state of {self.node_name}",
|
|
94
|
+
f"{changes_str}\n\n{err}"
|
|
95
|
+
)
|
|
96
|
+
return True
|
|
97
|
+
if textbox is not None:
|
|
98
|
+
textbox.setStyleSheet("background:none;")
|
|
99
|
+
return False
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
|
|
3
|
+
"""Default editing window in case the main one is not defined.
|
|
4
|
+
|
|
5
|
+
When the specific edit window for a node is not defined,
|
|
6
|
+
it is still possible to display its internal read-only state.
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
import pprint
|
|
10
|
+
|
|
11
|
+
from qtpy import QtWidgets
|
|
12
|
+
|
|
13
|
+
from cutcutcodec.gui.edit_node_state.base import EditBase
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class ViewNodeState(EditBase):
|
|
17
|
+
"""If you can't change the node's properties, you can still display them."""
|
|
18
|
+
|
|
19
|
+
def __init__(self, parent, node_name):
|
|
20
|
+
super().__init__(parent, node_name)
|
|
21
|
+
|
|
22
|
+
grid_layout = QtWidgets.QGridLayout()
|
|
23
|
+
state = self.state # avoid to many func call
|
|
24
|
+
for i, key in enumerate(sorted(self.state)):
|
|
25
|
+
grid_layout.addWidget(QtWidgets.QLabel(f"{key}:", self), i, 0)
|
|
26
|
+
grid_layout.addWidget(QtWidgets.QLabel(pprint.pformat(state[key]), self), i, 1)
|
|
27
|
+
self.setLayout(grid_layout)
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
|
|
3
|
+
"""Accesses and displays the source code documentation for a node."""
|
|
4
|
+
|
|
5
|
+
import inspect
|
|
6
|
+
import logging
|
|
7
|
+
|
|
8
|
+
from pdoc.html_helpers import to_html
|
|
9
|
+
from qtpy import QtGui, QtWidgets
|
|
10
|
+
|
|
11
|
+
from cutcutcodec.gui.edit_node_state.base import EditBase
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class Documentation(EditBase):
|
|
15
|
+
"""Display the node documentation."""
|
|
16
|
+
|
|
17
|
+
def __init__(self, parent, node_name):
|
|
18
|
+
super().__init__(parent, node_name)
|
|
19
|
+
|
|
20
|
+
layout = QtWidgets.QVBoxLayout()
|
|
21
|
+
self.init_documentation(layout)
|
|
22
|
+
self.setLayout(layout)
|
|
23
|
+
|
|
24
|
+
def init_documentation(self, layout):
|
|
25
|
+
"""Extract the documentation and formats it for display."""
|
|
26
|
+
font = QtGui.QFont("", -1)
|
|
27
|
+
font.setFixedPitch(True)
|
|
28
|
+
if not QtGui.QFontInfo(font).fixedPitch():
|
|
29
|
+
logging.warning("no fixed pitch font found")
|
|
30
|
+
|
|
31
|
+
main_doc = inspect.getdoc(self.get_class().__init__)
|
|
32
|
+
main_doc = to_html(main_doc, latex_math=True)
|
|
33
|
+
label_main = QtWidgets.QLabel(main_doc)
|
|
34
|
+
label_main.setWordWrap(True)
|
|
35
|
+
label_main.setFont(font)
|
|
36
|
+
layout.addWidget(label_main)
|
|
37
|
+
|
|
38
|
+
separador = QtWidgets.QFrame()
|
|
39
|
+
separador.setFrameShape(QtWidgets.QFrame.Shape.HLine)
|
|
40
|
+
layout.addWidget(separador)
|
|
41
|
+
|
|
42
|
+
ex_doc = inspect.getdoc(self.get_class())
|
|
43
|
+
ex_doc = to_html(ex_doc, latex_math=True)
|
|
44
|
+
label_ex = QtWidgets.QLabel(ex_doc)
|
|
45
|
+
label_ex.setWordWrap(True)
|
|
46
|
+
label_ex.setFont(font)
|
|
47
|
+
layout.addWidget(label_ex)
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
|
|
3
|
+
"""Properties that are common to all nodes."""
|
|
4
|
+
|
|
5
|
+
from qtpy import QtWidgets
|
|
6
|
+
|
|
7
|
+
from cutcutcodec.core.classes.container import ContainerInput, ContainerOutput
|
|
8
|
+
from cutcutcodec.core.classes.filter import Filter
|
|
9
|
+
from cutcutcodec.gui.edit_node_state.base import EditBase
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class General(EditBase):
|
|
13
|
+
"""Display the node documentation."""
|
|
14
|
+
|
|
15
|
+
def __init__(self, parent, node_name):
|
|
16
|
+
super().__init__(parent, node_name)
|
|
17
|
+
|
|
18
|
+
grid_layout = QtWidgets.QGridLayout()
|
|
19
|
+
ref_span = self.init_type(grid_layout)
|
|
20
|
+
ref_span = self.init_ancestors(grid_layout, ref_span)
|
|
21
|
+
self.init_streams(grid_layout, ref_span)
|
|
22
|
+
self.setLayout(grid_layout)
|
|
23
|
+
|
|
24
|
+
def init_streams(self, grid_layout, ref_span=0):
|
|
25
|
+
"""Give some informations about streams."""
|
|
26
|
+
in_streams = sorted(
|
|
27
|
+
self.app.graph.in_edges(self.node_name, data=False, keys=True),
|
|
28
|
+
key=lambda src_dst_key: int(src_dst_key[2].split("->")[1])
|
|
29
|
+
)
|
|
30
|
+
out_streams = sorted(
|
|
31
|
+
self.app.graph.out_edges(self.node_name, data=False, keys=True),
|
|
32
|
+
key=lambda src_dst_key: int(src_dst_key[2].split("->")[0])
|
|
33
|
+
)
|
|
34
|
+
for streams, label in zip((in_streams, out_streams), ("Incoming", "Output")):
|
|
35
|
+
if streams:
|
|
36
|
+
grid_layout.addWidget(QtWidgets.QLabel(f"{label} Streams:"), ref_span, 0)
|
|
37
|
+
for i, (src, dst, key) in enumerate(streams):
|
|
38
|
+
key = key.split('->')
|
|
39
|
+
grid_layout.addWidget(
|
|
40
|
+
QtWidgets.QLabel(
|
|
41
|
+
f"{src} (stream {key[0]}) -> {dst} (stream {key[1]})"
|
|
42
|
+
),
|
|
43
|
+
ref_span+i,
|
|
44
|
+
1,
|
|
45
|
+
)
|
|
46
|
+
ref_span += len(in_streams)
|
|
47
|
+
return ref_span
|
|
48
|
+
|
|
49
|
+
def init_ancestors(self, grid_layout, ref_span=0):
|
|
50
|
+
"""Return the inheritance of classes from the main type."""
|
|
51
|
+
ancestors = " <-- ".join(c.__name__ for c in self.get_class().__mro__[-2::-1])
|
|
52
|
+
grid_layout.addWidget(QtWidgets.QLabel("Ancestors:"), ref_span, 0)
|
|
53
|
+
grid_layout.addWidget(QtWidgets.QLabel(ancestors), ref_span, 1)
|
|
54
|
+
ref_span += 1
|
|
55
|
+
return ref_span
|
|
56
|
+
|
|
57
|
+
def init_type(self, grid_layout, ref_span=0):
|
|
58
|
+
"""Return the generique type of node."""
|
|
59
|
+
if issubclass(self.get_class(), ContainerInput):
|
|
60
|
+
grid_layout.addWidget(QtWidgets.QLabel("Type:"), ref_span, 0)
|
|
61
|
+
grid_layout.addWidget(QtWidgets.QLabel("Input"), ref_span, 1)
|
|
62
|
+
ref_span += 1
|
|
63
|
+
elif issubclass(self.get_class(), ContainerOutput):
|
|
64
|
+
grid_layout.addWidget(QtWidgets.QLabel("Type:"), ref_span, 0)
|
|
65
|
+
grid_layout.addWidget(QtWidgets.QLabel("Output"), ref_span, 1)
|
|
66
|
+
ref_span += 1
|
|
67
|
+
elif issubclass(self.get_class(), Filter):
|
|
68
|
+
grid_layout.addWidget(QtWidgets.QLabel("Type:"), ref_span, 0)
|
|
69
|
+
grid_layout.addWidget(QtWidgets.QLabel("Filter"), ref_span, 1)
|
|
70
|
+
ref_span += 1
|
|
71
|
+
return ref_span
|