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
27d74110
Commit
27d74110
authored
Oct 30, 2014
by
Brian Coca
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Created Deprecated module category that only appears when there is
something to show
parent
e41bcc41
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
6 deletions
+11
-6
hacking/module_formatter.py
+11
-6
No files found.
hacking/module_formatter.py
View file @
27d74110
...
@@ -121,28 +121,33 @@ def write_data(text, options, outputname, module):
...
@@ -121,28 +121,33 @@ def write_data(text, options, outputname, module):
def
list_modules
(
module_dir
):
def
list_modules
(
module_dir
):
''' returns a hash of categories, each category being a hash of module names to file paths '''
''' returns a hash of categories, each category being a hash of module names to file paths '''
categories
=
dict
(
all
=
dict
())
categories
=
dict
(
all
=
dict
()
,
deprecated
=
dict
()
)
files
=
glob
.
glob
(
"
%
s/*/*"
%
module_dir
)
files
=
glob
.
glob
(
"
%
s/*/*"
%
module_dir
)
for
d
in
files
:
for
d
in
files
:
if
os
.
path
.
isdir
(
d
):
if
os
.
path
.
isdir
(
d
):
files2
=
glob
.
glob
(
"
%
s/*"
%
d
)
files2
=
glob
.
glob
(
"
%
s/*"
%
d
)
for
f
in
files2
:
for
f
in
files2
:
if
os
.
path
.
basename
(
f
)
.
startswith
(
"_"
):
# skip deprecated/aliases for now
module
=
os
.
path
.
splitext
(
os
.
path
.
basename
(
f
))[
0
]
continue
category
=
os
.
path
.
dirname
(
f
)
.
split
(
"/"
)[
-
1
]
if
not
f
.
endswith
(
".py"
)
or
f
.
endswith
(
'__init__.py'
):
if
not
f
.
endswith
(
".py"
)
or
f
.
endswith
(
'__init__.py'
):
# windows powershell modules have documentation stubs in python docstring
# windows powershell modules have documentation stubs in python docstring
# format (they are not executed) so skip the ps1 format files
# format (they are not executed) so skip the ps1 format files
continue
continue
elif
module
.
startswith
(
"_"
):
# Handle deprecated modules
if
not
os
.
path
.
islink
(
f
):
# ignores aliases
categories
[
'deprecated'
][
module
]
=
f
continue
elif
module
in
categories
[
'deprecated'
]:
# Removes dupes
categories
[
'deprecated'
]
.
pop
(
module
,
None
)
tokens
=
f
.
split
(
"/"
)
module
=
tokens
[
-
1
]
.
replace
(
".py"
,
""
)
category
=
tokens
[
-
2
]
if
not
category
in
categories
:
if
not
category
in
categories
:
categories
[
category
]
=
{}
categories
[
category
]
=
{}
categories
[
category
][
module
]
=
f
categories
[
category
][
module
]
=
f
categories
[
'all'
][
module
]
=
f
categories
[
'all'
][
module
]
=
f
if
not
len
(
categories
[
'deprecated'
])
>
0
:
categories
.
pop
(
'deprecated'
,
None
)
return
categories
return
categories
#####################################################################################
#####################################################################################
...
...
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