Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
workspaces
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ssa
workspaces
Merge requests
!376
Image Ingestion Workflow Part 1
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Image Ingestion Workflow Part 1
WS-531_image_ingestion
into
main
Overview
0
Commits
3
Pipelines
3
Changes
1
Merged
Charlotte Hausman
requested to merge
WS-531_image_ingestion
into
main
3 years ago
Overview
0
Commits
3
Pipelines
3
Changes
1
Expand
fix conveyor to allow multiple ingestion attempts
fix workflow endpoint for image ingestion
create ingest-image workflow
Edited
3 years ago
by
Charlotte Hausman
0
0
Merge request reports
Viewing commit
fae1c25b
Prev
Next
Show latest version
1 file
+
39
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
fae1c25b
add AbstractTextFile to ingest_envoy
· fae1c25b
Charlotte Hausman
authored
3 years ago
apps/cli/executables/pexable/ingest_envoy/ingest_envoy/schema.py
0 → 100644
+
39
−
0
Options
from
__future__
import
annotations
from
pathlib
import
Path
"""
Adapted from shared/system to avoid including ssa-workspaces in pex
"""
class
JSONSerializable
:
def
__json__
(
self
,
request
=
None
)
->
dict
:
"""
Allows this object to be converted to JSON
:param request: this parameter is the active Pyramid request, if applicable (None otherwise)
:return: a dictionary which can be converted to JSON using json.dump
"""
pass
@classmethod
def
from_json
(
cls
,
json
:
dict
)
->
any
:
pass
class
AbstractTextFile
(
JSONSerializable
):
"""
Abstract text file is exactly that, an abstract concept of what a file is, to be
returned from various non-filesystem places.
"""
def
__init__
(
self
,
filename
:
str
,
content
:
str
):
self
.
filename
,
self
.
content
=
filename
,
content
def
write_to
(
self
,
directory
:
Path
):
(
directory
/
self
.
filename
).
write_text
(
self
.
content
)
@classmethod
def
from_path
(
cls
,
path
:
Path
)
->
AbstractTextFile
:
return
cls
(
path
.
name
,
path
.
read_text
())
Loading