Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mutalyzer
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Analyze
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
Mirrors
mutalyzer
Commits
c3c6d281
Commit
c3c6d281
authored
9 years ago
by
Vermaat
Browse files
Options
Downloads
Patches
Plain Diff
Configuration by environment variable is optional
parent
757ec7e4
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
doc/install.rst
+1
-1
1 addition, 1 deletion
doc/install.rst
mutalyzer/config/__init__.py
+11
-4
11 additions, 4 deletions
mutalyzer/config/__init__.py
with
12 additions
and
5 deletions
doc/install.rst
+
1
−
1
View file @
c3c6d281
...
@@ -42,7 +42,7 @@ The impatient can run Mutalyzer without a database server and more such
...
@@ -42,7 +42,7 @@ The impatient can run Mutalyzer without a database server and more such
nonsense with the following steps::
nonsense with the following steps::
$ pip install -r requirements.txt
$ pip install -r requirements.txt
$
MUTALYZER_SETTINGS=/dev/null
python -m mutalyzer.entrypoints.website
$ python -m mutalyzer.entrypoints.website
This starts the website frontend on the reported port using an in-memory
This starts the website frontend on the reported port using an in-memory
SQLite database.
SQLite database.
...
...
This diff is collapsed.
Click to expand it.
mutalyzer/config/__init__.py
+
11
−
4
View file @
c3c6d281
...
@@ -16,6 +16,8 @@ from __future__ import unicode_literals
...
@@ -16,6 +16,8 @@ from __future__ import unicode_literals
import
collections
import
collections
import
os
import
os
import
warnings
import
flask.config
import
flask.config
...
@@ -65,10 +67,15 @@ class LazySettings(util.LazyObject):
...
@@ -65,10 +67,15 @@ class LazySettings(util.LazyObject):
self
.
_wrapped
=
Settings
()
self
.
_wrapped
=
Settings
()
self
.
_wrapped
.
from_object
(
'
mutalyzer.config.default_settings
'
)
self
.
_wrapped
.
from_object
(
'
mutalyzer.config.default_settings
'
)
if
from_environment
:
if
from_environment
:
# Todo: We crash if the environment variable is not set. Perhaps
if
ENVIRONMENT_VARIABLE
in
os
.
environ
:
# it is more user-friendly if we fall back on ./settings.py or
self
.
_wrapped
.
from_envvar
(
ENVIRONMENT_VARIABLE
)
# ~/mutalyzer_settings.py or something if it exists.
else
:
self
.
_wrapped
.
from_envvar
(
ENVIRONMENT_VARIABLE
)
warnings
.
warn
(
'
The environment variable
\'
%s
\'
is not set
'
'
and as such default configuration settings
'
'
are used. Set this variable and make it point
'
'
to a configuration file to customize
'
'
configuration.
'
%
ENVIRONMENT_VARIABLE
,
RuntimeWarning
)
def
configure
(
self
,
settings
):
def
configure
(
self
,
settings
):
"""
"""
...
...
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