setta 0.0.1__py3-none-any.whl → 0.0.2__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- setta/__init__.py +1 -1
- setta/cli/__init__.py +1 -0
- setta/cli/connect.py +43 -0
- setta/cli/logger.py +225 -0
- setta/code_gen/__init__.py +0 -0
- setta/code_gen/create_runnable_scripts.py +466 -0
- setta/code_gen/export_selected.py +776 -0
- setta/code_gen/find_placeholders.py +13 -0
- setta/code_gen/python/__init__.py +0 -0
- setta/code_gen/python/ast_utils.py +183 -0
- setta/code_gen/python/check_scope.py +187 -0
- setta/code_gen/python/generate_code.py +280 -0
- setta/code_gen/python/make_parseable.py +97 -0
- setta/code_gen/python/position_line_col.py +33 -0
- setta/code_gen/python/validate_imports.py +87 -0
- setta/code_gen/utils.py +120 -0
- setta/code_gen/yaml/__init__.py +0 -0
- setta/code_gen/yaml/generate_yaml.py +23 -0
- setta/code_gen/yaml/section_dict.py +93 -0
- setta/database/__init__.py +0 -0
- setta/database/backup.py +80 -0
- setta/database/db/__init__.py +0 -0
- setta/database/db/artifacts/__init__.py +0 -0
- setta/database/db/artifacts/load.py +93 -0
- setta/database/db/artifacts/save.py +85 -0
- setta/database/db/artifacts/save_or_create.py +68 -0
- setta/database/db/artifacts/utils.py +13 -0
- setta/database/db/codeInfo/__init__.py +0 -0
- setta/database/db/codeInfo/copy.py +26 -0
- setta/database/db/codeInfo/load.py +65 -0
- setta/database/db/codeInfo/save.py +75 -0
- setta/database/db/codeInfo/utils.py +33 -0
- setta/database/db/evRefs/__init__.py +0 -0
- setta/database/db/evRefs/load.py +45 -0
- setta/database/db/evRefs/save.py +95 -0
- setta/database/db/projects/__init__.py +0 -0
- setta/database/db/projects/copy.py +36 -0
- setta/database/db/projects/delete.py +7 -0
- setta/database/db/projects/load.py +184 -0
- setta/database/db/projects/save.py +267 -0
- setta/database/db/projects/saveAs.py +40 -0
- setta/database/db/projects/utils.py +135 -0
- setta/database/db/sectionVariants/__init__.py +0 -0
- setta/database/db/sectionVariants/copy.py +28 -0
- setta/database/db/sectionVariants/load.py +139 -0
- setta/database/db/sectionVariants/save.py +140 -0
- setta/database/db/sectionVariants/utils.py +44 -0
- setta/database/db/sections/__init__.py +0 -0
- setta/database/db/sections/copy.py +70 -0
- setta/database/db/sections/jsonSource.py +119 -0
- setta/database/db/sections/load.py +350 -0
- setta/database/db/sections/save.py +204 -0
- setta/database/db/sections/utils.py +13 -0
- setta/database/db/uiTypes/__init__.py +0 -0
- setta/database/db/uiTypes/copy.py +33 -0
- setta/database/db/uiTypes/load.py +51 -0
- setta/database/db/uiTypes/save.py +99 -0
- setta/database/db/uiTypes/utils.py +27 -0
- setta/database/db_init.py +36 -0
- setta/database/db_objs.py +102 -0
- setta/database/db_path.py +8 -0
- setta/database/export_db/__init__.py +0 -0
- setta/database/export_db/export_db.py +43 -0
- setta/database/export_db/export_raw.py +53 -0
- setta/database/export_db/export_readable.py +242 -0
- setta/database/export_db/utils.py +16 -0
- setta/database/import_db.py +28 -0
- setta/database/seed.py +41 -0
- setta/database/settings_file.py +118 -0
- setta/database/utils.py +32 -0
- setta/lsp/__init__.py +0 -0
- setta/lsp/file_watcher.py +113 -0
- setta/lsp/reader.py +184 -0
- setta/lsp/reader_fns/__init__.py +0 -0
- setta/lsp/reader_fns/completion.py +84 -0
- setta/lsp/reader_fns/definition.py +2 -0
- setta/lsp/reader_fns/diagnostics.py +99 -0
- setta/lsp/reader_fns/documentHighlight.py +25 -0
- setta/lsp/reader_fns/references.py +34 -0
- setta/lsp/reader_fns/signatureHelp.py +99 -0
- setta/lsp/server.py +150 -0
- setta/lsp/utils.py +60 -0
- setta/lsp/writer.py +306 -0
- setta/routers/__init__.py +11 -0
- setta/routers/artifact.py +105 -0
- setta/routers/code_info.py +32 -0
- setta/routers/dependencies.py +49 -0
- setta/routers/in_memory_fn_stdout_websocket.py +21 -0
- setta/routers/interactive.py +119 -0
- setta/routers/lsp.py +14 -0
- setta/routers/projects.py +188 -0
- setta/routers/reference_renaming.py +111 -0
- setta/routers/sections.py +174 -0
- setta/routers/settings.py +40 -0
- setta/routers/terminals.py +83 -0
- setta/routers/websocket.py +36 -0
- setta/server.py +141 -0
- setta/start.py +112 -0
- setta/static/constants/BaseUITypes.json +153 -0
- setta/static/constants/Settings.json +113 -0
- setta/static/constants/constants.json +117 -0
- setta/static/constants/db_init.sql +249 -0
- setta/static/constants/defaultValues.json +125 -0
- setta/static/constants/settingsProject.json +276 -0
- setta/static/frontend/android-chrome-192x192.png +0 -0
- setta/static/frontend/android-chrome-512x512.png +0 -0
- setta/static/frontend/apple-touch-icon.png +0 -0
- setta/static/frontend/assets/KaTeX_AMS-Regular-0cdd387c.woff2 +0 -0
- setta/static/frontend/assets/KaTeX_AMS-Regular-30da91e8.woff +0 -0
- setta/static/frontend/assets/KaTeX_AMS-Regular-68534840.ttf +0 -0
- setta/static/frontend/assets/KaTeX_Caligraphic-Bold-07d8e303.ttf +0 -0
- setta/static/frontend/assets/KaTeX_Caligraphic-Bold-1ae6bd74.woff +0 -0
- setta/static/frontend/assets/KaTeX_Caligraphic-Bold-de7701e4.woff2 +0 -0
- setta/static/frontend/assets/KaTeX_Caligraphic-Regular-3398dd02.woff +0 -0
- setta/static/frontend/assets/KaTeX_Caligraphic-Regular-5d53e70a.woff2 +0 -0
- setta/static/frontend/assets/KaTeX_Caligraphic-Regular-ed0b7437.ttf +0 -0
- setta/static/frontend/assets/KaTeX_Fraktur-Bold-74444efd.woff2 +0 -0
- setta/static/frontend/assets/KaTeX_Fraktur-Bold-9163df9c.ttf +0 -0
- setta/static/frontend/assets/KaTeX_Fraktur-Bold-9be7ceb8.woff +0 -0
- setta/static/frontend/assets/KaTeX_Fraktur-Regular-1e6f9579.ttf +0 -0
- setta/static/frontend/assets/KaTeX_Fraktur-Regular-51814d27.woff2 +0 -0
- setta/static/frontend/assets/KaTeX_Fraktur-Regular-5e28753b.woff +0 -0
- setta/static/frontend/assets/KaTeX_Main-Bold-0f60d1b8.woff2 +0 -0
- setta/static/frontend/assets/KaTeX_Main-Bold-138ac28d.ttf +0 -0
- setta/static/frontend/assets/KaTeX_Main-Bold-c76c5d69.woff +0 -0
- setta/static/frontend/assets/KaTeX_Main-BoldItalic-70ee1f64.ttf +0 -0
- setta/static/frontend/assets/KaTeX_Main-BoldItalic-99cd42a3.woff2 +0 -0
- setta/static/frontend/assets/KaTeX_Main-BoldItalic-a6f7ec0d.woff +0 -0
- setta/static/frontend/assets/KaTeX_Main-Italic-0d85ae7c.ttf +0 -0
- setta/static/frontend/assets/KaTeX_Main-Italic-97479ca6.woff2 +0 -0
- setta/static/frontend/assets/KaTeX_Main-Italic-f1d6ef86.woff +0 -0
- setta/static/frontend/assets/KaTeX_Main-Regular-c2342cd8.woff2 +0 -0
- setta/static/frontend/assets/KaTeX_Main-Regular-c6368d87.woff +0 -0
- setta/static/frontend/assets/KaTeX_Main-Regular-d0332f52.ttf +0 -0
- setta/static/frontend/assets/KaTeX_Math-BoldItalic-850c0af5.woff +0 -0
- setta/static/frontend/assets/KaTeX_Math-BoldItalic-dc47344d.woff2 +0 -0
- setta/static/frontend/assets/KaTeX_Math-BoldItalic-f9377ab0.ttf +0 -0
- setta/static/frontend/assets/KaTeX_Math-Italic-08ce98e5.ttf +0 -0
- setta/static/frontend/assets/KaTeX_Math-Italic-7af58c5e.woff2 +0 -0
- setta/static/frontend/assets/KaTeX_Math-Italic-8a8d2445.woff +0 -0
- setta/static/frontend/assets/KaTeX_SansSerif-Bold-1ece03f7.ttf +0 -0
- setta/static/frontend/assets/KaTeX_SansSerif-Bold-e99ae511.woff2 +0 -0
- setta/static/frontend/assets/KaTeX_SansSerif-Bold-ece03cfd.woff +0 -0
- setta/static/frontend/assets/KaTeX_SansSerif-Italic-00b26ac8.woff2 +0 -0
- setta/static/frontend/assets/KaTeX_SansSerif-Italic-3931dd81.ttf +0 -0
- setta/static/frontend/assets/KaTeX_SansSerif-Italic-91ee6750.woff +0 -0
- setta/static/frontend/assets/KaTeX_SansSerif-Regular-11e4dc8a.woff +0 -0
- setta/static/frontend/assets/KaTeX_SansSerif-Regular-68e8c73e.woff2 +0 -0
- setta/static/frontend/assets/KaTeX_SansSerif-Regular-f36ea897.ttf +0 -0
- setta/static/frontend/assets/KaTeX_Script-Regular-036d4e95.woff2 +0 -0
- setta/static/frontend/assets/KaTeX_Script-Regular-1c67f068.ttf +0 -0
- setta/static/frontend/assets/KaTeX_Script-Regular-d96cdf2b.woff +0 -0
- setta/static/frontend/assets/KaTeX_Size1-Regular-6b47c401.woff2 +0 -0
- setta/static/frontend/assets/KaTeX_Size1-Regular-95b6d2f1.ttf +0 -0
- setta/static/frontend/assets/KaTeX_Size1-Regular-c943cc98.woff +0 -0
- setta/static/frontend/assets/KaTeX_Size2-Regular-2014c523.woff +0 -0
- setta/static/frontend/assets/KaTeX_Size2-Regular-a6b2099f.ttf +0 -0
- setta/static/frontend/assets/KaTeX_Size2-Regular-d04c5421.woff2 +0 -0
- setta/static/frontend/assets/KaTeX_Size3-Regular-500e04d5.ttf +0 -0
- setta/static/frontend/assets/KaTeX_Size3-Regular-6ab6b62e.woff +0 -0
- setta/static/frontend/assets/KaTeX_Size4-Regular-99f9c675.woff +0 -0
- setta/static/frontend/assets/KaTeX_Size4-Regular-a4af7d41.woff2 +0 -0
- setta/static/frontend/assets/KaTeX_Size4-Regular-c647367d.ttf +0 -0
- setta/static/frontend/assets/KaTeX_Typewriter-Regular-71d517d6.woff2 +0 -0
- setta/static/frontend/assets/KaTeX_Typewriter-Regular-e14fed02.woff +0 -0
- setta/static/frontend/assets/KaTeX_Typewriter-Regular-f01f3e87.ttf +0 -0
- setta/static/frontend/assets/cormorant-garamond-all-700-italic-c9b58582.woff +0 -0
- setta/static/frontend/assets/cormorant-garamond-cyrillic-700-italic-9101ad5f.woff2 +0 -0
- setta/static/frontend/assets/cormorant-garamond-cyrillic-ext-700-italic-950de0d6.woff2 +0 -0
- setta/static/frontend/assets/cormorant-garamond-latin-700-italic-0bc53e12.woff2 +0 -0
- setta/static/frontend/assets/cormorant-garamond-latin-ext-700-italic-525738e0.woff2 +0 -0
- setta/static/frontend/assets/cormorant-garamond-vietnamese-700-italic-99563037.woff2 +0 -0
- setta/static/frontend/assets/erase-5e0448ea.svg +15 -0
- setta/static/frontend/assets/index-1d4b4ecf.css +32 -0
- setta/static/frontend/assets/index-ee99dc72.js +678 -0
- setta/static/frontend/assets/inter-all-400-normal-054f12d0.woff +0 -0
- setta/static/frontend/assets/inter-all-600-normal-c03769e5.woff +0 -0
- setta/static/frontend/assets/inter-all-800-normal-15dc6e4b.woff +0 -0
- setta/static/frontend/assets/inter-cyrillic-400-normal-a4eee61a.woff2 +0 -0
- setta/static/frontend/assets/inter-cyrillic-600-normal-8b14f703.woff2 +0 -0
- setta/static/frontend/assets/inter-cyrillic-800-normal-e706eaaa.woff2 +0 -0
- setta/static/frontend/assets/inter-cyrillic-ext-400-normal-70047a3b.woff2 +0 -0
- setta/static/frontend/assets/inter-cyrillic-ext-600-normal-d4ab9bc4.woff2 +0 -0
- setta/static/frontend/assets/inter-cyrillic-ext-800-normal-eae7515a.woff2 +0 -0
- setta/static/frontend/assets/inter-greek-400-normal-381ea30d.woff2 +0 -0
- setta/static/frontend/assets/inter-greek-600-normal-601f93a2.woff2 +0 -0
- setta/static/frontend/assets/inter-greek-800-normal-7af4fb64.woff2 +0 -0
- setta/static/frontend/assets/inter-greek-ext-400-normal-27027b17.woff2 +0 -0
- setta/static/frontend/assets/inter-greek-ext-600-normal-f2ddf9de.woff2 +0 -0
- setta/static/frontend/assets/inter-greek-ext-800-normal-4cb6189e.woff2 +0 -0
- setta/static/frontend/assets/inter-latin-400-normal-d56fec21.woff2 +0 -0
- setta/static/frontend/assets/inter-latin-600-normal-ff769fa6.woff2 +0 -0
- setta/static/frontend/assets/inter-latin-800-normal-5eea1309.woff2 +0 -0
- setta/static/frontend/assets/inter-latin-ext-400-normal-bb698d85.woff2 +0 -0
- setta/static/frontend/assets/inter-latin-ext-600-normal-ca4808f9.woff2 +0 -0
- setta/static/frontend/assets/inter-latin-ext-800-normal-ebdacc0f.woff2 +0 -0
- setta/static/frontend/assets/logo/logo.svg +8 -0
- setta/static/frontend/assets/pen-455d7d8a.svg +19 -0
- setta/static/frontend/assets/source-code-pro-all-500-normal-6bdaa03b.woff +0 -0
- setta/static/frontend/assets/source-code-pro-cyrillic-500-normal-288a0d68.woff2 +0 -0
- setta/static/frontend/assets/source-code-pro-cyrillic-ext-500-normal-b110a13b.woff2 +0 -0
- setta/static/frontend/assets/source-code-pro-greek-500-normal-04328acb.woff2 +0 -0
- setta/static/frontend/assets/source-code-pro-latin-500-normal-06edef1e.woff2 +0 -0
- setta/static/frontend/assets/source-code-pro-latin-ext-500-normal-6dc60d5e.woff2 +0 -0
- setta/static/frontend/assets/web-vitals-44a8e082.js +1 -0
- setta/static/frontend/assets/work-sans-all-400-normal-38034a3c.woff +0 -0
- setta/static/frontend/assets/work-sans-all-500-normal-550d64e5.woff +0 -0
- setta/static/frontend/assets/work-sans-all-600-normal-ccf14060.woff +0 -0
- setta/static/frontend/assets/work-sans-all-700-normal-494c2971.woff +0 -0
- setta/static/frontend/assets/work-sans-latin-400-normal-36735bc1.woff2 +0 -0
- setta/static/frontend/assets/work-sans-latin-500-normal-3790bfda.woff2 +0 -0
- setta/static/frontend/assets/work-sans-latin-600-normal-5fba494e.woff2 +0 -0
- setta/static/frontend/assets/work-sans-latin-700-normal-a5033d0a.woff2 +0 -0
- setta/static/frontend/assets/work-sans-latin-ext-400-normal-c20f571a.woff2 +0 -0
- setta/static/frontend/assets/work-sans-latin-ext-500-normal-0f5ac96c.woff2 +0 -0
- setta/static/frontend/assets/work-sans-latin-ext-600-normal-97a237d1.woff2 +0 -0
- setta/static/frontend/assets/work-sans-latin-ext-700-normal-103e112c.woff2 +0 -0
- setta/static/frontend/browserconfig.xml +9 -0
- setta/static/frontend/favicon-16x16.png +0 -0
- setta/static/frontend/favicon-32x32.png +0 -0
- setta/static/frontend/favicon.ico +0 -0
- setta/static/frontend/index.html +30 -0
- setta/static/frontend/manifest.json +25 -0
- setta/static/frontend/mstile-144x144.png +0 -0
- setta/static/frontend/mstile-150x150.png +0 -0
- setta/static/frontend/mstile-310x150.png +0 -0
- setta/static/frontend/mstile-310x310.png +0 -0
- setta/static/frontend/mstile-70x70.png +0 -0
- setta/static/frontend/robots.txt +3 -0
- setta/static/frontend/safari-pinned-tab.svg +18 -0
- setta/static/frontend/site.webmanifest +19 -0
- setta/static/seed/.DS_Store +0 -0
- setta/static/seed/examples/.DS_Store +0 -0
- setta/tasks/__init__.py +0 -0
- setta/tasks/fns/__init__.py +9 -0
- setta/tasks/fns/codeAreaAutocomplete.py +209 -0
- setta/tasks/fns/codeAreaFindTemplateVars.py +128 -0
- setta/tasks/fns/codeAreaInitializeCode.py +98 -0
- setta/tasks/fns/findEVRefs.py +236 -0
- setta/tasks/fns/parametersRequest.py +71 -0
- setta/tasks/fns/textFieldAutocomplete.py +210 -0
- setta/tasks/fns/textFieldInitializeCode.py +99 -0
- setta/tasks/fns/typeCheck.py +40 -0
- setta/tasks/fns/utils.py +134 -0
- setta/tasks/task_runner.py +29 -0
- setta/tasks/tasks.py +152 -0
- setta/tasks/utils.py +178 -0
- setta/terminals/__init__.py +0 -0
- setta/terminals/terminals.py +242 -0
- setta/terminals/utils.py +37 -0
- setta/utils/__init__.py +0 -0
- setta/utils/constants.py +148 -0
- setta/utils/generate_memorable_string.py +431 -0
- setta/utils/generate_new_filename.py +80 -0
- setta/utils/section_contents.py +133 -0
- setta/utils/utils.py +271 -0
- setta/utils/websocket_manager.py +91 -0
- setta-0.0.2.dist-info/LICENSE +201 -0
- setta-0.0.2.dist-info/METADATA +24 -0
- setta-0.0.2.dist-info/RECORD +263 -0
- {setta-0.0.1.dist-info → setta-0.0.2.dist-info}/WHEEL +1 -1
- setta-0.0.2.dist-info/entry_points.txt +2 -0
- setta-0.0.1.dist-info/METADATA +0 -18
- setta-0.0.1.dist-info/RECORD +0 -5
- {setta-0.0.1.dist-info → setta-0.0.2.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,105 @@
|
|
1
|
+
import os
|
2
|
+
from typing import List
|
3
|
+
|
4
|
+
from fastapi import APIRouter, Depends
|
5
|
+
from pydantic import BaseModel
|
6
|
+
|
7
|
+
from setta.cli.logger import load_from_csv_base64
|
8
|
+
from setta.database.db.artifacts.load import (
|
9
|
+
load_artifact_from_disk,
|
10
|
+
load_artifact_metadata_and_maybe_value_from_disk,
|
11
|
+
load_available_artifacts,
|
12
|
+
)
|
13
|
+
from setta.database.db.artifacts.save_or_create import (
|
14
|
+
get_artifact_ids,
|
15
|
+
save_or_create_artifacts,
|
16
|
+
)
|
17
|
+
from setta.utils.constants import C
|
18
|
+
|
19
|
+
from .dependencies import get_dbq, get_websocket_manager
|
20
|
+
|
21
|
+
router = APIRouter()
|
22
|
+
|
23
|
+
|
24
|
+
class SendArtifactRequest(BaseModel):
|
25
|
+
data: List[dict]
|
26
|
+
saveTo: str
|
27
|
+
messageType: str
|
28
|
+
|
29
|
+
|
30
|
+
class LoadArtifactsRequest(BaseModel):
|
31
|
+
artifactIds: List[str]
|
32
|
+
|
33
|
+
|
34
|
+
class LoadAvailableArtifactsRequest(BaseModel):
|
35
|
+
sectionType: str
|
36
|
+
|
37
|
+
|
38
|
+
class CheckIfFileExistsRequests(BaseModel):
|
39
|
+
filepath: str
|
40
|
+
|
41
|
+
|
42
|
+
class LoadArtifactFromDiskRequest(BaseModel):
|
43
|
+
filepath: str
|
44
|
+
type: str
|
45
|
+
|
46
|
+
|
47
|
+
class ReadCSVBase64Request(BaseModel):
|
48
|
+
base64Str: str
|
49
|
+
|
50
|
+
|
51
|
+
class GetArtifactIdsFromNamePathType(BaseModel):
|
52
|
+
namesPathsTypes: list
|
53
|
+
|
54
|
+
|
55
|
+
@router.post(C.ROUTE_SEND_ARTIFACT)
|
56
|
+
async def route_send_artifact(
|
57
|
+
x: SendArtifactRequest,
|
58
|
+
dbq=Depends(get_dbq),
|
59
|
+
websocket_manager=Depends(get_websocket_manager),
|
60
|
+
):
|
61
|
+
with dbq as db:
|
62
|
+
artifact_ids = save_or_create_artifacts(db, x.data, x.saveTo)
|
63
|
+
|
64
|
+
for idx, d in enumerate(x.data):
|
65
|
+
d["id"] = artifact_ids[idx]
|
66
|
+
|
67
|
+
await websocket_manager.broadcast({"content": x.data, "messageType": x.messageType})
|
68
|
+
return artifact_ids
|
69
|
+
|
70
|
+
|
71
|
+
@router.post(C.ROUTE_LOAD_ARTIFACTS)
|
72
|
+
def route_load_artifacts(x: LoadArtifactsRequest, dbq=Depends(get_dbq)):
|
73
|
+
with dbq as db:
|
74
|
+
return load_artifact_metadata_and_maybe_value_from_disk(db, x.artifactIds)
|
75
|
+
|
76
|
+
|
77
|
+
@router.post(C.ROUTE_LOAD_AVAILABLE_ARTIFACTS)
|
78
|
+
def route_load_available_artifacts(
|
79
|
+
x: LoadAvailableArtifactsRequest, dbq=Depends(get_dbq)
|
80
|
+
):
|
81
|
+
with dbq as db:
|
82
|
+
return load_available_artifacts(db, x.sectionType)
|
83
|
+
|
84
|
+
|
85
|
+
@router.post(C.ROUTE_CHECK_IF_FILE_EXISTS)
|
86
|
+
def route_check_if_file_exists(x: CheckIfFileExistsRequests):
|
87
|
+
return os.path.exists(x.filepath)
|
88
|
+
|
89
|
+
|
90
|
+
@router.post(C.ROUTE_LOAD_ARTIFACT_FROM_DISK)
|
91
|
+
def route_load_artifact_from_disk(x: LoadArtifactFromDiskRequest):
|
92
|
+
return load_artifact_from_disk(x.filepath, x.type)
|
93
|
+
|
94
|
+
|
95
|
+
@router.post(C.ROUTE_READ_CSV_BASE64)
|
96
|
+
def route_read_csv_base64(x: ReadCSVBase64Request):
|
97
|
+
return load_from_csv_base64(x.base64Str)
|
98
|
+
|
99
|
+
|
100
|
+
@router.post(C.ROUTE_GET_ARTIFACT_IDS_FROM_NAME_PATH_TYPE)
|
101
|
+
def route_get_artifact_ids_from_name_path_type(
|
102
|
+
x: GetArtifactIdsFromNamePathType, dbq=Depends(get_dbq)
|
103
|
+
):
|
104
|
+
with dbq as db:
|
105
|
+
return get_artifact_ids(db, x.namesPathsTypes)
|
@@ -0,0 +1,32 @@
|
|
1
|
+
import docstring_to_markdown
|
2
|
+
from fastapi import APIRouter, Depends, HTTPException
|
3
|
+
from pydantic import BaseModel
|
4
|
+
|
5
|
+
from setta.database.db.codeInfo.save import save_code_info
|
6
|
+
from setta.utils.constants import C
|
7
|
+
|
8
|
+
from .dependencies import get_dbq
|
9
|
+
|
10
|
+
router = APIRouter()
|
11
|
+
|
12
|
+
|
13
|
+
class SaveCodeInfoRequest(BaseModel):
|
14
|
+
codeInfo: dict
|
15
|
+
|
16
|
+
|
17
|
+
class DocstringToMarkdownRequest(BaseModel):
|
18
|
+
docstring: str
|
19
|
+
|
20
|
+
|
21
|
+
@router.post(C.ROUTE_SAVE_CODE_INFO)
|
22
|
+
def route_save_code_info(x: SaveCodeInfoRequest, dbq=Depends(get_dbq)):
|
23
|
+
with dbq as db:
|
24
|
+
save_code_info(db, x.codeInfo)
|
25
|
+
|
26
|
+
|
27
|
+
@router.post(C.ROUTE_DOCSTRING_TO_MARKDOWN)
|
28
|
+
def route_docstring_to_markdown(x: DocstringToMarkdownRequest):
|
29
|
+
try:
|
30
|
+
return docstring_to_markdown.convert(x.docstring)
|
31
|
+
except docstring_to_markdown.UnknownFormatError as e:
|
32
|
+
raise HTTPException(status_code=400, detail=str(e))
|
@@ -0,0 +1,49 @@
|
|
1
|
+
from fastapi import Request, WebSocket
|
2
|
+
|
3
|
+
|
4
|
+
def get_dbq(request: Request):
|
5
|
+
return request.app.state.dbq
|
6
|
+
|
7
|
+
|
8
|
+
def get_tasks(request: Request):
|
9
|
+
return request.app.state.tasks
|
10
|
+
|
11
|
+
|
12
|
+
def get_tasks_from_websocket(websocket: WebSocket):
|
13
|
+
return websocket.app.state.tasks
|
14
|
+
|
15
|
+
|
16
|
+
def get_settings_file(request: Request):
|
17
|
+
return request.app.state.settings_file
|
18
|
+
|
19
|
+
|
20
|
+
def get_terminal_websockets(request: Request):
|
21
|
+
return request.app.state.terminal_websockets
|
22
|
+
|
23
|
+
|
24
|
+
def get_terminal_websockets_from_websocket(websocket: WebSocket):
|
25
|
+
return websocket.app.state.terminal_websockets
|
26
|
+
|
27
|
+
|
28
|
+
def get_websocket_manager(request: Request):
|
29
|
+
return request.app.state.websocket_manager
|
30
|
+
|
31
|
+
|
32
|
+
def get_websocket_manager_from_websocket(websocket: WebSocket):
|
33
|
+
return websocket.app.state.websocket_manager
|
34
|
+
|
35
|
+
|
36
|
+
def get_lsps(request: Request):
|
37
|
+
return [
|
38
|
+
request.app.state.lsps,
|
39
|
+
request.app.state.lsp_readers,
|
40
|
+
request.app.state.lsp_writers,
|
41
|
+
]
|
42
|
+
|
43
|
+
|
44
|
+
def get_lsp_writers(request: Request):
|
45
|
+
return request.app.state.lsp_writers
|
46
|
+
|
47
|
+
|
48
|
+
def get_lsp_writers_from_websocket(websocket: WebSocket):
|
49
|
+
return websocket.app.state.lsp_writers
|
@@ -0,0 +1,21 @@
|
|
1
|
+
from fastapi import APIRouter, Depends, WebSocket, WebSocketDisconnect
|
2
|
+
|
3
|
+
from setta.utils.constants import C
|
4
|
+
|
5
|
+
from .dependencies import get_tasks_from_websocket
|
6
|
+
|
7
|
+
router = APIRouter()
|
8
|
+
|
9
|
+
|
10
|
+
@router.websocket(C.ROUTE_IN_MEMORY_FN_STDOUT_WEBSOCKET)
|
11
|
+
async def in_memory_fn_stdout(
|
12
|
+
websocket: WebSocket,
|
13
|
+
tasks=Depends(get_tasks_from_websocket),
|
14
|
+
):
|
15
|
+
await tasks.connect(websocket)
|
16
|
+
try:
|
17
|
+
while True:
|
18
|
+
# Keep the connection alive by waiting for the client disconnect
|
19
|
+
await websocket.receive_text()
|
20
|
+
except WebSocketDisconnect:
|
21
|
+
await tasks.disconnect(websocket)
|
@@ -0,0 +1,119 @@
|
|
1
|
+
import black
|
2
|
+
from fastapi import APIRouter, Depends
|
3
|
+
from pydantic import BaseModel
|
4
|
+
|
5
|
+
from setta.code_gen.create_runnable_scripts import (
|
6
|
+
generate_final_code_for_sections,
|
7
|
+
prune_and_topological_sort,
|
8
|
+
sanitize_section_path_full_name,
|
9
|
+
)
|
10
|
+
from setta.code_gen.export_selected import (
|
11
|
+
export_for_in_memory_fn,
|
12
|
+
export_selected,
|
13
|
+
get_section_code,
|
14
|
+
get_section_type,
|
15
|
+
)
|
16
|
+
from setta.tasks.fns.utils import replace_template_vars_with_random_names
|
17
|
+
from setta.utils.constants import C
|
18
|
+
from setta.utils.utils import multireplace
|
19
|
+
|
20
|
+
from .dependencies import get_lsp_writers, get_tasks
|
21
|
+
|
22
|
+
router = APIRouter()
|
23
|
+
|
24
|
+
|
25
|
+
class UpdateInteractiveCodeRequest(BaseModel):
|
26
|
+
project: dict
|
27
|
+
|
28
|
+
|
29
|
+
class FormatCodeRequest(BaseModel):
|
30
|
+
project: dict
|
31
|
+
candidateTemplateVars: dict
|
32
|
+
|
33
|
+
|
34
|
+
@router.post(C.ROUTE_UPDATE_INTERACTIVE_CODE)
|
35
|
+
async def route_update_interactive_code(
|
36
|
+
x: UpdateInteractiveCodeRequest,
|
37
|
+
tasks=Depends(get_tasks),
|
38
|
+
lsp_writers=Depends(get_lsp_writers),
|
39
|
+
):
|
40
|
+
p = x.project
|
41
|
+
exporter_obj = export_selected(
|
42
|
+
p, always_export_args_objs=False, force_include_template_var=True
|
43
|
+
)
|
44
|
+
exporter_obj_in_memory = export_for_in_memory_fn(p)
|
45
|
+
|
46
|
+
template_var_replacement_values = {}
|
47
|
+
for variant in p["sectionVariants"].values():
|
48
|
+
for t in variant["templateVars"]:
|
49
|
+
if not t["sectionId"]:
|
50
|
+
continue
|
51
|
+
template_var_replacement_values[
|
52
|
+
t["keyword"]
|
53
|
+
] = create_in_memory_module_name(p, t["sectionId"])
|
54
|
+
|
55
|
+
code_dict = await generate_final_code_for_sections(
|
56
|
+
p,
|
57
|
+
exporter_obj,
|
58
|
+
lsp_writers=lsp_writers,
|
59
|
+
folder_path="",
|
60
|
+
do_prepend_with_setup_code=True,
|
61
|
+
do_convert_var_names_to_readable_form=True,
|
62
|
+
template_var_replacement_values=template_var_replacement_values,
|
63
|
+
)
|
64
|
+
|
65
|
+
to_import, _ = prune_and_topological_sort(code_dict, p["importCodeBlocks"])
|
66
|
+
to_import = to_import[::-1] # we want to import the dependencies first
|
67
|
+
code_list = []
|
68
|
+
for section_id in to_import:
|
69
|
+
v = code_dict[section_id]
|
70
|
+
task_name = create_in_memory_module_name(p, section_id)
|
71
|
+
code_list.append(
|
72
|
+
{
|
73
|
+
"code": v["code"],
|
74
|
+
"module_name": task_name,
|
75
|
+
}
|
76
|
+
)
|
77
|
+
|
78
|
+
metadata, error_msgs, content = await tasks.add_custom_fns(
|
79
|
+
code_list,
|
80
|
+
to_cache=exporter_obj_in_memory,
|
81
|
+
)
|
82
|
+
return {"metadata": metadata, "errorMsgs": error_msgs, "content": content}
|
83
|
+
|
84
|
+
|
85
|
+
@router.post(C.ROUTE_FORMAT_CODE)
|
86
|
+
async def route_format_code(x: FormatCodeRequest):
|
87
|
+
p = x.project
|
88
|
+
formattedCode = {}
|
89
|
+
for id, s in p["sections"].items():
|
90
|
+
if get_section_type(p, id) == C.CODE:
|
91
|
+
if s["codeLanguage"] == "python":
|
92
|
+
code = get_section_code(p, id)
|
93
|
+
(
|
94
|
+
code,
|
95
|
+
_,
|
96
|
+
reverse_var_name_mapping,
|
97
|
+
) = replace_template_vars_with_random_names(
|
98
|
+
x.candidateTemplateVars[id], code
|
99
|
+
)
|
100
|
+
formattedCode[id] = multireplace(
|
101
|
+
format_python_code(code), reverse_var_name_mapping
|
102
|
+
)
|
103
|
+
|
104
|
+
return formattedCode
|
105
|
+
|
106
|
+
|
107
|
+
def format_python_code(code: str) -> str:
|
108
|
+
try:
|
109
|
+
return black.format_str(code, mode=black.Mode())
|
110
|
+
except black.InvalidInput:
|
111
|
+
pass
|
112
|
+
|
113
|
+
|
114
|
+
def create_in_memory_module_name(p, sectionId):
|
115
|
+
projectConfigName = p["projectConfig"]["name"]
|
116
|
+
sanitized_full_name = sanitize_section_path_full_name(
|
117
|
+
p["sectionPathFullNames"][sectionId]
|
118
|
+
)
|
119
|
+
return f"setta_in_memory_{projectConfigName}_{sanitized_full_name}"
|
setta/routers/lsp.py
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
from fastapi import APIRouter, Depends
|
2
|
+
|
3
|
+
from setta.lsp.utils import restart_lsps
|
4
|
+
from setta.utils.constants import C
|
5
|
+
|
6
|
+
from .dependencies import get_lsps
|
7
|
+
|
8
|
+
router = APIRouter()
|
9
|
+
|
10
|
+
|
11
|
+
@router.post(C.ROUTE_RESTART_LANGUAGE_SERVER)
|
12
|
+
async def route_restart_language_server(lsps=Depends(get_lsps)):
|
13
|
+
lsps, lsp_readers, lsp_writers = lsps
|
14
|
+
await restart_lsps(lsps, lsp_readers, lsp_writers)
|
@@ -0,0 +1,188 @@
|
|
1
|
+
import sqlite3
|
2
|
+
from typing import List, Optional
|
3
|
+
|
4
|
+
from fastapi import APIRouter, Depends, HTTPException
|
5
|
+
from pydantic import BaseModel
|
6
|
+
|
7
|
+
from setta.database.backup import maybe_create_backup
|
8
|
+
from setta.database.db.projects.delete import delete_project_configs
|
9
|
+
from setta.database.db.projects.load import (
|
10
|
+
ProjectNotFound,
|
11
|
+
load_all_project_config_metadata,
|
12
|
+
load_default_config_name,
|
13
|
+
load_full_project,
|
14
|
+
load_project_config,
|
15
|
+
load_project_config_names,
|
16
|
+
)
|
17
|
+
from setta.database.db.projects.save import (
|
18
|
+
create_project_config,
|
19
|
+
save_project_config_name,
|
20
|
+
save_project_details,
|
21
|
+
set_as_default_project,
|
22
|
+
)
|
23
|
+
from setta.database.db.projects.saveAs import (
|
24
|
+
save_as_existing_project_config,
|
25
|
+
save_as_new_project_config,
|
26
|
+
)
|
27
|
+
from setta.database.db.projects.utils import (
|
28
|
+
add_defaults_to_project_and_load_json_sources,
|
29
|
+
filter_data_for_json_export,
|
30
|
+
)
|
31
|
+
from setta.database.export_db.export_db import maybe_export_database
|
32
|
+
from setta.utils.constants import C
|
33
|
+
|
34
|
+
from .dependencies import get_dbq
|
35
|
+
|
36
|
+
router = APIRouter()
|
37
|
+
|
38
|
+
|
39
|
+
class ProjectLoadRequest(BaseModel):
|
40
|
+
projectConfigName: str
|
41
|
+
|
42
|
+
|
43
|
+
class ProjectLoadFullRequest(BaseModel):
|
44
|
+
excludeProjectConfigName: Optional[str] = None
|
45
|
+
|
46
|
+
|
47
|
+
class ProjectSaveRequest(BaseModel):
|
48
|
+
project: dict
|
49
|
+
|
50
|
+
|
51
|
+
class SaveAsNewProjectConfigRequest(BaseModel):
|
52
|
+
project: dict
|
53
|
+
newConfigName: str
|
54
|
+
withRefs: bool
|
55
|
+
|
56
|
+
|
57
|
+
class SaveAsExistingProjectConfigRequest(BaseModel):
|
58
|
+
project: dict
|
59
|
+
configName: str
|
60
|
+
|
61
|
+
|
62
|
+
class CreateProjectConfigRequest(BaseModel):
|
63
|
+
name: Optional[str] = None
|
64
|
+
previewImgColor: str
|
65
|
+
|
66
|
+
|
67
|
+
class DeleteProjectConfigsRequest(BaseModel):
|
68
|
+
ids: List[str]
|
69
|
+
|
70
|
+
|
71
|
+
class SetProjectConfigNameRequest(BaseModel):
|
72
|
+
currProjectConfigName: str
|
73
|
+
newProjectConfigName: str
|
74
|
+
|
75
|
+
|
76
|
+
class SetAsDefaultProjectRequest(BaseModel):
|
77
|
+
projectId: str
|
78
|
+
|
79
|
+
|
80
|
+
class FilterDataForJSONExportRequest(BaseModel):
|
81
|
+
project: dict
|
82
|
+
|
83
|
+
|
84
|
+
class AddDefaultDataForJSONImportRequest(BaseModel):
|
85
|
+
project: dict
|
86
|
+
|
87
|
+
|
88
|
+
@router.post(C.ROUTE_ALL_PROJECT_CONFIG_METADATA)
|
89
|
+
def route_all_project_config_metadata(dbq=Depends(get_dbq)):
|
90
|
+
with dbq as db:
|
91
|
+
return load_all_project_config_metadata(db)
|
92
|
+
|
93
|
+
|
94
|
+
@router.post(C.ROUTE_LOAD_PROJECT_CONFIG_NAMES)
|
95
|
+
def route_load_project_config_names(dbq=Depends(get_dbq)):
|
96
|
+
with dbq as db:
|
97
|
+
return load_project_config_names(db)
|
98
|
+
|
99
|
+
|
100
|
+
@router.post(C.ROUTE_LOAD_PROJECT_CONFIG)
|
101
|
+
def route_load_project_config(
|
102
|
+
x: ProjectLoadRequest,
|
103
|
+
dbq=Depends(get_dbq),
|
104
|
+
):
|
105
|
+
try:
|
106
|
+
with dbq as db:
|
107
|
+
return load_project_config(db, x.projectConfigName)
|
108
|
+
except ProjectNotFound as e:
|
109
|
+
raise HTTPException(status_code=404, detail=repr(e))
|
110
|
+
|
111
|
+
|
112
|
+
@router.post(C.ROUTE_LOAD_FULL_PROJECT)
|
113
|
+
def route_load_full_project(x: ProjectLoadFullRequest, dbq=Depends(get_dbq)):
|
114
|
+
with dbq as db:
|
115
|
+
return load_full_project(
|
116
|
+
db, excludeProjectConfigName=x.excludeProjectConfigName
|
117
|
+
)
|
118
|
+
|
119
|
+
|
120
|
+
@router.post(C.ROUTE_SAVE_PROJECT)
|
121
|
+
def route_save_project(x: ProjectSaveRequest, dbq=Depends(get_dbq)):
|
122
|
+
with dbq as db:
|
123
|
+
maybe_create_backup(db.path)
|
124
|
+
save_project_details(db, x.project)
|
125
|
+
maybe_export_database(db, db.path)
|
126
|
+
|
127
|
+
|
128
|
+
@router.post(C.ROUTE_CREATE_PROJECT_CONFIG)
|
129
|
+
def route_create_project_config(x: CreateProjectConfigRequest, dbq=Depends(get_dbq)):
|
130
|
+
with dbq as db:
|
131
|
+
return create_project_config(db, x.name, x.previewImgColor)
|
132
|
+
|
133
|
+
|
134
|
+
@router.post(C.ROUTE_SAVE_AS_NEW_PROJECT_CONFIG)
|
135
|
+
def route_save_as_new_project_config(
|
136
|
+
x: SaveAsNewProjectConfigRequest, dbq=Depends(get_dbq)
|
137
|
+
):
|
138
|
+
with dbq as db:
|
139
|
+
return save_as_new_project_config(db, x.project, x.newConfigName, x.withRefs)
|
140
|
+
|
141
|
+
|
142
|
+
@router.post(C.ROUTE_SAVE_AS_EXISTING_PROJECT_CONFIG)
|
143
|
+
def route_save_as_existing_project_config(
|
144
|
+
x: SaveAsExistingProjectConfigRequest, dbq=Depends(get_dbq)
|
145
|
+
):
|
146
|
+
with dbq as db:
|
147
|
+
return save_as_existing_project_config(db, x.project, x.configName)
|
148
|
+
|
149
|
+
|
150
|
+
@router.post(C.ROUTE_DELETE_PROJECT_CONFIGS)
|
151
|
+
def route_delete_project_configs(x: DeleteProjectConfigsRequest, dbq=Depends(get_dbq)):
|
152
|
+
with dbq as db:
|
153
|
+
return delete_project_configs(db, x.ids)
|
154
|
+
|
155
|
+
|
156
|
+
@router.post(C.ROUTE_SET_PROJECT_CONFIG_NAME)
|
157
|
+
def route_set_project_config_name(x: SetProjectConfigNameRequest, dbq=Depends(get_dbq)):
|
158
|
+
try:
|
159
|
+
with dbq as db:
|
160
|
+
save_project_config_name(
|
161
|
+
db, x.currProjectConfigName, x.newProjectConfigName
|
162
|
+
)
|
163
|
+
except sqlite3.IntegrityError as e:
|
164
|
+
raise HTTPException(status_code=422, detail=repr(e))
|
165
|
+
|
166
|
+
|
167
|
+
@router.post(C.ROUTE_GET_DEFAULT_CONFIG_NAME)
|
168
|
+
def router_get_default_config_name(dbq=Depends(get_dbq)):
|
169
|
+
with dbq as db:
|
170
|
+
return load_default_config_name(db)
|
171
|
+
|
172
|
+
|
173
|
+
@router.post(C.ROUTE_SET_AS_DEFAULT_PROJECT)
|
174
|
+
def router_set_as_default_project(x: SetAsDefaultProjectRequest, dbq=Depends(get_dbq)):
|
175
|
+
with dbq as db:
|
176
|
+
set_as_default_project(db, x.projectId)
|
177
|
+
|
178
|
+
|
179
|
+
@router.post(C.ROUTE_FILTER_DATA_FOR_JSON_EXPORT)
|
180
|
+
def router_filter_data_for_json_export(x: FilterDataForJSONExportRequest):
|
181
|
+
filter_data_for_json_export(x.project)
|
182
|
+
return x.project
|
183
|
+
|
184
|
+
|
185
|
+
@router.post(C.ROUTE_ADD_DEFAULT_DATA_FOR_JSON_IMPORT)
|
186
|
+
def router_add_default_data_for_json_import(x: FilterDataForJSONExportRequest):
|
187
|
+
add_defaults_to_project_and_load_json_sources(x.project)
|
188
|
+
return x.project
|
@@ -0,0 +1,111 @@
|
|
1
|
+
from fastapi import APIRouter
|
2
|
+
from pydantic import BaseModel
|
3
|
+
|
4
|
+
from setta.utils.constants import C
|
5
|
+
from setta.utils.utils import replace_at_positions
|
6
|
+
|
7
|
+
router = APIRouter()
|
8
|
+
|
9
|
+
|
10
|
+
class MakeEVRefTemplateVarReplacementsRequest(BaseModel):
|
11
|
+
codeAreaReplacements: dict
|
12
|
+
codeInfoReplacements: dict
|
13
|
+
paramEVReplacements: dict
|
14
|
+
|
15
|
+
|
16
|
+
def get_original(r):
|
17
|
+
if "originalEVRef" in r:
|
18
|
+
return r["originalEVRef"]
|
19
|
+
elif "originalTemplateVar" in r:
|
20
|
+
return r["originalTemplateVar"]
|
21
|
+
else:
|
22
|
+
raise KeyError
|
23
|
+
|
24
|
+
|
25
|
+
def create_replacements_array(replacements):
|
26
|
+
output = []
|
27
|
+
for startPos, r in replacements.items():
|
28
|
+
oldName = get_original(r)["keyword"]
|
29
|
+
newName = r["newName"]
|
30
|
+
output.append((startPos, oldName, newName))
|
31
|
+
return output
|
32
|
+
|
33
|
+
|
34
|
+
def create_new_ev_refs_template_vars(replacements, newStartPositions):
|
35
|
+
evRefs = []
|
36
|
+
templateVars = []
|
37
|
+
for oldPos, startPos, newName in newStartPositions:
|
38
|
+
common = {"startPos": startPos, "keyword": newName}
|
39
|
+
r = replacements[oldPos]
|
40
|
+
if "originalEVRef" in r:
|
41
|
+
evRefs.append({**r["originalEVRef"], **common})
|
42
|
+
elif "originalTemplateVar" in r:
|
43
|
+
templateVars.append({**r["originalTemplateVar"], **common})
|
44
|
+
else:
|
45
|
+
raise KeyError
|
46
|
+
|
47
|
+
# frontend needs it sorted by startPos
|
48
|
+
evRefs = sorted(evRefs, key=lambda x: x["startPos"])
|
49
|
+
templateVars = sorted(templateVars, key=lambda x: x["startPos"])
|
50
|
+
return evRefs, templateVars
|
51
|
+
|
52
|
+
|
53
|
+
def get_new_value_and_positions(details):
|
54
|
+
return replace_at_positions(
|
55
|
+
details["string"],
|
56
|
+
create_replacements_array(details["replacements"]),
|
57
|
+
return_positions=True,
|
58
|
+
)
|
59
|
+
|
60
|
+
|
61
|
+
def convert_to_dict(replacements):
|
62
|
+
output = {}
|
63
|
+
for r in replacements:
|
64
|
+
output[get_original(r)["startPos"]] = r
|
65
|
+
return output
|
66
|
+
|
67
|
+
|
68
|
+
@router.post(C.ROUTE_MAKE_EV_REF_TEMPLATE_VAR_REPLACEMENTS)
|
69
|
+
def route_make_ev_ref_template_var_replacements(
|
70
|
+
x: MakeEVRefTemplateVarReplacementsRequest,
|
71
|
+
):
|
72
|
+
newCodeAreaValues = {}
|
73
|
+
for variantId, details in x.codeAreaReplacements.items():
|
74
|
+
details["replacements"] = convert_to_dict(details["replacements"])
|
75
|
+
newValue, newStartPositions = get_new_value_and_positions(details)
|
76
|
+
newCodeAreaValues[variantId] = [
|
77
|
+
newValue,
|
78
|
+
*create_new_ev_refs_template_vars(
|
79
|
+
details["replacements"], newStartPositions
|
80
|
+
),
|
81
|
+
]
|
82
|
+
|
83
|
+
newCodeInfoValues = {}
|
84
|
+
for codeInfoId, details in x.codeInfoReplacements.items():
|
85
|
+
details["replacements"] = convert_to_dict(details["replacements"])
|
86
|
+
newValue, newStartPositions = get_new_value_and_positions(details)
|
87
|
+
newCodeInfoValues[codeInfoId] = [
|
88
|
+
newValue,
|
89
|
+
*create_new_ev_refs_template_vars(
|
90
|
+
details["replacements"], newStartPositions
|
91
|
+
),
|
92
|
+
]
|
93
|
+
|
94
|
+
newParamEVValues = {}
|
95
|
+
for variantId, v in x.paramEVReplacements.items():
|
96
|
+
newParamEVValues[variantId] = {}
|
97
|
+
for referringParamInfoId, details in v.items():
|
98
|
+
details["replacements"] = convert_to_dict(details["replacements"])
|
99
|
+
newValue, newStartPositions = get_new_value_and_positions(details)
|
100
|
+
newParamEVValues[variantId][referringParamInfoId] = [
|
101
|
+
newValue,
|
102
|
+
*create_new_ev_refs_template_vars(
|
103
|
+
details["replacements"], newStartPositions
|
104
|
+
),
|
105
|
+
]
|
106
|
+
|
107
|
+
return {
|
108
|
+
"newCodeAreaValues": newCodeAreaValues,
|
109
|
+
"newCodeInfoValues": newCodeInfoValues,
|
110
|
+
"newParamEVValues": newParamEVValues,
|
111
|
+
}
|