Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
V
visualizer-embed
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
Container 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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Owen Graham
visualizer-embed
Commits
00e08428
Verified
Commit
00e08428
authored
3 years ago
by
Owen Graham
Browse files
Options
Downloads
Patches
Plain Diff
Move venv-activating code to CGI script
parent
e67ef7b3
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
htdocs/-
+11
-6
11 additions, 6 deletions
htdocs/-
visualizer.py
+0
-4
0 additions, 4 deletions
visualizer.py
with
11 additions
and
10 deletions
htdocs/-
+
11
−
6
View file @
00e08428
...
...
@@ -6,10 +6,15 @@ import os.path
import
sys
from
wsgiref.handlers
import
CGIHandler
if
__name__
==
'
__main__
'
:
# Move to project directory.
os
.
chdir
(
'
..
'
)
sys
.
path
[
0
]
=
os
.
path
.
abspath
(
'
.
'
)
# Move to project directory.
os
.
chdir
(
'
..
'
)
sys
.
path
[
0
]
=
os
.
path
.
abspath
(
'
.
'
)
from
visualizer
import
app
CGIHandler
().
run
(
app
)
# Activate the virtual environment to give visualizer.py access to
# non-standard packages.
activator
=
'
venv/bin/activate_this.py
'
exec
(
open
(
activator
).
read
(),
{
'
__file__
'
:
activator
})
# Run the app as CGI.
from
visualizer
import
app
CGIHandler
().
run
(
app
)
This diff is collapsed.
Click to expand it.
visualizer.py
+
0
−
4
View file @
00e08428
...
...
@@ -5,10 +5,6 @@ import math
from
types
import
SimpleNamespace
from
urllib.request
import
urlopen
# Activate the virtual env to get access to non-standard packages.
activator
=
'
venv/bin/activate_this.py
'
exec
(
open
(
activator
).
read
(),
{
'
__file__
'
:
activator
})
import
asccol
from
dataclasses
import
make_dataclass
from
flask
import
abort
,
Flask
,
g
,
jsonify
,
render_template
,
request
,
Response
...
...
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