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
Commits
3c95dfe6
Commit
3c95dfe6
authored
4 years ago
by
Daniel Lyons
Browse files
Options
Downloads
Patches
Plain Diff
Reduce to a single file
parent
b78eabff
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
services/workflow/setup.py
+1
-1
1 addition, 1 deletion
services/workflow/setup.py
services/workflow/src/workflow/__init__.py
+0
-29
0 additions, 29 deletions
services/workflow/src/workflow/__init__.py
services/workflow/src/workflow/server.py
+23
-2
23 additions, 2 deletions
services/workflow/src/workflow/server.py
with
24 additions
and
32 deletions
services/workflow/setup.py
+
1
−
1
View file @
3c95dfe6
...
...
@@ -97,7 +97,7 @@ setup(
packages
=
find_packages
(),
entry_points
=
{
'
paste.app_factory
'
:
[
'
main = workflow:main
'
'
main = workflow
.server
:main
'
],
},
)
This diff is collapsed.
Click to expand it.
services/workflow/src/workflow/__init__.py
+
0
−
29
View file @
3c95dfe6
from
schema
import
create_engine
from
pyramid.config
import
Configurator
from
pyramid_beaker
import
session_factory_from_settings
from
sqlalchemy.orm
import
scoped_session
,
sessionmaker
from
zope.sqlalchemy
import
ZopeTransactionExtension
from
pyramid.renderers
import
JSONP
from
workflow.workflow
import
lookup_workflow
,
lookup_file
DB
=
{}
def
main
(
global_config
,
**
settings
):
# DB['SDM'] = scoped_session(sessionmaker(extension=ZopeTransactionExtension()))
with
Configurator
(
settings
=
settings
)
as
config
:
session_factory
=
session_factory_from_settings
(
settings
)
config
.
set_session_factory
(
session_factory
)
config
.
add_renderer
(
'
jsonp
'
,
JSONP
(
param_name
=
'
callback
'
))
config
.
add_route
(
'
workflows
'
,
'
/workflows
'
)
config
.
add_route
(
'
workflow
'
,
'
/workflows/{id}
'
,
factory
=
lookup_workflow
)
config
.
add_route
(
'
submit_workflow
'
,
'
/workflows/{id}/submit
'
,
factory
=
lookup_workflow
)
config
.
add_route
(
'
workflow_files
'
,
'
/workflows/{id}/files
'
,
factory
=
lookup_workflow
)
config
.
add_route
(
'
workflow_file
'
,
'
/workflows/{id}/files/{filename}
'
,
factory
=
lookup_file
)
config
.
include
(
'
pyramid_beaker
'
)
config
.
scan
(
'
workflow.workflow
'
)
return
config
.
make_wsgi_app
()
This diff is collapsed.
Click to expand it.
services/workflow/src/workflow/
workflow
.py
→
services/workflow/src/workflow/
server
.py
+
23
−
2
View file @
3c95dfe6
from
pyramid.response
import
Response
from
pyramid.view
import
view_config
,
view_defaults
from
pyramid.config
import
Configurator
from
pyramid_beaker
import
session_factory_from_settings
from
pyramid.renderers
import
JSONP
WORKFLOWS
=
[{
'
id
'
:
1
,
'
name
'
:
'
foo
'
,
'
files
'
:
{
'
file.txt
'
:
{
'
id
'
:
1
,
'
name
'
:
'
file.txt
'
,
'
content
'
:
'
Hello, world!
'
}}}]
...
...
@@ -50,4 +52,23 @@ class WorkflowService:
@view_config
(
request_method
=
'
GET
'
,
route_name
=
'
workflow_file
'
,
accept
=
'
application/json
'
)
def
get_file_json
(
self
):
return
self
.
request
.
context
\ No newline at end of file
return
self
.
request
.
context
def
main
(
global_config
,
**
settings
):
# DB['SDM'] = scoped_session(sessionmaker(extension=ZopeTransactionExtension()))
with
Configurator
(
settings
=
settings
)
as
config
:
session_factory
=
session_factory_from_settings
(
settings
)
config
.
set_session_factory
(
session_factory
)
config
.
add_renderer
(
'
jsonp
'
,
JSONP
(
param_name
=
'
callback
'
))
config
.
add_route
(
'
workflows
'
,
'
/workflows
'
)
config
.
add_route
(
'
workflow
'
,
'
/workflows/{id}
'
,
factory
=
lookup_workflow
)
config
.
add_route
(
'
submit_workflow
'
,
'
/workflows/{id}/submit
'
,
factory
=
lookup_workflow
)
config
.
add_route
(
'
workflow_files
'
,
'
/workflows/{id}/files
'
,
factory
=
lookup_workflow
)
config
.
add_route
(
'
workflow_file
'
,
'
/workflows/{id}/files/{filename}
'
,
factory
=
lookup_file
)
config
.
include
(
'
pyramid_beaker
'
)
config
.
scan
(
'
.
'
)
return
config
.
make_wsgi_app
()
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment