Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
Nuovo sito
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
16
Issues
16
List
Boards
Labels
Milestones
Merge Requests
2
Merge Requests
2
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Gruppo Web
Nuovo sito
Commits
47f1682a
Commit
47f1682a
authored
May 01, 2018
by
Pietro Albini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a separate command for initializing the data directory
parent
7f9c0a5a
Pipeline
#79
passed with stage
in 0 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
0 deletions
+13
-0
managetests.json
managetests.json
+3
-0
uitwww/__main__.py
uitwww/__main__.py
+10
-0
No files found.
managetests.json
View file @
47f1682a
...
...
@@ -12,6 +12,9 @@
"command"
:
[
"{{base}}/env/bin/pip"
,
"install"
,
"{{artifact}}"
]
}
],
"after_install"
:
[
[
"{{base}}/env/bin/uitwww"
,
"init"
,
"{{base}}/data"
]
],
"run"
:
[
"{{base}}/env/bin/uitwww"
,
"run"
,
"-g"
,
"{{gunicorn_config_file}}"
,
"{{base}}/data"
...
...
uitwww/__main__.py
View file @
47f1682a
...
...
@@ -37,6 +37,7 @@ def cli():
@
click
.
option
(
"-w"
,
"--workers"
,
help
=
"Number of workers to start"
,
default
=
3
)
@
click
.
option
(
"-d"
,
"--debug"
,
help
=
"Enable debug mode"
,
is_flag
=
True
)
def
run
(
data
,
gunicorn_config
,
port
,
public
,
workers
,
debug
):
"""Run the application"""
# Create the application instance
src_directory
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
))
...
...
@@ -70,3 +71,12 @@ def run(data, gunicorn_config, port, public, workers, debug):
server
.
run
()
except
SystemExit
:
pass
@
cli
.
command
(
"init"
)
@
click
.
argument
(
"data"
)
def
init
(
data
):
"""Initialize the data directory"""
print
(
"Initializing data directory:"
,
data
)
data_path
=
os
.
path
.
expanduser
(
os
.
path
.
abspath
(
data
))
uitwww
.
init_data_directory
(
data_path
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment