wok-code 2.0.3__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.
Files changed (71) hide show
  1. {wok_code-2.0.3 → wok_code-2.0.6}/PKG-INFO +21 -18
  2. {wok_code-2.0.3 → wok_code-2.0.6}/README.rst +37 -11
  3. {wok_code-2.0.3 → wok_code-2.0.6}/setup.py +7 -2
  4. {wok_code-2.0.3 → wok_code-2.0.6}/wok_code/__init__.py +1 -0
  5. {wok_code-2.0.3 → wok_code-2.0.6}/wok_code/cvt_csv_2_xml.py +2 -2
  6. {wok_code-2.0.3 → wok_code-2.0.6}/wok_code/cvt_script +7 -9
  7. wok_code-2.0.6/wok_code/do_git_checkout_new_branch.py +252 -0
  8. {wok_code-2.0.3 → wok_code-2.0.6}/wok_code/do_gitignore.py +4 -3
  9. {wok_code-2.0.3 → wok_code-2.0.6}/wok_code/gen_addons_table.py +1 -1
  10. wok_code-2.0.6/wok_code/install_python_3_from_source.sh +31 -0
  11. wok_code-2.0.6/wok_code/pgconf.py +94 -0
  12. {wok_code-2.0.3 → wok_code-2.0.6}/wok_code/please.man +19 -10
  13. {wok_code-2.0.3 → wok_code-2.0.6}/wok_code/pypi.sh +4 -4
  14. {wok_code-2.0.3 → wok_code-2.0.6}/wok_code/scripts/__init__.py +3 -0
  15. wok_code-2.0.6/wok_code/scripts/config/globals.yml +29 -0
  16. wok_code-2.0.6/wok_code/scripts/config/globals_xml.yml +0 -0
  17. wok_code-2.0.6/wok_code/scripts/config/to_new_api.yml +54 -0
  18. wok_code-2.0.6/wok_code/scripts/config/to_odoo_py2.yml +14 -0
  19. wok_code-2.0.6/wok_code/scripts/config/to_odoo_py3.yml +14 -0
  20. wok_code-2.0.6/wok_code/scripts/config/to_old_api.yml +48 -0
  21. {wok_code-2.0.3 → wok_code-2.0.6}/wok_code/scripts/cvt_csv_2_rst.py +2 -2
  22. {wok_code-2.0.3 → wok_code-2.0.6}/wok_code/scripts/cvt_csv_coa.py +2 -2
  23. {wok_code-2.0.3 → wok_code-2.0.6}/wok_code/scripts/deploy_odoo.py +484 -226
  24. {wok_code-2.0.3 → wok_code-2.0.6}/wok_code/scripts/dist_pkg.py +0 -0
  25. {wok_code-2.0.3 → wok_code-2.0.6}/wok_code/scripts/dist_pkg.sh +3 -5
  26. wok_code-2.0.6/wok_code/scripts/do_migrate.py +759 -0
  27. {wok_code-2.0.3 → wok_code-2.0.6}/wok_code/scripts/do_odoo_site.py +32 -41
  28. {wok_code-2.0.3 → wok_code-2.0.6}/wok_code/scripts/gen_readme.py +9 -4
  29. {wok_code-2.0.3 → wok_code-2.0.6}/wok_code/scripts/generate_random_codes.py +2 -2
  30. {wok_code-2.0.3 → wok_code-2.0.6}/wok_code/scripts/license_mgnt.py +0 -0
  31. {wok_code-2.0.3 → wok_code-2.0.6}/wok_code/scripts/lint_2_compare.py +3 -3
  32. {wok_code-2.0.3 → wok_code-2.0.6}/wok_code/scripts/main.py +1 -1
  33. {wok_code-2.0.3 → wok_code-2.0.6}/wok_code/scripts/makepo_it.py +2 -2
  34. {wok_code-2.0.3 → wok_code-2.0.6}/wok_code/scripts/odoo_dependencies.py +2 -2
  35. {wok_code-2.0.3 → wok_code-2.0.6}/wok_code/scripts/odoo_translation.py +408 -191
  36. {wok_code-2.0.3 → wok_code-2.0.6}/wok_code/scripts/odoo_translation_old.py +2 -2
  37. wok_code-2.0.6/wok_code/scripts/please.py +649 -0
  38. {wok_code-2.0.3 → wok_code-2.0.6}/wok_code/scripts/please.sh +199 -781
  39. wok_code-2.0.6/wok_code/scripts/please_apache.py +208 -0
  40. wok_code-2.0.6/wok_code/scripts/please_z0bug.py +163 -0
  41. wok_code-2.0.6/wok_code/scripts/run_odoo_debug.py +35 -0
  42. {wok_code-2.0.3 → wok_code-2.0.6}/wok_code/scripts/setup.info +7 -2
  43. {wok_code-2.0.3 → wok_code-2.0.6}/wok_code/scripts/to_pep8.py +3 -3
  44. {wok_code-2.0.3 → wok_code-2.0.6}/wok_code/scripts/wget_odoo_repositories.py +5 -4
  45. {wok_code-2.0.3 → wok_code-2.0.6}/wok_code/ssh.py +34 -18
  46. wok_code-2.0.3/wok_code/tests/wok_code_test_01.py → wok_code-2.0.6/wok_code/tests/test_gen_readme.py +2 -2
  47. wok_code-2.0.3/wok_code/tests/devel_tools_test_01.py → wok_code-2.0.6/wok_code/tests/test_license_mgnt.py +9 -11
  48. wok_code-2.0.6/wok_code/tests/test_please.py +81 -0
  49. {wok_code-2.0.3 → wok_code-2.0.6}/wok_code/topep8 +4 -6
  50. {wok_code-2.0.3 → wok_code-2.0.6}/wok_code.egg-info/PKG-INFO +21 -18
  51. {wok_code-2.0.3 → wok_code-2.0.6}/wok_code.egg-info/SOURCES.txt +15 -5
  52. {wok_code-2.0.3 → wok_code-2.0.6}/wok_code.egg-info/entry_points.txt +1 -0
  53. {wok_code-2.0.3 → wok_code-2.0.6}/wok_code.egg-info/requires.txt +2 -1
  54. wok_code-2.0.3/wok_code/scripts/do_migrate.py +0 -184
  55. wok_code-2.0.3/wok_code/scripts/please.py +0 -79
  56. wok_code-2.0.3/wok_code/tests/__init__.py +0 -1
  57. wok_code-2.0.3/wok_code/tests/__license_mgnt.py +0 -248
  58. wok_code-2.0.3/wok_code/tests/wok_code_test_02.py +0 -50
  59. {wok_code-2.0.3 → wok_code-2.0.6}/setup.cfg +0 -0
  60. {wok_code-2.0.3 → wok_code-2.0.6}/wok_code/__main__.py +0 -0
  61. {wok_code-2.0.3 → wok_code-2.0.6}/wok_code/cvt_script.man +0 -0
  62. {wok_code-2.0.3 → wok_code-2.0.6}/wok_code/do_set_utf8.py +0 -0
  63. {wok_code-2.0.3 → wok_code-2.0.6}/wok_code/eval_gtin.py +0 -0
  64. {wok_code-2.0.3 → wok_code-2.0.6}/wok_code/rm_dir_with_space.py +0 -0
  65. {wok_code-2.0.3 → wok_code-2.0.6}/wok_code/tests/test_filepo.py +0 -0
  66. {wok_code-2.0.3 → wok_code-2.0.6}/wok_code/to_oca.2p8 +0 -0
  67. {wok_code-2.0.3 → wok_code-2.0.6}/wok_code/to_pep8.2p8 +0 -0
  68. {wok_code-2.0.3 → wok_code-2.0.6}/wok_code/to_zero.2p8 +0 -0
  69. {wok_code-2.0.3 → wok_code-2.0.6}/wok_code.egg-info/dependency_links.txt +0 -0
  70. {wok_code-2.0.3 → wok_code-2.0.6}/wok_code.egg-info/not-zip-safe +0 -0
  71. {wok_code-2.0.3 → wok_code-2.0.6}/wok_code.egg-info/top_level.txt +0 -0
@@ -1,28 +1,13 @@
1
- Metadata-Version: 1.2
1
+ Metadata-Version: 2.1
2
2
  Name: wok_code
3
- Version: 2.0.3
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
- Description:
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
@@ -32,7 +17,25 @@ Classifier: Programming Language :: Python :: 2.7
32
17
  Classifier: Programming Language :: Python :: 3.6
33
18
  Classifier: Programming Language :: Python :: 3.7
34
19
  Classifier: Programming Language :: Python :: 3.8
20
+ Classifier: Programming Language :: Python :: 3.9
35
21
  Classifier: Intended Audience :: Developers
36
22
  Classifier: Topic :: Software Development
37
23
  Classifier: Topic :: Software Development :: Build Tools
38
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
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/axitec/l10n_it_balance # Odoo project directory
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,10 +845,38 @@ Current development version
845
845
  History
846
846
  -------
847
847
 
848
- 2.0.2.2 (2022-11-22)
849
- ~~~~~~~~~~~~~~~~~~~~
848
+ 2.0.6 (2023-02-23)
849
+ ~~~~~~~~~~~~~~~~~~
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
865
+ * [IMP] install_python_3_from_source.sh: now can install python 3.9
866
+ * [IMP] please: action docs, minor improvements
867
+ * [IMP] deploy_odoo: format output list
868
+
869
+ 2.0.4 (2022-12-09)
870
+ ~~~~~~~~~~~~~~~~~~
850
871
 
851
- * [REF] odoo_transaltion
872
+ * [FIX] deploy_odoo: update from path
873
+ * [FIX] build_cmd: best recognition of python version
874
+ * [FIX] set_python_version.sh: best recognition of python version
875
+
876
+ 2.0.3 (2022-11-22)
877
+ ~~~~~~~~~~~~~~~~~~
878
+
879
+ * [REF] odoo_translation
852
880
 
853
881
  2.0.2.1 (2022-10-31)
854
882
  ~~~~~~~~~~~~~~~~~~~~
@@ -899,11 +927,6 @@ History
899
927
 
900
928
  * [FIX] please test: with debug
901
929
 
902
- 2.0.0 (2022-08-10)
903
- ~~~~~~~~~~~~~~~~~~
904
-
905
- * [REF] Refactoring
906
-
907
930
 
908
931
 
909
932
  |
@@ -922,13 +945,16 @@ Contributors
922
945
  ------------
923
946
 
924
947
  * Antonio Maria Vigliotti <antoniomaria.vigliotti@gmail.com>
948
+ Contributors
949
+ ------------
950
+
925
951
 
926
952
 
927
953
  |
928
954
 
929
955
  This module is part of tools project.
930
956
 
931
- Last Update / Ultimo aggiornamento: 2022-12-04
957
+ Last Update / Ultimo aggiornamento: 2023-04-23
932
958
 
933
959
  .. |Maturity| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
934
960
  :target: https://odoo-community.org/page/development-status
@@ -2,16 +2,17 @@ import sys
2
2
  from setuptools import find_packages, setup
3
3
 
4
4
  install_requires = [
5
- 'z0lib', 'future', 'Babel', 'lxml', 'openpyxl', 'pyyaml', 'translators'
5
+ 'z0lib', 'future', 'Babel', 'lxml', 'openpyxl', 'pyyaml', 'vatnumber'
6
6
  ]
7
7
  if sys.version_info >= (3, 0):
8
+ install_requires.append('translators')
8
9
  install_requires.append('twine')
9
10
  else:
10
11
  install_requires.append('twine==1.15.0')
11
12
 
12
13
  setup(
13
14
  name='wok_code',
14
- version='2.0.3',
15
+ version='2.0.6',
15
16
  description='Python developers tools',
16
17
  long_description="""
17
18
  Various tools at your fingertips.
@@ -36,6 +37,7 @@ The available tools are:
36
37
  'Programming Language :: Python :: 3.6',
37
38
  'Programming Language :: Python :: 3.7',
38
39
  'Programming Language :: Python :: 3.8',
40
+ 'Programming Language :: Python :: 3.9',
39
41
  'Intended Audience :: Developers',
40
42
  'Topic :: Software Development',
41
43
  'Topic :: Software Development :: Build Tools',
@@ -57,6 +59,7 @@ The available tools are:
57
59
  'scripts/setup.info',
58
60
  'scripts/dist_pkg.sh',
59
61
  'scripts/please.sh',
62
+ 'scripts/config/*',
60
63
  './please.man',
61
64
  './cvt_script',
62
65
  './cvt_script.man',
@@ -65,6 +68,7 @@ The available tools are:
65
68
  './to_zero.2p8',
66
69
  './to_pep8.2p8',
67
70
  './pypi.sh',
71
+ './install_python_3_from_source.sh',
68
72
  ]
69
73
  },
70
74
  entry_points={
@@ -84,6 +88,7 @@ The available tools are:
84
88
  'please = wok_code.scripts.please:main',
85
89
  'to_pep8.py = wok_code.scripts.to_pep8:main',
86
90
  'wget_odoo_repositories.py = wok_code.scripts.wget_odoo_repositories:main',
91
+ 'run_odoo_debug = odoo_score.scripts.run_odoo_debug:main',
87
92
  ]
88
93
  },
89
94
  zip_safe=False,
@@ -1,2 +1,3 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  from . import scripts
3
+ # from scripts import license_mgnt
@@ -44,7 +44,7 @@ except ImportError:
44
44
  import z0lib
45
45
 
46
46
 
47
- __version__ = "2.0.3"
47
+ __version__ = "2.0.6"
48
48
 
49
49
  msg_time = time.time()
50
50
 
@@ -162,7 +162,7 @@ def convert_file(ctx):
162
162
  if __name__ == "__main__":
163
163
  parser = z0lib.parseoptargs(
164
164
  "Convert csv file into xml file",
165
- "© 2018-2020 by SHS-AV s.r.l.",
165
+ "© 2018-2023 by SHS-AV s.r.l.",
166
166
  version=__version__,
167
167
  )
168
168
  parser.add_argument('-h')
@@ -5,7 +5,7 @@
5
5
  #
6
6
  # This free software is released under GNU Affero GPL3
7
7
  # author: Antonio Maria Vigliotti - antoniomaria.vigliotti@gmail.com
8
- # (C) 2016-22 by SHS-AV s.r.l. - http://www.shs-av.com - info@shs-av.com
8
+ # (C) 2016-23 by SHS-AV s.r.l. - http://www.shs-av.com - info@shs-av.com
9
9
  #
10
10
  READLINK=$(which greadlink 2>/dev/null) || READLINK=$(which readlink 2>/dev/null)
11
11
  export READLINK
@@ -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.3
41
+ __version__=2.0.6
44
42
 
45
43
  #//Only human upgradable code/
46
44
  # blk1 => z0librc
@@ -149,8 +147,8 @@ cvt_file() {
149
147
  while [[ "${line: -1}" == " " ]]; do line="${line:0:-1}"; done
150
148
  [[ susp -lt 0 && $line =~ $break_susp ]] && ((susp=-susp)) && break_susp=""
151
149
  [[ susp -gt 0 ]] && ((susp--)) && continue
152
- # line="${line/2021/2022}"
153
- # line="${line/-21/-22}"
150
+ # line="${line/2021/2023}"
151
+ # line="${line/-21/-23}"
154
152
  if [[ $prc -lt 10 && $line =~ ^__version__=.* ]]; then
155
153
  if [[ $opt_keep -ne 0 ]]; then
156
154
  line_ver="$line"
@@ -583,14 +581,14 @@ if [[ "$opt_version" ]]; then
583
581
  fi
584
582
  if [[ $opt_help -gt 0 ]]; then
585
583
  print_help "Update bash script" \
586
- "© 2016-22 by zeroincombenze®\nhttps://zeroincombenze-tools.readthedocs.io/\nAuthor: antoniomaria.vigliotti@gmail.com"
584
+ "© 2016-23 by zeroincombenze®\nhttps://zeroincombenze-tools.readthedocs.io/\nAuthor: antoniomaria.vigliotti@gmail.com"
587
585
  exit 0
588
586
  fi
589
587
 
590
588
  [[ $opt_verbose -gt 1 ]] && set -x
591
589
  declare -A COPY
592
- COPY[z0lib]="© 2015-22 by zeroincombenze®\nhttps://zeroincombenze-tools.readthedocs.io/\nAuthor: antoniomaria.vigliotti@gmail.com"
593
- COPY[travis_em]="© 2015-22 by zeroincombenze®\nhttps://zeroincombenze-tools.readthedocs.io/\nAuthor: antoniomaria.vigliotti@gmail.com"
590
+ COPY[z0lib]="© 2015-23 by zeroincombenze®\nhttps://zeroincombenze-tools.readthedocs.io/\nAuthor: antoniomaria.vigliotti@gmail.com"
591
+ COPY[travis_em]="© 2015-23 by zeroincombenze®\nhttps://zeroincombenze-tools.readthedocs.io/\nAuthor: antoniomaria.vigliotti@gmail.com"
594
592
  [[ -z "$opt_id" ]] && opt_id=$(basename $(dirname $(readlink -f $bashscript)))
595
593
  [[ $opt_id == "tests" ]] && opt_id=$(basename $(dirname $(dirname $(readlink -f $bashscript))))
596
594
  ToRepeat=
@@ -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))
@@ -30,8 +30,8 @@ def do_create_gitignore(path, submodules):
30
30
  break
31
31
  elif trig == "pypi":
32
32
  if (
33
- "/docs/_build/" not in line
34
- and ".egg-info/" not in line
33
+ # "/docs/_build/" not in line
34
+ ".egg-info/" not in line
35
35
  and os.path.join(*[path] + [x for x in line.split("/") if x])
36
36
  ):
37
37
  found = True
@@ -75,7 +75,8 @@ def main(argv):
75
75
  'coverage',
76
76
  'generic',
77
77
  'nardo_modules',
78
- 'venv_odoo'
78
+ 'venv_odoo',
79
+ 'website-themes',
79
80
  ):
80
81
  submodules.append('/%s' % fn)
81
82
  continue
@@ -33,7 +33,7 @@ standard_library.install_aliases() # noqa: E402
33
33
 
34
34
  MARKERS = r'(\[//\]: # \(addons\))|(\[//\]: # \(end addons\))'
35
35
  MANIFESTS = ('__openerp__.py', '__manifest__.py')
36
- __version__ = "2.0.3"
36
+ __version__ = "2.0.6"
37
37
 
38
38
 
39
39
  class UserError(Exception):
@@ -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