Skip to content
Snippets Groups Projects
Commit faff0011 authored by Jakob Fritz's avatar Jakob Fritz
Browse files

Tried to get automatic check to work

But did not succeed. Checking itself somewhat works
(only for github and gitlab.com; this has to be extended)
But passing back the variables does not work at the moment.
parent 3cf91878
No related branches found
No related tags found
No related merge requests found
Pipeline #167338 failed
......@@ -25,6 +25,7 @@ SPDX-License-Identifier: MIT
type="module"
src="https://pyscript.net/releases/2023.11.1/core.js"
></script>
<script src="https://cdn.jsdelivr.net/pyodide/v0.24.1/full/pyodide.js"></script>
</head>
<body>
......
{
"packages": ["arrr"]
"packages": ["pyodide_http", "http://localhost:8080/howfairis-0.14.2-py3-none-any.whl", "http://localhost:8080/ratelimit-2.2.1-py3-none-any.whl", "voluptuous"]
}
from pyscript import when, document
from pyscript import when, document, window
import pyodide_http
import sys
import voluptuous
from howfairis import Repo, Checker
from js import console
pyodide_http.patch_all()
@when("submit", "#categoryForm")
def trigger_check(data):
# gitURL = data.repoURL
console.log("trigger_check was called")
console.log(data)
applicationClass = int(document.getElementById("applicationClassSlider").value)
console.log(applicationClass)
gitURL = document.getElementById("repoURL").value
console.log(gitURL)
console.log(document)
console.log(f"Python version: {sys.version_info}")
console.log(f"Volutptuous version: {voluptuous.__version__}")
console.log(f"Pyodide_http version: {pyodide_http.__version__}")
# url = "https://github.com/fair-software/howfairis"
# repo = Repo(url)
# checker = Checker(repo, is_quiet=False)
# repo_valid = checker.check_repository()
# console.log(f"Repo is checked and valid: {repo_valid}")
existing_git(gitURL)
# Cannot access the JS-variable "allStandards"
# and therefore not report back the results of the tests
# allStd = document.getElementsByName("allStandards")
# console.log(allStd)
# allStandards.value.versionControl.fulfilled = True
# allStandards.value.versionControl.automaticallyChecked = True
# if data.applicationClass >= 1:
# existing_git(gitURL=gitURL)
# @when("triggerExistingGit", "#checkRequirements")
# @when("triggerExistingGit", "#categoryForm")
def existing_git(gitURL):
console.log("existing_git was called")
console.log(gitURL)
document.allStandards.value.versionControl.fulfilled = True
document.allStandards.value.versionControl.automaticallyChecked = True
window.document.allStandards.value.versionControl.fulfilled = True
window.document.allStandards.value.versionControl.automaticallyChecked = True
......@@ -13,19 +13,18 @@ SPDX-License-Identifier: MIT
v-model="category"
type="form"
:actions="true"
@submit="triggerCheck"
submit-label='Check'
submit-label="Automatically check some requirements"
:submit-attr="{
help: 'Automatically check some requirements',
'py-click': 'trigger_check'
}"
@submit="triggerCheck"
>
<FormKit
id="applicationClassSlider"
type="range"
label="Application class of the software"
help="If you don't know the application class, see the links above to determine it (by table or by decision tree)"
name="applicationClass"
id="applicationClassSlider"
number="integer"
validation="required"
min="0"
......@@ -40,7 +39,7 @@ SPDX-License-Identifier: MIT
Your chosen application class is {{ category.applicationClass }}
</p>
<FormKit
v-if="category.applicationClass>0"
id="repoURL"
type="text"
label="URL of the git-repository"
name="repoURL"
......@@ -49,21 +48,7 @@ SPDX-License-Identifier: MIT
required: 'URL is required if automatic check shall be used.',
url: 'A valid URL is required for automatic check to work.'
}"
/>
<!-- <FormKit
v-if="category.applicationClass>0"
class="formkit-input"
type="submit"
name="check_category"
id=""
:disabled="disabled"
help="Automatically check some requirements"
label="Check python"
py-click="trigger_check"
@click="unused"
/> -->
</FormKit>
<FormKit
......@@ -147,8 +132,6 @@ import CreateBadge from '@/components/createBadge.vue'
import { FormKit } from '@formkit/vue'
import { ref } from 'vue'
import printJS from 'print-js'
// import * as allStandards from '@/components/standards.json'
// const triggerExistingGit = (allStandards, gitURL) => emit('existingGit', allStandards, gitURL);
</script>
<script>
......@@ -160,18 +143,6 @@ const getStandards = () => {
}
return standards
}
// const triggerCheck = (data) => {
// const gitURL = data.repoURL
// if (data.applicationClass >= 1) {
// console.log(gitURL);
// // check versionControl
// emit('existingGit', {allStandards, gitURL});
// console.log("Triggered python");
// // allStandards.value.versionControl.fulfilled = validGit(gitURL);
// // allStandards.value.versionControl.automaticallyChecked = true;
// console.log(allStandards.value.versionControl.automaticallyChecked)
// }
// }
var allStandards = ref(getStandards())
const category = ref({})
var requiredStandards = ref({})
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment