Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
nk20-scripts
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
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
BDE
nk20-scripts
Commits
7246f4d1
Commit
7246f4d1
authored
4 years ago
by
ynerant
Browse files
Options
Downloads
Patches
Plain Diff
Change debug option to "print stdout" / "edit wiki" in the Refresh activities script
parent
2a113d22
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
management/commands/refresh_activities.py
+10
-9
10 additions, 9 deletions
management/commands/refresh_activities.py
with
10 additions
and
9 deletions
management/commands/refresh_activities.py
+
10
−
9
View file @
7246f4d1
...
@@ -150,30 +150,31 @@ class Command(BaseCommand):
...
@@ -150,30 +150,31 @@ class Command(BaseCommand):
return
page
,
header
+
body
return
page
,
header
+
body
@staticmethod
@staticmethod
def
refresh_raw_wiki_page
(
comment
=
"
refresh
"
,
debug
=
Tru
e
):
def
refresh_raw_wiki_page
(
comment
=
"
refresh
"
,
print_stdout
=
False
,
edit_wiki
=
Fals
e
):
page
,
content
=
Command
.
get_raw_page
()
page
,
content
=
Command
.
get_raw_page
()
if
debug
:
if
print_stdout
:
print
(
content
)
print
(
content
)
else
:
if
edit_wiki
:
Command
.
edit_wiki
(
page
,
content
,
comment
)
Command
.
edit_wiki
(
page
,
content
,
comment
)
@staticmethod
@staticmethod
def
refresh_human_readable_wiki_page
(
comment
=
"
refresh
"
,
debug
=
Tru
e
):
def
refresh_human_readable_wiki_page
(
comment
=
"
refresh
"
,
print_stdout
=
False
,
edit_wiki
=
Fals
e
):
page
,
content
=
Command
.
get_human_readable_page
()
page
,
content
=
Command
.
get_human_readable_page
()
if
debug
:
if
print_stdout
:
print
(
content
)
print
(
content
)
else
:
if
edit_wiki
:
Command
.
edit_wiki
(
page
,
content
,
comment
)
Command
.
edit_wiki
(
page
,
content
,
comment
)
def
add_arguments
(
self
,
parser
):
def
add_arguments
(
self
,
parser
):
parser
.
add_argument
(
"
--human
"
,
"
-H
"
,
action
=
"
store_true
"
,
help
=
"
Save human readable page
"
)
parser
.
add_argument
(
"
--human
"
,
"
-H
"
,
action
=
"
store_true
"
,
help
=
"
Save human readable page
"
)
parser
.
add_argument
(
"
--raw
"
,
"
-r
"
,
action
=
"
store_true
"
,
help
=
"
Save raw page, for the calendar
"
)
parser
.
add_argument
(
"
--raw
"
,
"
-r
"
,
action
=
"
store_true
"
,
help
=
"
Save raw page, for the calendar
"
)
parser
.
add_argument
(
"
--comment
"
,
"
-c
"
,
action
=
"
store
"
,
type
=
str
,
default
=
""
,
help
=
"
Comment of the modification
"
)
parser
.
add_argument
(
"
--comment
"
,
"
-c
"
,
action
=
"
store
"
,
type
=
str
,
default
=
""
,
help
=
"
Comment of the modification
"
)
parser
.
add_argument
(
"
--debug
"
,
"
-d
"
,
action
=
"
store_true
"
,
help
=
"
Don
'
t commit to the wiki, render in stdout
"
)
parser
.
add_argument
(
"
--stdout
"
,
"
-o
"
,
action
=
"
store_true
"
,
help
=
"
Render the wiki page in stdout
"
)
parser
.
add_argument
(
"
--wiki
"
,
"
-w
"
,
action
=
"
store_true
"
,
help
=
"
Send modifications to the wiki
"
)
def
handle
(
self
,
*
args
,
**
options
):
def
handle
(
self
,
*
args
,
**
options
):
if
options
[
"
raw
"
]:
if
options
[
"
raw
"
]:
Command
.
refresh_raw_wiki_page
(
options
[
"
comment
"
],
options
[
"
debug
"
])
Command
.
refresh_raw_wiki_page
(
options
[
"
comment
"
],
options
[
"
stdout
"
],
options
[
"
wiki
"
])
if
options
[
"
human
"
]:
if
options
[
"
human
"
]:
Command
.
refresh_human_readable_wiki_page
(
options
[
"
comment
"
],
options
[
"
debug
"
])
Command
.
refresh_human_readable_wiki_page
(
options
[
"
comment
"
],
options
[
"
stdout
"
],
options
[
"
wiki
"
])
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