Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
Odoo scripts
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Container Registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
XCG
Odoo scripts
Commits
a27dd12a6cf7
Commit
a27dd12a6cf7
authored
5 years ago
by
hugo.monnerie
Browse files
Options
Downloads
Patches
Plain Diff
change list_module to python3 script
parent
fd1b9ce6d3e8
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
odoo_scripts/list_modules.py
+69
-4
69 additions, 4 deletions
odoo_scripts/list_modules.py
setup.py
+1
-1
1 addition, 1 deletion
setup.py
with
70 additions
and
5 deletions
list_modules
→
odoo_scripts/
list_modules
.py
100755 → 100644
+
69
−
4
View file @
a27dd12a
#!/bin/zsh
# TODO change to a pure python3 script installed with setup.py as an entrypoint
#!/usr/bin/env python3
# vim: set shiftwidth=4 softtabstop=4:
# Create the file odoo_modules_list from setup.cfg
# template version 2.7
...
...
@@ -3,8 +2,74 @@
# vim: set shiftwidth=4 softtabstop=4:
# Create the file odoo_modules_list from setup.cfg
# template version 2.7
project_home
=
$PWD
python3
-B
-c
"import configparser ; c = configparser.ConfigParser() ; c.read('
${
project_home
}
/setup.cfg') ; print(','.join(c.get('odoo_scripts', 'module_list').split()))"
>
$project_home
/odoo_modules_list
import
argparse
import
configparser
import
logging
import
os
import
subprocess
import
sys
import
yaml
from
.logging
import
add_verbosity_to_parser
,
logging_from_verbose
_logger
=
logging
.
getLogger
(
__name__
)
__version__
=
'
1.0.1
'
__date__
=
'
2020-02-26
'
__updated__
=
'
2020-02-26
'
def
main
(
argv
=
None
):
# IGNORE:C0111
"""
Parse arguments and launch conversion
"""
if
argv
is
None
:
argv
=
sys
.
argv
else
:
sys
.
argv
.
extend
(
argv
)
program_version
=
__version__
program_build_date
=
str
(
__updated__
)
program_version_message
=
'
%%(prog)s %s (%s)
'
%
(
program_version
,
program_build_date
)
program_shortdesc
=
__doc__
.
split
(
"
\n
"
)[
1
]
program_license
=
'''
%s
Created by Hugo Monnerie on %s.
Copyright 2020 XCG Consulting. All rights reserved.
Licensed under the MIT License
Distributed on an
"
AS IS
"
basis without warranties
or conditions of any kind, either express or implied.
USAGE
'''
%
(
program_shortdesc
,
str
(
__date__
),
)
# Argument parsing
parser
=
argparse
.
ArgumentParser
(
description
=
program_license
,
formatter_class
=
argparse
.
RawDescriptionHelpFormatter
)
parser
.
add_argument
(
'
-V
'
,
'
--version
'
,
action
=
'
version
'
,
version
=
program_version_message
)
add_verbosity_to_parser
(
parser
)
nmspc
=
parser
.
parse_args
()
logging_from_verbose
(
nmspc
)
list_modules
(
nmspc
.
directory
,
nmspc
.
output
)
def
list_modules
():
c
=
configparser
.
ConfigParser
()
c
.
read
(
os
.
getcwd
()
+
'
/setup.cfg
'
)
with
open
(
'
odoo_modules_list
'
)
as
odoo_modul_list
:
odoo_modul_list
.
write
(
'
,
'
.
join
(
c
.
get
(
'
odoo_scripts
'
,
'
module_list
'
).
split
()))
if
__name__
==
'
__main__
'
:
main
()
This diff is collapsed.
Click to expand it.
setup.py
+
1
−
1
View file @
a27dd12a
...
...
@@ -24,6 +24,7 @@
"
do_tests=odoo_scripts.do_tests:main
"
,
"
docker_build=odoo_scripts.docker_build:main
"
,
"
conf2reST=odoo_scripts.conf2reST:main
"
,
"
list_modules=odoo_scripts.list_modules:main
"
,
# TODO add all the other python scripts
]
},
...
...
@@ -31,7 +32,6 @@
"
docker_build_copy
"
,
"
docker_build_clean
"
,
"
update_duplicate_sources
"
,
"
list_modules
"
,
],
python_requires
=
"
>=3.6
"
,
)
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