Skip to content

Commit

Permalink
updated merge file
Browse files Browse the repository at this point in the history
  • Loading branch information
cian authored and cian committed Aug 17, 2023
2 parents fc4cd47 + 980a102 commit 5cf32f9
Show file tree
Hide file tree
Showing 176 changed files with 15,733 additions and 532 deletions.
3 changes: 1 addition & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@
<meta charset="utf-8">
<meta name="robots" content="noindex,nofollow">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link rel="icon" href="/icon-scriptor.ico" />
<link rel="icon" href="/favicon.ico" />

<meta name="viewport" content="width=device-width,initial-scale=1.0">
<title>Scriptor v1.0</title>
</head>
<body>
<noscript>
Expand Down
27 changes: 14 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
{
"name": "stand-alone-scriptor",
"version": "0.1.0",
"version": "v2.0.1-rc1",
"private": true,
"scripts": {
"preinstall": "npm install ./src/usepython",
"serve": "vue-cli-service serve",
"lint": "vue-cli-service lint",
"dev": "vite",
"build": "vite build"
"build": "npm install --prefix ./src/usepython && npm run build --prefix ./src/usepython && cd ./src/assets/ && python3 make.py && cd ../.. && npm install && vite build",
"pylib": "cd ./src/assets/ && python3 make.py"
},
"dependencies": {
"@codemirror/commands": "^6.1.0",
Expand All @@ -17,40 +18,40 @@
"@codemirror/next": "^0.16.0",
"@codemirror/theme-one-dark": "^6.1.0",
"@codemirror/view": "^6.2.3",
"@viur/viur-shoelace": "^2.0.0-beta.83-viur-14",
"@viur/viur-vue-utils": "^0.5.9",
"@vueuse/components": "^9.10.0",
"@vueuse/core": "^9.10.0",
"@viur/viur-shoelace": "^2.4.0-viur-0.5.12",
"@viur/vue-utils": "^1.0.1",
"babel-eslint": "^10.1.0",
"codemirror": "^6.0.1",
"core-js": "^3.8.3",
"highlight.js": "^11.8.0",
"pinia": "^2.0.23",
"pyodide": "^0.21.2",
"rollup-plugin-copy": "^3.4.0",
"rollup-plugin-delete": "^2.0.0",
"rollup-plugin-visualizer": "^5.8.3",
"typedoc": "^0.24.6",
"typescript-eslint": "^0.0.1-alpha.0",
"usepython": "file:src/usepython",
"vue": "^3.2.13",
"vue-i18n": "^9.3.0-beta.16",
"vue": "^3.3.2",
"vue-i18n": "^9.2.2",
"vue-json-pretty": "^2.2.3",
"vue-router": "^4.1.6",
"vue-virtual-scroll-list": "^2.3.4",
"vue3-easy-data-table": "^1.5.24",
"vue3-highlightjs": "^1.0.5"
},
"devDependencies": {
"@babel/core": "^7.12.16",
"@babel/eslint-parser": "^7.12.16",
"@vitejs/plugin-vue": "^3.1.0",
"@vue/cli-plugin-babel": "~5.0.0",
"@vue/cli-service": "~5.0.0",
"@vitejs/plugin-vue": "^4.2.3",
"eslint": "^7.32.0",
"eslint-plugin-vue": "^8.7.1",
"less": "^4.1.3",
"raw-loader": "^4.0.2",
"rollup-plugin-mv": "^0.0.2",
"vite": "^3.1.4"
"vite": "^4.4.7"
},
"overrides": {
"semver": "^7.5.2"
},
"eslintConfig": {
"root": true,
Expand Down
Binary file added public/favicon.ico
Binary file not shown.
Binary file removed public/icon-scriptor.ico
Binary file not shown.
9 changes: 6 additions & 3 deletions src/App.vue
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
<template>
<Teleport to="head">
<title> {{ 'Scriptor v' + version }}</title>
</Teleport>

<template v-if="isLoggedIn && !isLoading">
<DialogDrawer></DialogDrawer>
Expand All @@ -20,7 +23,7 @@

<script lang="ts">
import Home from './components/Home.vue'
import {Request} from "@viur/viur-vue-utils";
import {Request} from "@viur/vue-utils";
import {ref, onBeforeMount, inject} from 'vue';
import {usePythonStore} from "./stores/PythonStore";
import {useMessageStore} from "./stores/message";
Expand All @@ -42,7 +45,7 @@ export default {
setup(){
const checkLoginInterval = ref();
const version = __APP_VERSION__;
const globalStore = useGlobalStore();
let isLoggedIn = ref<boolean>(false);
let isLoading = ref<boolean>(true);
Expand Down Expand Up @@ -89,7 +92,7 @@ export default {
}, 1000 * 60 * 5)
});
return {isLoggedIn, isLoading, globalStore}
return {isLoggedIn, isLoading, globalStore, version}
}
}
</script>
Expand Down
20 changes: 20 additions & 0 deletions src/assets/docs/Makefile
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)
15 changes: 15 additions & 0 deletions src/assets/docs/Pipfile
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"
526 changes: 526 additions & 0 deletions src/assets/docs/Pipfile.lock

Large diffs are not rendered by default.

Binary file added src/assets/docs/build/doctrees/Dialogues.doctree
Binary file not shown.
Binary file not shown.
Binary file added src/assets/docs/build/doctrees/async.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.
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 added src/assets/docs/build/doctrees/dialog.doctree
Binary file not shown.
Binary file added src/assets/docs/build/doctrees/environment.pickle
Binary file not shown.
Binary file not shown.
Binary file added src/assets/docs/build/doctrees/index.doctree
Binary file not shown.
4 changes: 4 additions & 0 deletions src/assets/docs/build/html/.buildinfo
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.
41 changes: 41 additions & 0 deletions src/assets/docs/build/html/_sources/async.rst.txt
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.

11 changes: 11 additions & 0 deletions src/assets/docs/build/html/_sources/autoapi/index.rst.txt
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>`_
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:



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:


Loading

0 comments on commit 5cf32f9

Please sign in to comment.