wok-code 2.0.4__tar.gz → 2.0.6__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {wok_code-2.0.4 → wok_code-2.0.6}/PKG-INFO +20 -18
- {wok_code-2.0.4 → wok_code-2.0.6}/README.rst +22 -10
- {wok_code-2.0.4 → wok_code-2.0.6}/setup.py +4 -1
- {wok_code-2.0.4 → wok_code-2.0.6}/wok_code/__init__.py +1 -0
- {wok_code-2.0.4 → wok_code-2.0.6}/wok_code/cvt_csv_2_xml.py +1 -1
- {wok_code-2.0.4 → wok_code-2.0.6}/wok_code/cvt_script +1 -3
- wok_code-2.0.6/wok_code/do_git_checkout_new_branch.py +252 -0
- {wok_code-2.0.4 → wok_code-2.0.6}/wok_code/do_gitignore.py +2 -1
- {wok_code-2.0.4 → wok_code-2.0.6}/wok_code/gen_addons_table.py +1 -1
- wok_code-2.0.6/wok_code/install_python_3_from_source.sh +31 -0
- wok_code-2.0.6/wok_code/pgconf.py +94 -0
- {wok_code-2.0.4 → wok_code-2.0.6}/wok_code/please.man +19 -10
- {wok_code-2.0.4 → wok_code-2.0.6}/wok_code/pypi.sh +4 -4
- {wok_code-2.0.4 → wok_code-2.0.6}/wok_code/scripts/__init__.py +3 -0
- wok_code-2.0.6/wok_code/scripts/config/globals.yml +29 -0
- wok_code-2.0.6/wok_code/scripts/config/globals_xml.yml +0 -0
- wok_code-2.0.6/wok_code/scripts/config/to_new_api.yml +54 -0
- wok_code-2.0.6/wok_code/scripts/config/to_odoo_py2.yml +14 -0
- wok_code-2.0.6/wok_code/scripts/config/to_odoo_py3.yml +14 -0
- wok_code-2.0.6/wok_code/scripts/config/to_old_api.yml +48 -0
- {wok_code-2.0.4 → wok_code-2.0.6}/wok_code/scripts/cvt_csv_2_rst.py +1 -1
- {wok_code-2.0.4 → wok_code-2.0.6}/wok_code/scripts/cvt_csv_coa.py +1 -1
- {wok_code-2.0.4 → wok_code-2.0.6}/wok_code/scripts/deploy_odoo.py +369 -208
- {wok_code-2.0.4 → wok_code-2.0.6}/wok_code/scripts/dist_pkg.sh +1 -3
- wok_code-2.0.6/wok_code/scripts/do_migrate.py +759 -0
- {wok_code-2.0.4 → wok_code-2.0.6}/wok_code/scripts/do_odoo_site.py +31 -40
- {wok_code-2.0.4 → wok_code-2.0.6}/wok_code/scripts/gen_readme.py +8 -3
- {wok_code-2.0.4 → wok_code-2.0.6}/wok_code/scripts/generate_random_codes.py +1 -1
- {wok_code-2.0.4 → wok_code-2.0.6}/wok_code/scripts/license_mgnt.py +0 -0
- {wok_code-2.0.4 → wok_code-2.0.6}/wok_code/scripts/lint_2_compare.py +2 -2
- {wok_code-2.0.4 → wok_code-2.0.6}/wok_code/scripts/main.py +1 -1
- {wok_code-2.0.4 → wok_code-2.0.6}/wok_code/scripts/makepo_it.py +1 -1
- {wok_code-2.0.4 → wok_code-2.0.6}/wok_code/scripts/odoo_dependencies.py +1 -1
- {wok_code-2.0.4 → wok_code-2.0.6}/wok_code/scripts/odoo_translation.py +10 -9
- {wok_code-2.0.4 → wok_code-2.0.6}/wok_code/scripts/odoo_translation_old.py +1 -1
- wok_code-2.0.6/wok_code/scripts/please.py +649 -0
- {wok_code-2.0.4 → wok_code-2.0.6}/wok_code/scripts/please.sh +197 -590
- wok_code-2.0.6/wok_code/scripts/please_apache.py +208 -0
- wok_code-2.0.6/wok_code/scripts/please_z0bug.py +163 -0
- wok_code-2.0.6/wok_code/scripts/run_odoo_debug.py +35 -0
- {wok_code-2.0.4 → wok_code-2.0.6}/wok_code/scripts/setup.info +4 -1
- {wok_code-2.0.4 → wok_code-2.0.6}/wok_code/scripts/to_pep8.py +1 -1
- {wok_code-2.0.4 → wok_code-2.0.6}/wok_code/scripts/wget_odoo_repositories.py +3 -2
- {wok_code-2.0.4 → wok_code-2.0.6}/wok_code/ssh.py +34 -18
- {wok_code-2.0.4 → wok_code-2.0.6}/wok_code/tests/test_gen_readme.py +1 -1
- wok_code-2.0.4/wok_code/tests/devel_tools_test_01.py → wok_code-2.0.6/wok_code/tests/test_license_mgnt.py +8 -10
- wok_code-2.0.6/wok_code/tests/test_please.py +81 -0
- {wok_code-2.0.4 → wok_code-2.0.6}/wok_code/topep8 +2 -4
- {wok_code-2.0.4 → wok_code-2.0.6}/wok_code.egg-info/PKG-INFO +20 -18
- {wok_code-2.0.4 → wok_code-2.0.6}/wok_code.egg-info/SOURCES.txt +14 -4
- {wok_code-2.0.4 → wok_code-2.0.6}/wok_code.egg-info/entry_points.txt +1 -0
- {wok_code-2.0.4 → wok_code-2.0.6}/wok_code.egg-info/requires.txt +2 -1
- wok_code-2.0.4/wok_code/scripts/do_migrate.py +0 -184
- wok_code-2.0.4/wok_code/scripts/please.py +0 -79
- wok_code-2.0.4/wok_code/tests/__init__.py +0 -1
- wok_code-2.0.4/wok_code/tests/__license_mgnt.py +0 -248
- wok_code-2.0.4/wok_code/tests/wok_code_test_02.py +0 -50
- {wok_code-2.0.4 → wok_code-2.0.6}/setup.cfg +0 -0
- {wok_code-2.0.4 → wok_code-2.0.6}/wok_code/__main__.py +0 -0
- {wok_code-2.0.4 → wok_code-2.0.6}/wok_code/cvt_script.man +0 -0
- {wok_code-2.0.4 → wok_code-2.0.6}/wok_code/do_set_utf8.py +0 -0
- {wok_code-2.0.4 → wok_code-2.0.6}/wok_code/eval_gtin.py +0 -0
- {wok_code-2.0.4 → wok_code-2.0.6}/wok_code/rm_dir_with_space.py +0 -0
- {wok_code-2.0.4 → wok_code-2.0.6}/wok_code/scripts/dist_pkg.py +0 -0
- {wok_code-2.0.4 → wok_code-2.0.6}/wok_code/tests/test_filepo.py +0 -0
- {wok_code-2.0.4 → wok_code-2.0.6}/wok_code/to_oca.2p8 +0 -0
- {wok_code-2.0.4 → wok_code-2.0.6}/wok_code/to_pep8.2p8 +0 -0
- {wok_code-2.0.4 → wok_code-2.0.6}/wok_code/to_zero.2p8 +0 -0
- {wok_code-2.0.4 → wok_code-2.0.6}/wok_code.egg-info/dependency_links.txt +0 -0
- {wok_code-2.0.4 → wok_code-2.0.6}/wok_code.egg-info/not-zip-safe +0 -0
- {wok_code-2.0.4 → wok_code-2.0.6}/wok_code.egg-info/top_level.txt +0 -0
|
@@ -1,28 +1,13 @@
|
|
|
1
|
-
Metadata-Version: 1
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
2
|
Name: wok_code
|
|
3
|
-
Version: 2.0.
|
|
3
|
+
Version: 2.0.6
|
|
4
4
|
Summary: Python developers tools
|
|
5
5
|
Home-page: https://zeroincombenze-tools.readthedocs.io
|
|
6
6
|
Author: Antonio Maria Vigliotti
|
|
7
7
|
Author-email: antoniomaria.vigliotti@gmail.com
|
|
8
8
|
License: Affero GPL
|
|
9
|
-
Project-URL: Source, https://github.com/zeroincombenze/tools
|
|
10
9
|
Project-URL: Documentation, https://zeroincombenze-tools.readthedocs.io
|
|
11
|
-
|
|
12
|
-
Various tools at your fingertips.
|
|
13
|
-
|
|
14
|
-
The available tools are:
|
|
15
|
-
|
|
16
|
-
* cvt_csv_2_rst.py: convert csv file into rst file
|
|
17
|
-
* cvt_csv_2_xml.py: convert csv file into xml file
|
|
18
|
-
* cvt_script: parse bash script and convert to meet company standard
|
|
19
|
-
* gen_readme.py: generate documentation files, mainly README.rst
|
|
20
|
-
* odoo_dependency.py: show odoo dependencies and/or Odoo module tree
|
|
21
|
-
* odoo_translation.py: manage Odoo translation
|
|
22
|
-
* pep8: parse source .py file to meet pep8 and convert across Odoo versions
|
|
23
|
-
* please: developer shell
|
|
24
|
-
* wget_odoo_repositories.py: get repository names from github.com
|
|
25
|
-
|
|
10
|
+
Project-URL: Source, https://github.com/zeroincombenze/tools
|
|
26
11
|
Keywords: linux travis development
|
|
27
12
|
Platform: UNKNOWN
|
|
28
13
|
Classifier: Development Status :: 4 - Beta
|
|
@@ -37,3 +22,20 @@ Classifier: Intended Audience :: Developers
|
|
|
37
22
|
Classifier: Topic :: Software Development
|
|
38
23
|
Classifier: Topic :: Software Development :: Build Tools
|
|
39
24
|
Classifier: Operating System :: OS Independent
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
Various tools at your fingertips.
|
|
28
|
+
|
|
29
|
+
The available tools are:
|
|
30
|
+
|
|
31
|
+
* cvt_csv_2_rst.py: convert csv file into rst file
|
|
32
|
+
* cvt_csv_2_xml.py: convert csv file into xml file
|
|
33
|
+
* cvt_script: parse bash script and convert to meet company standard
|
|
34
|
+
* gen_readme.py: generate documentation files, mainly README.rst
|
|
35
|
+
* odoo_dependency.py: show odoo dependencies and/or Odoo module tree
|
|
36
|
+
* odoo_translation.py: manage Odoo translation
|
|
37
|
+
* pep8: parse source .py file to meet pep8 and convert across Odoo versions
|
|
38
|
+
* please: developer shell
|
|
39
|
+
* wget_odoo_repositories.py: get repository names from github.com
|
|
40
|
+
|
|
41
|
+
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
==============
|
|
3
|
-
wok_code 2.0.
|
|
3
|
+
wok_code 2.0.6
|
|
4
4
|
==============
|
|
5
5
|
|
|
6
6
|
|
|
@@ -372,7 +372,7 @@ Examples:
|
|
|
372
372
|
::
|
|
373
373
|
|
|
374
374
|
# Update Odoo module documentation
|
|
375
|
-
cd ~/odoo_12/
|
|
375
|
+
cd ~/odoo_12/l10n-italy/l10n_it_balance # Odoo project directory
|
|
376
376
|
dir egg-info
|
|
377
377
|
>>> authors.txt contributors.txt description.rst __init__.txt known_issues.rst
|
|
378
378
|
gen_readme.py # Generate README.rst of project
|
|
@@ -845,12 +845,26 @@ Current development version
|
|
|
845
845
|
History
|
|
846
846
|
-------
|
|
847
847
|
|
|
848
|
-
2.0.
|
|
848
|
+
2.0.6 (2023-02-23)
|
|
849
849
|
~~~~~~~~~~~~~~~~~~
|
|
850
850
|
|
|
851
|
+
* [IMP] ssh.py: -m -s switches accept path with user and host
|
|
852
|
+
* [IMP] deploy_odoo: new property status to display
|
|
853
|
+
* [IMP] deploy_odoo: new switches -l and -x
|
|
854
|
+
* [NEW] do_git_checkout_new_branch.py
|
|
855
|
+
* [IMP] do_migrate.py: new features
|
|
856
|
+
* [IMP] run_odoo_debug.sh imported from odoo_score
|
|
857
|
+
* [FIX] run_odoo_debug.sh: ODOO_COMMIT TEST not set when build template
|
|
858
|
+
* [IMP] run_odoo_debug.sh: simulate server_wide_modules parameter for Odoo 7.0-
|
|
859
|
+
|
|
860
|
+
|
|
861
|
+
2.0.5 (2023-01-13)
|
|
862
|
+
~~~~~~~~~~~~~~~~~~
|
|
863
|
+
|
|
864
|
+
* [IMP] please: wep now delete old travis-emulator logs
|
|
851
865
|
* [IMP] install_python_3_from_source.sh: now can install python 3.9
|
|
852
866
|
* [IMP] please: action docs, minor improvements
|
|
853
|
-
* [IMP]
|
|
867
|
+
* [IMP] deploy_odoo: format output list
|
|
854
868
|
|
|
855
869
|
2.0.4 (2022-12-09)
|
|
856
870
|
~~~~~~~~~~~~~~~~~~
|
|
@@ -913,11 +927,6 @@ History
|
|
|
913
927
|
|
|
914
928
|
* [FIX] please test: with debug
|
|
915
929
|
|
|
916
|
-
2.0.0 (2022-08-10)
|
|
917
|
-
~~~~~~~~~~~~~~~~~~
|
|
918
|
-
|
|
919
|
-
* [REF] Refactoring
|
|
920
|
-
|
|
921
930
|
|
|
922
931
|
|
|
923
932
|
|
|
|
@@ -936,13 +945,16 @@ Contributors
|
|
|
936
945
|
------------
|
|
937
946
|
|
|
938
947
|
* Antonio Maria Vigliotti <antoniomaria.vigliotti@gmail.com>
|
|
948
|
+
Contributors
|
|
949
|
+
------------
|
|
950
|
+
|
|
939
951
|
|
|
940
952
|
|
|
941
953
|
|
|
|
942
954
|
|
|
943
955
|
This module is part of tools project.
|
|
944
956
|
|
|
945
|
-
Last Update / Ultimo aggiornamento: 2023-
|
|
957
|
+
Last Update / Ultimo aggiornamento: 2023-04-23
|
|
946
958
|
|
|
947
959
|
.. |Maturity| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
|
|
948
960
|
:target: https://odoo-community.org/page/development-status
|
|
@@ -12,7 +12,7 @@ else:
|
|
|
12
12
|
|
|
13
13
|
setup(
|
|
14
14
|
name='wok_code',
|
|
15
|
-
version='2.0.
|
|
15
|
+
version='2.0.6',
|
|
16
16
|
description='Python developers tools',
|
|
17
17
|
long_description="""
|
|
18
18
|
Various tools at your fingertips.
|
|
@@ -59,6 +59,7 @@ The available tools are:
|
|
|
59
59
|
'scripts/setup.info',
|
|
60
60
|
'scripts/dist_pkg.sh',
|
|
61
61
|
'scripts/please.sh',
|
|
62
|
+
'scripts/config/*',
|
|
62
63
|
'./please.man',
|
|
63
64
|
'./cvt_script',
|
|
64
65
|
'./cvt_script.man',
|
|
@@ -67,6 +68,7 @@ The available tools are:
|
|
|
67
68
|
'./to_zero.2p8',
|
|
68
69
|
'./to_pep8.2p8',
|
|
69
70
|
'./pypi.sh',
|
|
71
|
+
'./install_python_3_from_source.sh',
|
|
70
72
|
]
|
|
71
73
|
},
|
|
72
74
|
entry_points={
|
|
@@ -86,6 +88,7 @@ The available tools are:
|
|
|
86
88
|
'please = wok_code.scripts.please:main',
|
|
87
89
|
'to_pep8.py = wok_code.scripts.to_pep8:main',
|
|
88
90
|
'wget_odoo_repositories.py = wok_code.scripts.wget_odoo_repositories:main',
|
|
91
|
+
'run_odoo_debug = odoo_score.scripts.run_odoo_debug:main',
|
|
89
92
|
]
|
|
90
93
|
},
|
|
91
94
|
zip_safe=False,
|
|
@@ -29,8 +29,6 @@ done
|
|
|
29
29
|
[[ -z "$Z0LIBDIR" ]] && echo "Library file z0librc not found in <$PYPATH>!" && exit 72
|
|
30
30
|
[[ $TRAVIS_DEBUG_MODE -ge 8 ]] && echo "Z0LIBDIR=$Z0LIBDIR"
|
|
31
31
|
|
|
32
|
-
# DIST_CONF=$(findpkg ".z0tools.conf" "$PYPATH")
|
|
33
|
-
# TCONF="$HOME/.z0tools.conf"
|
|
34
32
|
CFG_init "ALL"
|
|
35
33
|
link_cfg_def
|
|
36
34
|
link_cfg $DIST_CONF $TCONF
|
|
@@ -40,7 +38,7 @@ RED="\e[1;31m"
|
|
|
40
38
|
GREEN="\e[1;32m"
|
|
41
39
|
CLR="\e[0m"
|
|
42
40
|
|
|
43
|
-
__version__=2.0.
|
|
41
|
+
__version__=2.0.6
|
|
44
42
|
|
|
45
43
|
#//Only human upgradable code/
|
|
46
44
|
# blk1 => z0librc
|
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
#!/usr/bin/env python
|
|
2
|
+
# -*- coding: utf-8 -*-
|
|
3
|
+
from __future__ import print_function, unicode_literals
|
|
4
|
+
|
|
5
|
+
import re
|
|
6
|
+
import sys
|
|
7
|
+
import os
|
|
8
|
+
import argparse
|
|
9
|
+
|
|
10
|
+
from z0lib import z0lib
|
|
11
|
+
|
|
12
|
+
__version__ = "2.0.6"
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class RepoCheckout(object):
|
|
16
|
+
|
|
17
|
+
def __init__(self, opt_args):
|
|
18
|
+
self.opt_args = opt_args
|
|
19
|
+
if opt_args.odoo_branch not in ("16.0", "15.0", "14.0", "13.0", "12.0", "11.0",
|
|
20
|
+
"10,0", "9.0", "8.0", "7.0", "6.1"):
|
|
21
|
+
print("Invalid Odoo branch")
|
|
22
|
+
exit(2)
|
|
23
|
+
if (
|
|
24
|
+
not opt_args.oca_path
|
|
25
|
+
or not os.path.isdir(os.path.expanduser(opt_args.oca_path))
|
|
26
|
+
):
|
|
27
|
+
print("Missed OCA path: use -o PATH!")
|
|
28
|
+
exit(2)
|
|
29
|
+
self.opt_args.oca_path = os.path.expanduser(opt_args.oca_path)
|
|
30
|
+
if not opt_args.target_path:
|
|
31
|
+
print("Missed target path: use -p PATH!")
|
|
32
|
+
exit(2)
|
|
33
|
+
self.opt_args.target_path = os.path.expanduser(opt_args.target_path)
|
|
34
|
+
if not opt_args.git_org:
|
|
35
|
+
print("Missed git organization: use -G ORG!")
|
|
36
|
+
exit(2)
|
|
37
|
+
self.opt_args.use_git = True
|
|
38
|
+
if opt_args.git_org == "zero":
|
|
39
|
+
self.opt_args.git_org = "zeroincombenze"
|
|
40
|
+
self.git_url, self.git_org = self.get_git_org_n_url(opt_args.git_org)
|
|
41
|
+
|
|
42
|
+
def get_git_org_n_url(self, git_org):
|
|
43
|
+
git_org = git_org or "oca"
|
|
44
|
+
if git_org.startswith("https:") or git_org.startswith("http:"):
|
|
45
|
+
git_url = git_org
|
|
46
|
+
item = git_org.split(":", 1)[1]
|
|
47
|
+
if item.endswith(".git"):
|
|
48
|
+
git_org = os.path.basename(os.path.dirname(item))
|
|
49
|
+
else:
|
|
50
|
+
git_org = os.path.basename(item)
|
|
51
|
+
if git_org == "OCA":
|
|
52
|
+
git_org = "oca"
|
|
53
|
+
else:
|
|
54
|
+
if git_org == "zero":
|
|
55
|
+
git_org = "zeroincombenze"
|
|
56
|
+
elif git_org == "librerp" and self.opt_args.odoo_branch == "12.0":
|
|
57
|
+
git_org = "LibrERP-network"
|
|
58
|
+
elif git_org == "librerp" and self.opt_args.odoo_branch == "6.0":
|
|
59
|
+
git_org = "iw3hxn"
|
|
60
|
+
if self.opt_args.use_git:
|
|
61
|
+
git_url = "git@github.com:%s" % git_org
|
|
62
|
+
elif git_org == "oca":
|
|
63
|
+
git_url = "https://github.com/%s" % git_org.upper()
|
|
64
|
+
else:
|
|
65
|
+
git_url = "https://github.com/%s" % git_org
|
|
66
|
+
return git_url, git_org
|
|
67
|
+
|
|
68
|
+
def is_git_repo(self, path):
|
|
69
|
+
return os.path.isdir(os.path.join(path, ".git"))
|
|
70
|
+
|
|
71
|
+
def build_new_repo(self, repo, oca_path):
|
|
72
|
+
target_path = self.opt_args.target_path if repo == "OCB" else os.path.join(
|
|
73
|
+
self.opt_args.target_path, repo)
|
|
74
|
+
if os.path.isdir(target_path):
|
|
75
|
+
if not self.opt_args.update:
|
|
76
|
+
print("Path %s already exists!" % target_path)
|
|
77
|
+
return 1
|
|
78
|
+
else:
|
|
79
|
+
z0lib.run_traced("cd %s" % os.path.dirname(target_path),
|
|
80
|
+
verbose=self.opt_args.verbose,
|
|
81
|
+
dry_run=self.opt_args.dry_run)
|
|
82
|
+
git_repo = self.git_url + "/" + repo
|
|
83
|
+
if repo == "OCB":
|
|
84
|
+
z0lib.run_traced(
|
|
85
|
+
("git clone %s %s --depth=1 --no-single-branch "
|
|
86
|
+
"--no-recurse-submodules")
|
|
87
|
+
% (git_repo, os.path.basename(target_path)),
|
|
88
|
+
verbose=self.opt_args.verbose,
|
|
89
|
+
dry_run=self.opt_args.dry_run)
|
|
90
|
+
else:
|
|
91
|
+
z0lib.run_traced("git clone %s --depth=1 --no-single-branch" % git_repo,
|
|
92
|
+
verbose=self.opt_args.verbose,
|
|
93
|
+
dry_run=self.opt_args.dry_run)
|
|
94
|
+
if not os.path.isdir(target_path):
|
|
95
|
+
print("Directory %s not created" % target_path)
|
|
96
|
+
return 0
|
|
97
|
+
z0lib.run_traced("cd %s" % target_path,
|
|
98
|
+
verbose=self.opt_args.verbose,
|
|
99
|
+
dry_run=self.opt_args.dry_run)
|
|
100
|
+
z0lib.run_traced("git checkout -b %s" % self.opt_args.odoo_branch,
|
|
101
|
+
verbose=self.opt_args.verbose,
|
|
102
|
+
dry_run=self.opt_args.dry_run)
|
|
103
|
+
sts, stdout, stderr = z0lib.run_traced("git branch",
|
|
104
|
+
verbose=self.opt_args.verbose,
|
|
105
|
+
dry_run=self.opt_args.dry_run)
|
|
106
|
+
for ln in stdout.split("\n"):
|
|
107
|
+
if not ln or ln.startswith("*"):
|
|
108
|
+
continue
|
|
109
|
+
z0lib.run_traced("git branch -D %s" % ln.strip(),
|
|
110
|
+
verbose=self.opt_args.verbose,
|
|
111
|
+
dry_run=self.opt_args.dry_run)
|
|
112
|
+
if repo == "OCB":
|
|
113
|
+
for p in os.listdir(oca_path):
|
|
114
|
+
if (
|
|
115
|
+
p.startswith(".")
|
|
116
|
+
or p.startswith("_")
|
|
117
|
+
or os.path.isdir(os.path.join(oca_path, p, ".git"))
|
|
118
|
+
):
|
|
119
|
+
continue
|
|
120
|
+
src = os.path.join(oca_path, p)
|
|
121
|
+
if os.path.isfile(src):
|
|
122
|
+
z0lib.run_traced("cp %s %s" % (src, target_path),
|
|
123
|
+
verbose=self.opt_args.verbose,
|
|
124
|
+
dry_run=self.opt_args.dry_run)
|
|
125
|
+
else:
|
|
126
|
+
z0lib.run_traced("rsync -avzC --delete --exclude \".*/\" %s/ %s/"
|
|
127
|
+
% (src, os.path.join(target_path, p)),
|
|
128
|
+
verbose=self.opt_args.verbose,
|
|
129
|
+
dry_run=self.opt_args.dry_run)
|
|
130
|
+
else:
|
|
131
|
+
z0lib.run_traced("rsync -avzC --delete --exclude \".*/\" %s/ %s/"
|
|
132
|
+
% (oca_path, target_path),
|
|
133
|
+
verbose=self.opt_args.verbose,
|
|
134
|
+
dry_run=self.opt_args.dry_run)
|
|
135
|
+
for p in os.listdir(target_path):
|
|
136
|
+
if (
|
|
137
|
+
p.startswith(".")
|
|
138
|
+
or p.startswith("_")
|
|
139
|
+
or p in ("egg-info", "readme")
|
|
140
|
+
or os.path.isdir(os.path.join(oca_path, p, ".git"))
|
|
141
|
+
):
|
|
142
|
+
continue
|
|
143
|
+
src = os.path.join(target_path, p)
|
|
144
|
+
if not os.path.exists(os.path.join(oca_path, p)):
|
|
145
|
+
if os.path.isfile(src):
|
|
146
|
+
z0lib.run_traced("rm -f %s" % src,
|
|
147
|
+
verbose=self.opt_args.verbose,
|
|
148
|
+
dry_run=self.opt_args.dry_run)
|
|
149
|
+
else:
|
|
150
|
+
z0lib.run_traced("rm -fR %s" % src,
|
|
151
|
+
verbose=self.opt_args.verbose,
|
|
152
|
+
dry_run=self.opt_args.dry_run)
|
|
153
|
+
z0lib.run_traced("cd %s" % oca_path,
|
|
154
|
+
verbose=self.opt_args.verbose,
|
|
155
|
+
dry_run=self.opt_args.dry_run)
|
|
156
|
+
sts, stdout, stderr = z0lib.run_traced("git remote -v",
|
|
157
|
+
verbose=self.opt_args.verbose,
|
|
158
|
+
dry_run=self.opt_args.dry_run)
|
|
159
|
+
if sts == 0 and stdout:
|
|
160
|
+
url = ""
|
|
161
|
+
for ln in stdout.split("\n"):
|
|
162
|
+
lns = ln.split()
|
|
163
|
+
if lns[0] == "origin":
|
|
164
|
+
url = lns[1]
|
|
165
|
+
break
|
|
166
|
+
if url:
|
|
167
|
+
if os.getcwd() != target_path:
|
|
168
|
+
z0lib.run_traced("cd %s" % target_path,
|
|
169
|
+
verbose=self.opt_args.verbose,
|
|
170
|
+
dry_run=self.opt_args.dry_run)
|
|
171
|
+
z0lib.run_traced("git remote add oca %s" % url,
|
|
172
|
+
verbose=self.opt_args.verbose,
|
|
173
|
+
dry_run=self.opt_args.dry_run)
|
|
174
|
+
if sts == 0 and self.opt_args.save_git:
|
|
175
|
+
if os.getcwd() != target_path:
|
|
176
|
+
z0lib.run_traced("cd %s" % target_path,
|
|
177
|
+
verbose=self.opt_args.verbose,
|
|
178
|
+
dry_run=self.opt_args.dry_run)
|
|
179
|
+
found = False
|
|
180
|
+
sts, stdout, stderr = z0lib.run_traced("git branch")
|
|
181
|
+
if sts == 0 and stdout:
|
|
182
|
+
regex = r"^[*]* +" + self.opt_args.odoo_branch + r" *$"
|
|
183
|
+
for ln in stdout.split("\n"):
|
|
184
|
+
if re.match(regex, ln):
|
|
185
|
+
found = True
|
|
186
|
+
break
|
|
187
|
+
if found and self.opt_args.remove_remote_branch:
|
|
188
|
+
z0lib.run_traced("git push origin delete %s"
|
|
189
|
+
% self.opt_args.odoo_branch,
|
|
190
|
+
verbose=self.opt_args.verbose,
|
|
191
|
+
dry_run=self.opt_args.dry_run)
|
|
192
|
+
found = False
|
|
193
|
+
z0lib.run_traced("git add ./",
|
|
194
|
+
verbose=self.opt_args.verbose,
|
|
195
|
+
dry_run=self.opt_args.dry_run)
|
|
196
|
+
z0lib.run_traced("git commit --no-verify -m \"[NEW] Initial setup %s\""
|
|
197
|
+
% self.opt_args.odoo_branch,
|
|
198
|
+
verbose=self.opt_args.verbose,
|
|
199
|
+
dry_run=self.opt_args.dry_run)
|
|
200
|
+
if found:
|
|
201
|
+
z0lib.run_traced("git push",
|
|
202
|
+
verbose=self.opt_args.verbose,
|
|
203
|
+
dry_run=self.opt_args.dry_run)
|
|
204
|
+
else:
|
|
205
|
+
z0lib.run_traced("git push --set-upstream origin %s"
|
|
206
|
+
% self.opt_args.odoo_branch,
|
|
207
|
+
verbose=self.opt_args.verbose,
|
|
208
|
+
dry_run=self.opt_args.dry_run)
|
|
209
|
+
return 0
|
|
210
|
+
|
|
211
|
+
def git_checkout(self):
|
|
212
|
+
path = self.opt_args.oca_path
|
|
213
|
+
if self.is_git_repo(path):
|
|
214
|
+
sts = self.build_new_repo("OCB", path)
|
|
215
|
+
if sts == 0:
|
|
216
|
+
for repo in sorted(os.listdir(self.opt_args.oca_path)):
|
|
217
|
+
path = os.path.join(self.opt_args.oca_path, repo)
|
|
218
|
+
if self.is_git_repo(path):
|
|
219
|
+
sts = self.build_new_repo(repo, path)
|
|
220
|
+
if sts:
|
|
221
|
+
break
|
|
222
|
+
return sts
|
|
223
|
+
|
|
224
|
+
|
|
225
|
+
def main(cli_args=None):
|
|
226
|
+
cli_args = cli_args or sys.argv[1:]
|
|
227
|
+
parser = argparse.ArgumentParser(
|
|
228
|
+
description="Create new repo branch",
|
|
229
|
+
epilog="© 2022-2023 by SHS-AV s.r.l."
|
|
230
|
+
)
|
|
231
|
+
parser.add_argument("-b", "--odoo-branch",
|
|
232
|
+
dest="odoo_branch",
|
|
233
|
+
help="New Odoo branch")
|
|
234
|
+
parser.add_argument("-G", "--git-org",
|
|
235
|
+
help="Git organization")
|
|
236
|
+
parser.add_argument("-n", "--dry-run", action="store_true")
|
|
237
|
+
parser.add_argument("-o", "--oca-path",
|
|
238
|
+
help="Local directory")
|
|
239
|
+
parser.add_argument("-p", "--target-path",
|
|
240
|
+
help="Local directory")
|
|
241
|
+
parser.add_argument("-R", "--remove-remote-branch", action="store_true")
|
|
242
|
+
parser.add_argument("-S", "--save-git", action="store_true")
|
|
243
|
+
parser.add_argument("-U", "--update", action="store_true")
|
|
244
|
+
parser.add_argument("-v", "--verbose", action="count", default=0)
|
|
245
|
+
parser.add_argument("-V", "--version", action="version", version=__version__)
|
|
246
|
+
opt_args = parser.parse_args(cli_args)
|
|
247
|
+
repo = RepoCheckout(opt_args)
|
|
248
|
+
return repo.git_checkout()
|
|
249
|
+
|
|
250
|
+
|
|
251
|
+
if __name__ == "__main__":
|
|
252
|
+
exit(main(None))
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
[[ ! $1 =~ ^(3.6|3.7|3.8|3.9) ]] && echo "$0 3.6|3.7|3.8|3.9" && exit 1
|
|
3
|
+
[[ $EUID -ne 0 ]] && echo "This code may be executed just by root user" && exit 1
|
|
4
|
+
[[ -z $(which wget 2>/dev/null) ]] && echo "Please install wget" && exit 1
|
|
5
|
+
pyver="$1"
|
|
6
|
+
[[ $1 == "3.9" ]] && pyver="$1.15"
|
|
7
|
+
[[ $1 == "3.8" ]] && pyver="$1.15"
|
|
8
|
+
[[ $1 == "3.7" ]] && pyver="$1.15"
|
|
9
|
+
[[ $1 == "3.6" ]] && pyver="$1.15"
|
|
10
|
+
echo "If you want to use sqlite you should install some packages before this command"
|
|
11
|
+
echo "apt install libssl-dev libncurses5-dev libsqlite3-dev libreadline-dev libtk8.6 libgdm-dev libdb4o-cil-dev libpcap-dev"
|
|
12
|
+
read -p "Press RET to continue ..."
|
|
13
|
+
echo "\$ cd /tmp"
|
|
14
|
+
cd /tmp
|
|
15
|
+
echo "\$ wget https://www.python.org/ftp/python/$pyver/Python-$pyver.tgz"
|
|
16
|
+
[[ ! -f Python-$pyver.tgz ]] && echo "File Python-$pyver.tgz already downloaded"
|
|
17
|
+
[[ ! -f Python-$pyver.tgz ]] && wget https://www.python.org/ftp/python/$pyver/Python-$pyver.tgz
|
|
18
|
+
[[ ! -f Python-$pyver.tgz ]] && echo "No file Python-$pyver.tgz downloaded!" && exit 2
|
|
19
|
+
echo "\$ tar -xf Python-$pyver.tgz"
|
|
20
|
+
tar -xf Python-$pyver.tgz
|
|
21
|
+
[[ ! -d Python-$pyver ]] && echo "No directory Python-$pyver created!" && exit 2
|
|
22
|
+
echo "\$ cd python-$pyver"
|
|
23
|
+
cd Python-$pyver
|
|
24
|
+
echo "\$ ./configure --enable-optimizations"
|
|
25
|
+
./configure --enable-optimizations
|
|
26
|
+
echo "\$ make altinstall"
|
|
27
|
+
make altinstall
|
|
28
|
+
echo ""
|
|
29
|
+
echo ""
|
|
30
|
+
py=$(echo $pyver | grep -Eo "[0-9]+\.[0-9]+" | head -n1)
|
|
31
|
+
python$py --version
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
#!/usr/bin/env python
|
|
2
|
+
import sys
|
|
3
|
+
import os
|
|
4
|
+
import re
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
def fmt_line(user, dbtype):
|
|
8
|
+
if dbtype == "local":
|
|
9
|
+
return "local\tall\t\t%s\t\t\t\t\ttrust" % user
|
|
10
|
+
elif dbtype == "ipv4":
|
|
11
|
+
return "host\tall\t\t%s\t\t127.0.0.1/32\t\ttrust" % user
|
|
12
|
+
elif dbtype == "ipv6":
|
|
13
|
+
return "host\tall\t\t%s\t\t::1/128\t\t\ttrust" % user
|
|
14
|
+
return "###### INVALID LINE"
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def do_conf_pg(ffn):
|
|
18
|
+
found_tag = False
|
|
19
|
+
done = False
|
|
20
|
+
target = []
|
|
21
|
+
# import pdb; pdb.set_trace()
|
|
22
|
+
with open(ffn, 'r') as fd:
|
|
23
|
+
lines = fd.read().split('\n')
|
|
24
|
+
for nro, line in enumerate(lines):
|
|
25
|
+
if re.match(r"^[\s]*local[\s]*all[\s]*postgres", line):
|
|
26
|
+
found_tag = True
|
|
27
|
+
elif found_tag and re.match(r"^[\s]*local[\s]*all[\s]", line):
|
|
28
|
+
if not done:
|
|
29
|
+
for role in ("odoo", "oca"):
|
|
30
|
+
for version in (
|
|
31
|
+
"",
|
|
32
|
+
"6",
|
|
33
|
+
"7",
|
|
34
|
+
"8",
|
|
35
|
+
"9",
|
|
36
|
+
"10",
|
|
37
|
+
"11",
|
|
38
|
+
"12",
|
|
39
|
+
"13",
|
|
40
|
+
"14",
|
|
41
|
+
"15",
|
|
42
|
+
"16",
|
|
43
|
+
"_www",
|
|
44
|
+
):
|
|
45
|
+
if role == "oca" and version in ("", "6"):
|
|
46
|
+
continue
|
|
47
|
+
target.append(fmt_line("%s%s" % (role, version), "local"))
|
|
48
|
+
target.append(fmt_line("%s%s" % (role, version), "ipv4"))
|
|
49
|
+
target.append(fmt_line("%s%s" % (role, version), "ipv6"))
|
|
50
|
+
target.append(fmt_line("weblate", "local"))
|
|
51
|
+
target.append(fmt_line("weblate", "ipv4"))
|
|
52
|
+
target.append(fmt_line("weblate", "ipv6"))
|
|
53
|
+
target.append(fmt_line("kalamitica", "local"))
|
|
54
|
+
target.append(fmt_line("kalamitica", "ipv4"))
|
|
55
|
+
target.append(fmt_line("kalamitica", "ipv6"))
|
|
56
|
+
done = True
|
|
57
|
+
continue
|
|
58
|
+
target.append(line)
|
|
59
|
+
|
|
60
|
+
if found_tag:
|
|
61
|
+
bakfile = '%s.bak' % ffn
|
|
62
|
+
if os.path.isfile(bakfile):
|
|
63
|
+
os.remove(bakfile)
|
|
64
|
+
if os.path.isfile(ffn):
|
|
65
|
+
os.rename(ffn, bakfile)
|
|
66
|
+
with open(ffn, 'w') as fd:
|
|
67
|
+
fd.write("\n".join(target))
|
|
68
|
+
print(ffn)
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
def main(argv):
|
|
72
|
+
argv = argv or sys.argv[1:]
|
|
73
|
+
path = None
|
|
74
|
+
for param in argv:
|
|
75
|
+
if param.startswith('-'):
|
|
76
|
+
pass
|
|
77
|
+
else:
|
|
78
|
+
path = os.path.expanduser(param)
|
|
79
|
+
if not path:
|
|
80
|
+
print('No path supplied! Use %s PATH' % sys.argv[0])
|
|
81
|
+
return 1
|
|
82
|
+
if os.path.isdir(path):
|
|
83
|
+
print('Supplied path is not a file')
|
|
84
|
+
return 1
|
|
85
|
+
elif os.path.isfile(path):
|
|
86
|
+
do_conf_pg(path)
|
|
87
|
+
else:
|
|
88
|
+
print('Path %s does not exist!' % sys.argv[0])
|
|
89
|
+
return 2
|
|
90
|
+
return 0
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
if __name__ == "__main__":
|
|
94
|
+
exit(main(None))
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
.\" Contact antoniomaria.vigliotti@gmail.com to correct errors or typos.
|
|
3
3
|
.TH please 8
|
|
4
4
|
.SH NAME
|
|
5
|
-
please \-
|
|
5
|
+
please \- developer shell
|
|
6
6
|
.SH SYNOPSIS
|
|
7
7
|
please [options] action [package]
|
|
8
8
|
.SH DESCRIPTION
|
|
@@ -12,8 +12,6 @@ Action is one of:
|
|
|
12
12
|
.br
|
|
13
13
|
* help
|
|
14
14
|
.br
|
|
15
|
-
* build
|
|
16
|
-
.br
|
|
17
15
|
* chkconfig
|
|
18
16
|
.br
|
|
19
17
|
* commit (deprecated)
|
|
@@ -32,6 +30,8 @@ Action is one of:
|
|
|
32
30
|
.br
|
|
33
31
|
* import
|
|
34
32
|
.br
|
|
33
|
+
* install
|
|
34
|
+
.br
|
|
35
35
|
* list
|
|
36
36
|
.br
|
|
37
37
|
* lsearch
|
|
@@ -59,14 +59,8 @@ Action is one of:
|
|
|
59
59
|
* version
|
|
60
60
|
.br
|
|
61
61
|
* wep
|
|
62
|
-
.P
|
|
63
|
-
\fBbuild\fR
|
|
64
|
-
.RS
|
|
65
|
-
Build a tar file for current PYPI project
|
|
66
62
|
.br
|
|
67
|
-
|
|
68
|
-
Look at \fBplease status\fR to see projects tree.
|
|
69
|
-
.RE
|
|
63
|
+
* z0bug
|
|
70
64
|
.P
|
|
71
65
|
\fBchkconfig\fR
|
|
72
66
|
.RS
|
|
@@ -139,6 +133,12 @@ Import po file of Odoo project.
|
|
|
139
133
|
To declare target version use \fB-b\fR switch
|
|
140
134
|
.RE
|
|
141
135
|
.P
|
|
136
|
+
\fBinstall MODULE\fR
|
|
137
|
+
.RS
|
|
138
|
+
Install some components (currently just python3)
|
|
139
|
+
.br
|
|
140
|
+
.RE
|
|
141
|
+
.P
|
|
142
142
|
\fBlist\fR
|
|
143
143
|
.RS
|
|
144
144
|
List host where to push project.
|
|
@@ -287,6 +287,15 @@ In order to access to database a configuratione file must be supplied with \fB-c
|
|
|
287
287
|
.br
|
|
288
288
|
To declare target version use \fB-b\fR switch
|
|
289
289
|
.RE
|
|
290
|
+
.P
|
|
291
|
+
\fBz0bug\fR
|
|
292
|
+
.RS
|
|
293
|
+
Execute lint and tests.
|
|
294
|
+
.br
|
|
295
|
+
This command executes the lint and the regression tests.
|
|
296
|
+
In previous version of please this command were called travis;
|
|
297
|
+
travis is now deprecated
|
|
298
|
+
.RE
|
|
290
299
|
.SH OPTIONS
|
|
291
300
|
.TP
|
|
292
301
|
.BR \-L \fIfilename\fR
|