-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
176 changed files
with
15,733 additions
and
532 deletions.
There are no files selected for viewing
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
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
Binary file not shown.
Binary file not shown.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Minimal makefile for Sphinx documentation | ||
# | ||
|
||
# You can set these variables from the command line, and also | ||
# from the environment for the first two. | ||
SPHINXOPTS ?= | ||
SPHINXBUILD ?= sphinx-build | ||
SOURCEDIR = source | ||
BUILDDIR = build | ||
|
||
# Put it first so that "make" without argument is like "make help". | ||
help: | ||
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) | ||
|
||
.PHONY: help Makefile | ||
|
||
# Catch-all target: route all unknown targets to Sphinx using the new | ||
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). | ||
%: Makefile | ||
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
[[source]] | ||
url = "https://pypi.org/simple" | ||
verify_ssl = true | ||
name = "pypi" | ||
|
||
[packages] | ||
sphinx = "*" | ||
sphinx-rtd-theme = "*" | ||
click = "*" | ||
sphinx-autoapi = "*" | ||
|
||
[dev-packages] | ||
|
||
[requires] | ||
python_version = "3.11" |
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+32 KB
src/assets/docs/build/doctrees/autoapi/scriptor/csvwriter/index.doctree
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+25.3 KB
src/assets/docs/build/doctrees/autoapi/scriptor/network/index.doctree
Binary file not shown.
Binary file added
BIN
+13.9 KB
src/assets/docs/build/doctrees/autoapi/scriptor/progressbar/index.doctree
Binary file not shown.
Binary file added
BIN
+15.6 KB
src/assets/docs/build/doctrees/autoapi/scriptor/readers/index.doctree
Binary file not shown.
Binary file added
BIN
+14.2 KB
src/assets/docs/build/doctrees/autoapi/scriptor/renderer/index.doctree
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Sphinx build info version 1 | ||
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. | ||
config: 6dc8ffbf031e31788a4ad1a06a089d63 | ||
tags: 645f666f9bcd5a90fca523b33c5a78b7 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
Async and await | ||
==================================== | ||
The Scriptor utilizes the built-in functionality of asynchronous (async) functions in Python. Async functions in Python are similar to conventional functions, with the difference that they return a coroutine or, in technical terms, a Promise instead of a value. | ||
|
||
Understanding Asynchrony | ||
----------------- | ||
|
||
To understand the concept of asynchrony, let's consider three individuals: Tom, Pascal, and Felix. Tom wants to order a drink for each of his friends. In a synchronous workflow, Tom would run to Pascal and ask him what he would like, then place the order for him. Only after Pascal receives his drink would Tom move on to Felix, take his order, and give him his drink. The process of getting a drink follows the sequence of approaching each person, going to the bartender, placing an order, and then receiving the drink. This is a synchronous workflow because Tom can only hold one drink at a time, as he also needs to hold his own drink. | ||
|
||
Now, let's consider an asynchronous workflow: Tom still wants to order drinks for Pascal and Felix. Instead of running to each friend in sequence, Tom goes directly to the bartender and places orders for all the drinks at once. While the bartender prepares the drinks, Tom can continue with his own activities instead of waiting for each individual drink to be ready. Once the drinks are prepared, Pascal and Felix can pick up their respective drinks. In this case, Tom can place the orders and then proceed with other tasks while the drinks are being prepared in the background. This asynchronous workflow allows Tom to proceed with other tasks concurrently, without being blocked, while the drinks are being prepared. | ||
|
||
This example highlights the difference between synchronous and asynchronous workflows and demonstrates how asynchrony enables parallel execution of tasks, thereby enhancing efficiency. | ||
|
||
Coding sample | ||
~~~~~~~~~~~~~ | ||
.. code-block:: python | ||
import asyncio, time | ||
async def main(): | ||
async def say_hello(x): | ||
await asyncio.sleep(x) | ||
#print("Hallo Welt!", x) | ||
# sequenziell (nacheinander) | ||
start = time.time() | ||
for i in (1, 2, 3): | ||
await say_hello(i) | ||
print("SEQUENZ ENDE", time.time() - start) | ||
# parallel | ||
start = time.time() | ||
list = (asyncio.create_task(say_hello(i)) for i in (1, 2, 3)) | ||
await asyncio.gather(*list) | ||
print("PARALLEL ENDE", time.time() - start) | ||
Use of Asynchronous Functions in the Scriptor | ||
----------------- | ||
The Scriptor makes use of asynchronous (async) functions in various cases to enable networking and handle requests, including 'fetch' operations, by leveraging Pyodide and the JavaScript 'fetch' function. Additionally, it employs the 'Google Chrome' Filesystem API, which is built on asynchronous functions. However, please note that not all modules of the Scriptor can be used in every browser. For example, the FilePicker API of the Scriptor cannot be utilized in Firefox as there is no interface available to directly interact with the operating system's file system through the browser. | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
API Reference | ||
============= | ||
|
||
This page contains auto-generated API reference documentation [#f1]_. | ||
|
||
.. toctree:: | ||
:titlesonly: | ||
|
||
/autoapi/scriptor/index | ||
|
||
.. [#f1] Created with `sphinx-autoapi <https://github.com/readthedocs/sphinx-autoapi>`_ |
86 changes: 86 additions & 0 deletions
86
src/assets/docs/build/html/_sources/autoapi/scriptor/csvwriter/index.rst.txt
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
:py:mod:`scriptor.csvwriter` | ||
============================ | ||
|
||
.. py:module:: scriptor.csvwriter | ||
Module Contents | ||
--------------- | ||
|
||
Classes | ||
~~~~~~~ | ||
|
||
.. autoapisummary:: | ||
|
||
scriptor.csvwriter.MemoryCsvWriter | ||
scriptor.csvwriter.FileSystemCsvWriter | ||
|
||
|
||
|
||
|
||
.. py:class:: MemoryCsvWriter(*args, delimiter=';', formatter: callable = None) | ||
Bases: :py:obj:`scriptor.writer.MemoryWriter` | ||
|
||
Writer for CSV exports | ||
|
||
.. py:property:: writer | ||
.. py:attribute:: DEFAULT_FILE_NAME | ||
:value: 'export.csv' | ||
|
||
|
||
|
||
.. py:method:: fmt(value) | ||
.. py:method:: write(values: object) | ||
:async: | ||
|
||
|
||
.. py:method:: __str__() | ||
Return str(self). | ||
|
||
|
||
|
||
.. py:class:: FileSystemCsvWriter(*args, **kwargs) | ||
Bases: :py:obj:`scriptor.writer.FilePickerWriter` | ||
|
||
Writer for CSV exports | ||
|
||
.. py:attribute:: DEFAULT_FILE_NAME | ||
:value: 'export.csv' | ||
|
||
|
||
|
||
.. py:method:: set_formatter(formatter: callable) | ||
.. py:method:: set_columns(columns: list[str]) | ||
.. py:method:: set_delimiter(delimiter: str) | ||
.. py:method:: flush() | ||
:async: | ||
|
||
|
||
.. py:method:: __aenter__() | ||
:async: | ||
|
||
|
||
.. py:method:: __aexit__(*args) | ||
:async: | ||
|
||
|
||
.. py:method:: write(values: object, should_flush: bool = False) | ||
:async: | ||
|
||
|
||
|
93 changes: 93 additions & 0 deletions
93
src/assets/docs/build/html/_sources/autoapi/scriptor/dialog/index.rst.txt
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
:py:mod:`scriptor.dialog` | ||
========================= | ||
|
||
.. py:module:: scriptor.dialog | ||
.. autoapi-nested-parse:: | ||
|
||
Dialogs API. | ||
|
||
This module provides several dialogs to be used for several user-interactions. | ||
|
||
- alert: Show a modal message to be confirmed | ||
- confirm: Show a Yes-No or Yes-No-Cancel dialog | ||
- input: Input dialog with various types | ||
- select: Select choice of several options, with multi-selection option. | ||
|
||
|
||
|
||
Module Contents | ||
--------------- | ||
|
||
|
||
Functions | ||
~~~~~~~~~ | ||
|
||
.. autoapisummary:: | ||
|
||
scriptor.dialog.wait | ||
scriptor.dialog.alert | ||
scriptor.dialog.confirm | ||
scriptor.dialog.input | ||
scriptor.dialog.input_date | ||
scriptor.dialog.input_number | ||
scriptor.dialog.input_string | ||
scriptor.dialog.input_text | ||
scriptor.dialog.select | ||
scriptor.dialog.diffcmp | ||
scriptor.dialog.table | ||
|
||
|
||
|
||
.. py:function:: wait() | ||
:async: | ||
|
||
|
||
.. py:function:: alert(text: str, image: str = '') -> None | ||
:async: | ||
|
||
Provide a message and stop program execution until accepted. | ||
|
||
|
||
.. py:function:: confirm(text: str, *, title: str = 'Confirm', allow_cancel: bool = False, image: str = '') -> bool | None | ||
:async: | ||
|
||
Provide a Yes-No or Yes-No-Cancel-dialog. | ||
|
||
|
||
.. py:function:: input(text: str, *, title: str = 'Input', type: str = 'input', use_time: bool = False, empty: bool = False, image: str = '') -> datetime.datetime | str | float | int | ||
:async: | ||
|
||
Provide a dialog asking for some value. | ||
|
||
|
||
.. py:function:: input_date(*args, **kwargs) -> datetime.datetime | ||
:async: | ||
|
||
Provide a input asking for datetime value. | ||
|
||
|
||
.. py:function:: input_number(*args, **kwargs) -> int | float | ||
:async: | ||
|
||
|
||
.. py:function:: input_string(*args, **kwargs) -> str | ||
:async: | ||
|
||
|
||
.. py:function:: input_text(*args, **kwargs) -> str | ||
:async: | ||
|
||
|
||
.. py:function:: select(text: str, choices: tuple[str] | list[str] | dict[str, str], *, title: str = 'Select', multiple: bool = False, image: str = '') -> str | list[str] | ||
:async: | ||
|
||
|
||
.. py:function:: diffcmp(title: str, changes: list[list[str]], image: str = '') -> None | ||
:async: | ||
|
||
|
||
.. py:function:: table(header: list[str], rows: list[list[str]], *, select=False, multiple=False, image: str = '') -> str | list[str] | None | ||
:async: | ||
|
||
|
Oops, something went wrong.