Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ansible
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
ansible
Commits
eb8a1123
Commit
eb8a1123
authored
Sep 30, 2012
by
Jan-Piet Mens
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
module_formatter can output lists of files to process (.rst and .tex)
parent
190e4c26
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
0 deletions
+22
-0
hacking/module_formatter.py
+22
-0
No files found.
hacking/module_formatter.py
View file @
eb8a1123
...
...
@@ -191,6 +191,11 @@ def main():
dest
=
"output_dir"
,
default
=
None
,
help
=
"Output directory for module files"
)
p
.
add_argument
(
"-I"
,
"--includes-file"
,
action
=
"store"
,
dest
=
"includes_file"
,
default
=
None
,
help
=
"Create a file containing list of processed modules"
)
p
.
add_argument
(
"-G"
,
"--generate"
,
action
=
"store_true"
,
dest
=
"do_boilerplate"
,
...
...
@@ -230,14 +235,20 @@ def main():
env
.
filters
[
'jpfunc'
]
=
latex_ify
template
=
env
.
get_template
(
'latex.j2'
)
outputname
=
"
%
s.tex"
includecmt
=
"
%
generated code
\n
"
includefmt
=
"
\\
input
%
s
\n
"
if
args
.
type
==
'html'
:
env
.
filters
[
'jpfunc'
]
=
html_ify
template
=
env
.
get_template
(
'html.j2'
)
outputname
=
"
%
s.html"
includecmt
=
""
includefmt
=
""
if
args
.
type
==
'man'
:
env
.
filters
[
'jpfunc'
]
=
man_ify
template
=
env
.
get_template
(
'man.j2'
)
outputname
=
"ansible.
%
s.man"
includecmt
=
""
includefmt
=
""
if
args
.
type
==
'rst'
:
env
.
filters
[
'jpfunc'
]
=
rst_ify
env
.
filters
[
'html_ify'
]
=
html_ify
...
...
@@ -245,9 +256,17 @@ def main():
env
.
filters
[
'xline'
]
=
rst_xline
template
=
env
.
get_template
(
'rst.j2'
)
outputname
=
"
%
s.rst"
includecmt
=
".. Generated by module_formatter
\n
"
includefmt
=
".. include::
%
s.rst
\n
"
if
args
.
type
==
'json'
:
env
.
filters
[
'jpfunc'
]
=
json_ify
outputname
=
"
%
s.json"
includecmt
=
""
includefmt
=
""
if
args
.
includes_file
is
not
None
and
includefmt
!=
""
:
incfile
=
open
(
args
.
includes_file
,
"w"
)
incfile
.
write
(
includecmt
)
for
module
in
os
.
listdir
(
args
.
module_dir
):
if
len
(
args
.
module_list
):
...
...
@@ -270,6 +289,9 @@ def main():
doc
[
'now_date'
]
=
datetime
.
date
.
today
()
.
strftime
(
'
%
Y-
%
m-
%
d'
)
doc
[
'ansible_version'
]
=
args
.
ansible_version
if
args
.
includes_file
is
not
None
and
includefmt
!=
""
:
incfile
.
write
(
includefmt
%
module
)
if
args
.
verbose
:
print
json
.
dumps
(
doc
,
indent
=
4
)
...
...
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