wok-code 2.0.8__tar.gz → 2.0.9__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 (76) hide show
  1. {wok_code-2.0.8 → wok_code-2.0.9}/PKG-INFO +1 -1
  2. {wok_code-2.0.8 → wok_code-2.0.9}/README.rst +8 -115
  3. {wok_code-2.0.8 → wok_code-2.0.9}/setup.py +3 -2
  4. {wok_code-2.0.8 → wok_code-2.0.9}/wok_code/__init__.py +1 -0
  5. {wok_code-2.0.8 → wok_code-2.0.9}/wok_code/__main__.py +0 -0
  6. {wok_code-2.0.8 → wok_code-2.0.9}/wok_code/cvt_csv_2_xml.py +1 -1
  7. {wok_code-2.0.8 → wok_code-2.0.9}/wok_code/cvt_script +1 -1
  8. {wok_code-2.0.8 → wok_code-2.0.9}/wok_code/do_git_checkout_new_branch.py +182 -115
  9. {wok_code-2.0.8 → wok_code-2.0.9}/wok_code/do_gitignore.py +31 -31
  10. {wok_code-2.0.8 → wok_code-2.0.9}/wok_code/do_set_utf8.py +18 -14
  11. {wok_code-2.0.8 → wok_code-2.0.9}/wok_code/gen_addons_table.py +2 -3
  12. {wok_code-2.0.8 → wok_code-2.0.9}/wok_code/pgconf.py +9 -8
  13. {wok_code-2.0.8 → wok_code-2.0.9}/wok_code/pypi.sh +1 -1
  14. {wok_code-2.0.8 → wok_code-2.0.9}/wok_code/rm_dir_with_space.py +2 -1
  15. {wok_code-2.0.8 → wok_code-2.0.9}/wok_code/scripts/__init__.py +5 -2
  16. wok_code-2.0.8/wok_code/scripts/do_migrate.py → wok_code-2.0.9/wok_code/scripts/arcangelo.py +299 -257
  17. {wok_code-2.0.8 → wok_code-2.0.9}/wok_code/scripts/config/globals.yml +12 -2
  18. wok_code-2.0.9/wok_code/scripts/config/to_pypi_future.yml +6 -0
  19. wok_code-2.0.9/wok_code/scripts/config/to_pypi_py2.yml +6 -0
  20. wok_code-2.0.9/wok_code/scripts/config/to_pypi_py3.yml +6 -0
  21. {wok_code-2.0.8 → wok_code-2.0.9}/wok_code/scripts/cvt_csv_2_rst.py +1 -1
  22. {wok_code-2.0.8 → wok_code-2.0.9}/wok_code/scripts/cvt_csv_coa.py +23 -17
  23. {wok_code-2.0.8 → wok_code-2.0.9}/wok_code/scripts/deploy_odoo.py +68 -49
  24. {wok_code-2.0.8 → wok_code-2.0.9}/wok_code/scripts/dist_pkg.py +8 -8
  25. {wok_code-2.0.8 → wok_code-2.0.9}/wok_code/scripts/dist_pkg.sh +2 -2
  26. {wok_code-2.0.8 → wok_code-2.0.9}/wok_code/scripts/do_odoo_site.py +14 -14
  27. {wok_code-2.0.8 → wok_code-2.0.9}/wok_code/scripts/gen_readme.py +31 -18
  28. {wok_code-2.0.8 → wok_code-2.0.9}/wok_code/scripts/generate_random_codes.py +7 -7
  29. {wok_code-2.0.8 → wok_code-2.0.9}/wok_code/scripts/license_mgnt.py +86 -86
  30. {wok_code-2.0.8 → wok_code-2.0.9}/wok_code/scripts/lint_2_compare.py +133 -96
  31. {wok_code-2.0.8 → wok_code-2.0.9}/wok_code/scripts/main.py +4 -3
  32. {wok_code-2.0.8 → wok_code-2.0.9}/wok_code/scripts/makepo_it.py +8 -5
  33. {wok_code-2.0.8 → wok_code-2.0.9}/wok_code/scripts/odoo_dependencies.py +16 -5
  34. {wok_code-2.0.8 → wok_code-2.0.9}/wok_code/scripts/odoo_translation.py +248 -189
  35. {wok_code-2.0.8 → wok_code-2.0.9}/wok_code/scripts/odoo_translation_old.py +29 -14
  36. wok_code-2.0.9/wok_code/scripts/please.py +726 -0
  37. {wok_code-2.0.8 → wok_code-2.0.9}/wok_code/scripts/please.sh +24 -4
  38. {wok_code-2.0.8 → wok_code-2.0.9}/wok_code/scripts/please_apache.py +48 -43
  39. wok_code-2.0.9/wok_code/scripts/please_cwd.py +375 -0
  40. wok_code-2.0.9/wok_code/scripts/please_python.py +106 -0
  41. wok_code-2.0.9/wok_code/scripts/please_z0bug.py +239 -0
  42. {wok_code-2.0.8 → wok_code-2.0.9}/wok_code/scripts/run_odoo_debug.py +8 -8
  43. {wok_code-2.0.8 → wok_code-2.0.9}/wok_code/scripts/run_odoo_debug.sh +23 -17
  44. {wok_code-2.0.8 → wok_code-2.0.9}/wok_code/scripts/setup.info +2 -2
  45. {wok_code-2.0.8 → wok_code-2.0.9}/wok_code/scripts/to_pep8.py +1 -1
  46. wok_code-2.0.9/wok_code/scripts/wget_odoo_repositories.py +716 -0
  47. {wok_code-2.0.8 → wok_code-2.0.9}/wok_code/ssh.py +52 -49
  48. {wok_code-2.0.8 → wok_code-2.0.9}/wok_code/tests/test_filepo.py +0 -0
  49. {wok_code-2.0.8 → wok_code-2.0.9}/wok_code/tests/test_gen_readme.py +31 -30
  50. {wok_code-2.0.8 → wok_code-2.0.9}/wok_code/tests/test_license_mgnt.py +32 -32
  51. wok_code-2.0.9/wok_code/tests/test_please.py +440 -0
  52. {wok_code-2.0.8 → wok_code-2.0.9}/wok_code/topep8 +1 -1
  53. {wok_code-2.0.8 → wok_code-2.0.9}/wok_code.egg-info/PKG-INFO +1 -1
  54. {wok_code-2.0.8 → wok_code-2.0.9}/wok_code.egg-info/SOURCES.txt +6 -1
  55. {wok_code-2.0.8 → wok_code-2.0.9}/wok_code.egg-info/entry_points.txt +1 -1
  56. wok_code-2.0.8/wok_code/scripts/please.py +0 -649
  57. wok_code-2.0.8/wok_code/scripts/please_z0bug.py +0 -163
  58. wok_code-2.0.8/wok_code/scripts/wget_odoo_repositories.py +0 -714
  59. wok_code-2.0.8/wok_code/tests/test_please.py +0 -81
  60. {wok_code-2.0.8 → wok_code-2.0.9}/setup.cfg +0 -0
  61. {wok_code-2.0.8 → wok_code-2.0.9}/wok_code/cvt_script.man +0 -0
  62. {wok_code-2.0.8 → wok_code-2.0.9}/wok_code/eval_gtin.py +0 -0
  63. {wok_code-2.0.8 → wok_code-2.0.9}/wok_code/install_python_3_from_source.sh +0 -0
  64. {wok_code-2.0.8 → wok_code-2.0.9}/wok_code/please.man +0 -0
  65. {wok_code-2.0.8 → wok_code-2.0.9}/wok_code/scripts/config/globals_xml.yml +0 -0
  66. {wok_code-2.0.8 → wok_code-2.0.9}/wok_code/scripts/config/to_new_api.yml +0 -0
  67. {wok_code-2.0.8 → wok_code-2.0.9}/wok_code/scripts/config/to_odoo_py2.yml +0 -0
  68. {wok_code-2.0.8 → wok_code-2.0.9}/wok_code/scripts/config/to_odoo_py3.yml +0 -0
  69. {wok_code-2.0.8 → wok_code-2.0.9}/wok_code/scripts/config/to_old_api.yml +0 -0
  70. {wok_code-2.0.8 → wok_code-2.0.9}/wok_code/to_oca.2p8 +0 -0
  71. {wok_code-2.0.8 → wok_code-2.0.9}/wok_code/to_pep8.2p8 +0 -0
  72. {wok_code-2.0.8 → wok_code-2.0.9}/wok_code/to_zero.2p8 +0 -0
  73. {wok_code-2.0.8 → wok_code-2.0.9}/wok_code.egg-info/dependency_links.txt +0 -0
  74. {wok_code-2.0.8 → wok_code-2.0.9}/wok_code.egg-info/not-zip-safe +0 -0
  75. {wok_code-2.0.8 → wok_code-2.0.9}/wok_code.egg-info/requires.txt +0 -0
  76. {wok_code-2.0.8 → wok_code-2.0.9}/wok_code.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 1.2
2
2
  Name: wok_code
3
- Version: 2.0.8
3
+ Version: 2.0.9
4
4
  Summary: Python developers tools
5
5
  Home-page: https://zeroincombenze-tools.readthedocs.io
6
6
  Author: Antonio Maria Vigliotti
@@ -1,7 +1,7 @@
1
1
 
2
- ======
3
- 2.0.8
4
- ======
2
+ ==============
3
+ wok_code 2.0.9
4
+ ==============
5
5
 
6
6
 
7
7
 
@@ -13,22 +13,6 @@
13
13
  Overview
14
14
  ========
15
15
 
16
- Development tools
17
- -----------------
18
-
19
- Various tools at your fingertips.
20
-
21
- The available tools are:
22
-
23
- * cvt_csv_2_rst.py: convert csv file into rst file
24
- * cvt_csv_2_xml.py: convert csv file into xml file
25
- * cvt_script: parse bash script and convert to meet company standard
26
- * gen_readme.py: generate documentation files, mainly README.rst
27
- * odoo_dependency.py: show odoo dependencies and/or Odoo module tree
28
- * odoo_translation.py: manage Odoo translation
29
- * pep8: parse source .py file to meet pep8 and convert across Odoo versions
30
- * please: developer shell
31
- * wget_odoo_repositories.py: get repository names from github.com
32
16
 
33
17
 
34
18
  please: developer shell
@@ -315,8 +299,6 @@ It is an helper to meet z0bug_odoo LINT_LEVEL requirements.
315
299
  Usage
316
300
  =====
317
301
 
318
- Module usage
319
- ------------
320
302
 
321
303
 
322
304
 
@@ -825,98 +807,6 @@ Current version via Git
825
807
  source $HOME/devel/activate_tools
826
808
 
827
809
 
828
- History
829
- -------
830
-
831
- 2.0.8 (2023-05-09)
832
- ~~~~~~~~~~~~~~~~~~
833
-
834
- * [FIX] Install run_odoo_debug
835
- * [FIX] Install do_git_ignore
836
- * [IMP] lint_2_compare: ignore odoo/openerp test string and LICENSE files
837
- * [IMP] lint_2_compare: new switch ---purge do not load identical files (quick diff)
838
-
839
- 2.0.7 (2023-05-08)
840
- ~~~~~~~~~~~~~~~~~~
841
-
842
- * [IMP] deply_odoo: new action git-push
843
- * [REF] odoo_translation: new implementation
844
- * [FIX] run_odoo_debug: minor fixes
845
- * [NEW] do_git_checkout_new_branch: new command
846
- * [IMP] install_python3_from_source: improvements
847
- * [FIX] ssh.py: scp with port not 22
848
-
849
- 2.0.6 (2023-02-23)
850
- ~~~~~~~~~~~~~~~~~~
851
-
852
- * [IMP] ssh.py: -m -s switches accept path with user and host
853
- * [IMP] deploy_odoo: new property status to display
854
- * [IMP] deploy_odoo: new switches -l and -x
855
- * [NEW] do_git_checkout_new_branch.py
856
- * [IMP] do_migrate.py: new features
857
- * [IMP] run_odoo_debug.sh imported from odoo_score
858
- * [FIX] run_odoo_debug.sh: ODOO_COMMIT TEST not set when build template
859
- * [IMP] run_odoo_debug.sh: simulate server_wide_modules parameter for Odoo 7.0-
860
-
861
-
862
- 2.0.5 (2023-01-13)
863
- ~~~~~~~~~~~~~~~~~~
864
-
865
- * [IMP] please: wep now delete old travis-emulator logs
866
- * [IMP] install_python_3_from_source.sh: now can install python 3.9
867
- * [IMP] please: action docs, minor improvements
868
- * [IMP] deploy_odoo: format output list
869
-
870
- 2.0.4 (2022-12-09)
871
- ~~~~~~~~~~~~~~~~~~
872
-
873
- * [FIX] deploy_odoo: update from path
874
- * [FIX] build_cmd: best recognition of python version
875
- * [FIX] set_python_version.sh: best recognition of python version
876
-
877
- 2.0.3 (2022-11-22)
878
- ~~~~~~~~~~~~~~~~~~
879
-
880
- * [REF] odoo_translation
881
-
882
- 2.0.2.1 (2022-10-31)
883
- ~~~~~~~~~~~~~~~~~~~~
884
-
885
- * [IMP] lint_2_compare: ignoring .git .idea egg-info and setup directories
886
- * [IMP] lint_2_compare: new ignore switches
887
- * [FIX] please translate: do not execute export
888
-
889
- 2.0.2 (2022-10-20)
890
- ~~~~~~~~~~~~~~~~~~
891
-
892
- * [IMP] Clearing code
893
-
894
- 2.0.1 (2022-10-12)
895
- ~~~~~~~~~~~~~~~~~~
896
-
897
- * [IMP] minor improvements
898
-
899
- 2.0.1 (2022-10-12)
900
- ~~~~~~~~~~~~~~~~~~
901
-
902
- * [IMP] stable version
903
-
904
- 2.0.0.4 (2022-10-05)
905
- ~~~~~~~~~~~~~~~~~~~~
906
-
907
- * [IMP] New lint_2_compare command
908
- * [IMP] odoo_dependecies.py: minor upgrade
909
-
910
- 2.0.0.3 (2022-09-14)
911
- ~~~~~~~~~~~~~~~~~~~~
912
-
913
- * [FIX] deploy_odoo: show actual branch and organization
914
- * [FIX] deploy_odoo: update read from directory
915
- * [IMP] deploy_odoo: new command list repo info
916
- * [IMP] deploy_odoo: new feature link to repositories
917
-
918
-
919
-
920
810
  |
921
811
  |
922
812
 
@@ -933,13 +823,16 @@ Contributors
933
823
  ------------
934
824
 
935
825
  * Antonio Maria Vigliotti <antoniomaria.vigliotti@gmail.com>
826
+ Contributors
827
+ ------------
828
+
936
829
 
937
830
 
938
831
  |
939
832
 
940
- This module is part of project.
833
+ This module is part of tools project.
941
834
 
942
- Last Update / Ultimo aggiornamento:
835
+ Last Update / Ultimo aggiornamento: 2023-05-21
943
836
 
944
837
  .. |Maturity| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
945
838
  :target: https://odoo-community.org/page/development-status
@@ -1,3 +1,4 @@
1
+ # -*- coding: utf-8 -*-
1
2
  import sys
2
3
  from setuptools import find_packages, setup
3
4
 
@@ -12,7 +13,7 @@ else:
12
13
 
13
14
  setup(
14
15
  name='wok_code',
15
- version='2.0.8',
16
+ version='2.0.9',
16
17
  description='Python developers tools',
17
18
  long_description="""
18
19
  Various tools at your fingertips.
@@ -81,7 +82,7 @@ The available tools are:
81
82
  'dist_pkg = wok_code.scripts.dist_pkg:main',
82
83
  'do_gitignore = wok_code.do_gitignore:main',
83
84
  'do_git_checkout_new_branch = wok_code.do_git_checkout_new_branch:main',
84
- 'do_migrate = wok_code.scripts.do_migrate:main',
85
+ 'arcangelo = wok_code.scripts.arcangelo:main',
85
86
  'do_odoo_site.py = wok_code.scripts.do_odoo_site:main',
86
87
  'gen_readme.py = wok_code.scripts.gen_readme:main',
87
88
  'lint_2_compare = wok_code.scripts.lint_2_compare:main',
@@ -1,3 +1,4 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  from . import scripts
3
+
3
4
  # from scripts import license_mgnt
File without changes
@@ -44,7 +44,7 @@ except ImportError:
44
44
  import z0lib
45
45
 
46
46
 
47
- __version__ = "2.0.8"
47
+ __version__ = "2.0.9"
48
48
 
49
49
  msg_time = time.time()
50
50
 
@@ -38,7 +38,7 @@ RED="\e[1;31m"
38
38
  GREEN="\e[1;32m"
39
39
  CLR="\e[0m"
40
40
 
41
- __version__=2.0.8
41
+ __version__=2.0.9
42
42
 
43
43
  #//Only human upgradable code/
44
44
  # blk1 => z0librc
@@ -9,20 +9,29 @@ import argparse
9
9
 
10
10
  from z0lib import z0lib
11
11
 
12
- __version__ = "2.0.8"
12
+ __version__ = "2.0.9"
13
13
 
14
14
 
15
15
  class RepoCheckout(object):
16
-
17
16
  def __init__(self, opt_args):
18
17
  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"):
18
+ if opt_args.odoo_branch not in (
19
+ "16.0",
20
+ "15.0",
21
+ "14.0",
22
+ "13.0",
23
+ "12.0",
24
+ "11.0",
25
+ "10,0",
26
+ "9.0",
27
+ "8.0",
28
+ "7.0",
29
+ "6.1",
30
+ ):
21
31
  print("Invalid Odoo branch")
22
32
  exit(2)
23
- if (
24
- not opt_args.origin_path
25
- or not os.path.isdir(os.path.expanduser(opt_args.origin_path))
33
+ if not opt_args.origin_path or not os.path.isdir(
34
+ os.path.expanduser(opt_args.origin_path)
26
35
  ):
27
36
  print("Missed origin path: use --origin-path=PATH!")
28
37
  exit(2)
@@ -72,60 +81,83 @@ class RepoCheckout(object):
72
81
  def build_new_repo(self, repo, origin_path):
73
82
  def git_clone(repo, target_path):
74
83
  if os.getcwd() != target_path:
75
- z0lib.run_traced("cd %s" % os.path.dirname(target_path),
76
- verbose=self.opt_args.verbose,
77
- dry_run=self.opt_args.dry_run)
84
+ z0lib.run_traced(
85
+ "cd %s" % os.path.dirname(target_path),
86
+ verbose=self.opt_args.verbose,
87
+ dry_run=self.opt_args.dry_run,
88
+ )
78
89
  git_repo = self.git_url + "/" + repo
79
90
  if repo == "OCB":
80
91
  z0lib.run_traced(
81
- ("git clone %s %s --depth=1 --no-single-branch "
82
- "--no-recurse-submodules")
92
+ (
93
+ "git clone %s %s --depth=1 --no-single-branch "
94
+ "--no-recurse-submodules"
95
+ )
83
96
  % (git_repo, os.path.basename(target_path)),
84
97
  verbose=self.opt_args.verbose,
85
- dry_run=self.opt_args.dry_run)
98
+ dry_run=self.opt_args.dry_run,
99
+ )
86
100
  else:
87
- z0lib.run_traced("git clone %s --depth=1 --no-single-branch" % git_repo,
88
- verbose=self.opt_args.verbose,
89
- dry_run=self.opt_args.dry_run)
101
+ z0lib.run_traced(
102
+ "git clone %s --depth=1 --no-single-branch" % git_repo,
103
+ verbose=self.opt_args.verbose,
104
+ dry_run=self.opt_args.dry_run,
105
+ )
90
106
 
91
107
  def git_checkout(target_path):
92
108
  if os.getcwd() != target_path:
93
- z0lib.run_traced("cd %s" % target_path,
94
- verbose=self.opt_args.verbose,
95
- dry_run=self.opt_args.dry_run)
96
- z0lib.run_traced("git checkout -b %s" % self.opt_args.odoo_branch,
97
- verbose=self.opt_args.verbose,
98
- dry_run=self.opt_args.dry_run)
109
+ z0lib.run_traced(
110
+ "cd %s" % target_path,
111
+ verbose=self.opt_args.verbose,
112
+ dry_run=self.opt_args.dry_run,
113
+ )
114
+ z0lib.run_traced(
115
+ "git checkout -b %s" % self.opt_args.odoo_branch,
116
+ verbose=self.opt_args.verbose,
117
+ dry_run=self.opt_args.dry_run,
118
+ )
99
119
 
100
120
  def git_delete_unrelated_branch(target_path):
101
121
  if os.getcwd() != target_path:
102
- z0lib.run_traced("cd %s" % target_path,
103
- verbose=self.opt_args.verbose,
104
- dry_run=self.opt_args.dry_run)
105
- sts, stdout, stderr = z0lib.run_traced("git branch",
106
- verbose=self.opt_args.verbose,
107
- dry_run=self.opt_args.dry_run)
122
+ z0lib.run_traced(
123
+ "cd %s" % target_path,
124
+ verbose=self.opt_args.verbose,
125
+ dry_run=self.opt_args.dry_run,
126
+ )
127
+ sts, stdout, stderr = z0lib.run_traced(
128
+ "git branch",
129
+ verbose=self.opt_args.verbose,
130
+ dry_run=self.opt_args.dry_run,
131
+ )
108
132
  for ln in stdout.split("\n"):
109
133
  if not ln or ln.startswith("*"):
110
134
  continue
111
- z0lib.run_traced("git branch -D %s" % ln.strip(),
112
- verbose=self.opt_args.verbose,
113
- dry_run=self.opt_args.dry_run)
135
+ z0lib.run_traced(
136
+ "git branch -D %s" % ln.strip(),
137
+ verbose=self.opt_args.verbose,
138
+ dry_run=self.opt_args.dry_run,
139
+ )
114
140
 
115
141
  def git_add_all(target_path):
116
142
  if os.getcwd() != target_path:
117
- z0lib.run_traced("cd %s" % target_path,
118
- verbose=self.opt_args.verbose,
119
- dry_run=self.opt_args.dry_run)
120
- z0lib.run_traced("git add ./",
121
- verbose=self.opt_args.verbose,
122
- dry_run=self.opt_args.dry_run)
143
+ z0lib.run_traced(
144
+ "cd %s" % target_path,
145
+ verbose=self.opt_args.verbose,
146
+ dry_run=self.opt_args.dry_run,
147
+ )
148
+ z0lib.run_traced(
149
+ "git add ./",
150
+ verbose=self.opt_args.verbose,
151
+ dry_run=self.opt_args.dry_run,
152
+ )
123
153
 
124
154
  def git_push(target_path):
125
155
  if os.getcwd() != target_path:
126
- z0lib.run_traced("cd %s" % target_path,
127
- verbose=self.opt_args.verbose,
128
- dry_run=self.opt_args.dry_run)
156
+ z0lib.run_traced(
157
+ "cd %s" % target_path,
158
+ verbose=self.opt_args.verbose,
159
+ dry_run=self.opt_args.dry_run,
160
+ )
129
161
  found = False
130
162
  sts, stdout, stderr = z0lib.run_traced("git branch")
131
163
  if sts == 0 and stdout:
@@ -135,24 +167,30 @@ class RepoCheckout(object):
135
167
  found = True
136
168
  break
137
169
  if found and self.opt_args.remove_unrelated_branch:
138
- z0lib.run_traced("git push origin delete %s"
139
- % self.opt_args.odoo_branch,
140
- verbose=self.opt_args.verbose,
141
- dry_run=self.opt_args.dry_run)
170
+ z0lib.run_traced(
171
+ "git push origin delete %s" % self.opt_args.odoo_branch,
172
+ verbose=self.opt_args.verbose,
173
+ dry_run=self.opt_args.dry_run,
174
+ )
142
175
  found = False
143
- z0lib.run_traced("git commit --no-verify -m \"[NEW] Initial setup %s\""
144
- % self.opt_args.odoo_branch,
145
- verbose=self.opt_args.verbose,
146
- dry_run=self.opt_args.dry_run)
176
+ z0lib.run_traced(
177
+ "git commit --no-verify -m \"[NEW] Initial setup %s\""
178
+ % self.opt_args.odoo_branch,
179
+ verbose=self.opt_args.verbose,
180
+ dry_run=self.opt_args.dry_run,
181
+ )
147
182
  if found:
148
- z0lib.run_traced("git push",
149
- verbose=self.opt_args.verbose,
150
- dry_run=self.opt_args.dry_run)
183
+ z0lib.run_traced(
184
+ "git push",
185
+ verbose=self.opt_args.verbose,
186
+ dry_run=self.opt_args.dry_run,
187
+ )
151
188
  else:
152
- z0lib.run_traced("git push --set-upstream origin %s"
153
- % self.opt_args.odoo_branch,
154
- verbose=self.opt_args.verbose,
155
- dry_run=self.opt_args.dry_run)
189
+ z0lib.run_traced(
190
+ "git push --set-upstream origin %s" % self.opt_args.odoo_branch,
191
+ verbose=self.opt_args.verbose,
192
+ dry_run=self.opt_args.dry_run,
193
+ )
156
194
 
157
195
  def rsync_origin_path(repo, origin_path, target_path):
158
196
  exclude_path = self.opt_args.exclude_path.split(",")
@@ -170,20 +208,25 @@ class RepoCheckout(object):
170
208
  continue
171
209
  src = os.path.join(origin_path, p)
172
210
  if os.path.isfile(src):
173
- z0lib.run_traced("cp %s %s" % (src, target_path),
174
- verbose=self.opt_args.verbose,
175
- dry_run=self.opt_args.dry_run)
211
+ z0lib.run_traced(
212
+ "cp %s %s" % (src, target_path),
213
+ verbose=self.opt_args.verbose,
214
+ dry_run=self.opt_args.dry_run,
215
+ )
176
216
  else:
177
217
  z0lib.run_traced(
178
218
  "rsync -avz --delete %s %s/ %s/"
179
219
  % (exclude_opt, src, os.path.join(target_path, p)),
180
220
  verbose=self.opt_args.verbose,
181
- dry_run=self.opt_args.dry_run)
221
+ dry_run=self.opt_args.dry_run,
222
+ )
182
223
  else:
183
- z0lib.run_traced("rsync -avz --delete %s %s/ %s/"
184
- % (exclude_opt, origin_path, target_path),
185
- verbose=self.opt_args.verbose,
186
- dry_run=self.opt_args.dry_run)
224
+ z0lib.run_traced(
225
+ "rsync -avz --delete %s %s/ %s/"
226
+ % (exclude_opt, origin_path, target_path),
227
+ verbose=self.opt_args.verbose,
228
+ dry_run=self.opt_args.dry_run,
229
+ )
187
230
  for p in os.listdir(target_path):
188
231
  if (
189
232
  p.startswith(".")
@@ -195,24 +238,34 @@ class RepoCheckout(object):
195
238
  src = os.path.join(target_path, p)
196
239
  if not os.path.exists(os.path.join(origin_path, p)):
197
240
  if os.path.isfile(src):
198
- z0lib.run_traced("rm -f %s" % src,
199
- verbose=self.opt_args.verbose,
200
- dry_run=self.opt_args.dry_run)
241
+ z0lib.run_traced(
242
+ "rm -f %s" % src,
243
+ verbose=self.opt_args.verbose,
244
+ dry_run=self.opt_args.dry_run,
245
+ )
201
246
  else:
202
- z0lib.run_traced("rm -fR %s" % src,
203
- verbose=self.opt_args.verbose,
204
- dry_run=self.opt_args.dry_run)
247
+ z0lib.run_traced(
248
+ "rm -fR %s" % src,
249
+ verbose=self.opt_args.verbose,
250
+ dry_run=self.opt_args.dry_run,
251
+ )
205
252
  if repo == "OCB":
206
- z0lib.run_traced("do_gitignore ./",
207
- verbose=self.opt_args.verbose,
208
- dry_run=self.opt_args.dry_run)
253
+ z0lib.run_traced(
254
+ "do_gitignore ./",
255
+ verbose=self.opt_args.verbose,
256
+ dry_run=self.opt_args.dry_run,
257
+ )
209
258
  if os.getcwd() != origin_path:
210
- z0lib.run_traced("cd %s" % origin_path,
211
- verbose=self.opt_args.verbose,
212
- dry_run=self.opt_args.dry_run)
213
- sts, stdout, stderr = z0lib.run_traced("git remote -v",
214
- verbose=self.opt_args.verbose,
215
- dry_run=self.opt_args.dry_run)
259
+ z0lib.run_traced(
260
+ "cd %s" % origin_path,
261
+ verbose=self.opt_args.verbose,
262
+ dry_run=self.opt_args.dry_run,
263
+ )
264
+ sts, stdout, stderr = z0lib.run_traced(
265
+ "git remote -v",
266
+ verbose=self.opt_args.verbose,
267
+ dry_run=self.opt_args.dry_run,
268
+ )
216
269
  url = ""
217
270
  if sts == 0 and stdout:
218
271
  for ln in stdout.split("\n"):
@@ -224,9 +277,11 @@ class RepoCheckout(object):
224
277
  break
225
278
  if url:
226
279
  if os.getcwd() != target_path:
227
- z0lib.run_traced("cd %s" % target_path,
228
- verbose=self.opt_args.verbose,
229
- dry_run=self.opt_args.dry_run)
280
+ z0lib.run_traced(
281
+ "cd %s" % target_path,
282
+ verbose=self.opt_args.verbose,
283
+ dry_run=self.opt_args.dry_run,
284
+ )
230
285
  url_upstream = ""
231
286
  for ln in stdout.split("\n"):
232
287
  lns = ln.split()
@@ -236,15 +291,22 @@ class RepoCheckout(object):
236
291
  url_upstream = lns[1]
237
292
  break
238
293
  if url_upstream:
239
- z0lib.run_traced("git remote remove upstream",
240
- verbose=self.opt_args.verbose,
241
- dry_run=self.opt_args.dry_run)
242
- z0lib.run_traced("git remote add upstream %s" % url,
243
- verbose=self.opt_args.verbose,
244
- dry_run=self.opt_args.dry_run)
294
+ z0lib.run_traced(
295
+ "git remote remove upstream",
296
+ verbose=self.opt_args.verbose,
297
+ dry_run=self.opt_args.dry_run,
298
+ )
299
+ z0lib.run_traced(
300
+ "git remote add upstream %s" % url,
301
+ verbose=self.opt_args.verbose,
302
+ dry_run=self.opt_args.dry_run,
303
+ )
245
304
 
246
- target_path = self.opt_args.target_path if repo == "OCB" else os.path.join(
247
- self.opt_args.target_path, repo)
305
+ target_path = (
306
+ self.opt_args.target_path
307
+ if repo == "OCB"
308
+ else os.path.join(self.opt_args.target_path, repo)
309
+ )
248
310
  if os.path.isdir(target_path):
249
311
  if not self.opt_args.update:
250
312
  print("Path %s already exists!" % target_path)
@@ -258,9 +320,11 @@ class RepoCheckout(object):
258
320
  if self.opt_args.origin_path not in (".", "./"):
259
321
  rsync_origin_path(repo, origin_path, target_path)
260
322
  elif repo == "OCB":
261
- z0lib.run_traced("gitignore ./",
262
- verbose=self.opt_args.verbose,
263
- dry_run=self.opt_args.dry_run)
323
+ z0lib.run_traced(
324
+ "gitignore ./",
325
+ verbose=self.opt_args.verbose,
326
+ dry_run=self.opt_args.dry_run,
327
+ )
264
328
  git_add_all(target_path)
265
329
  if self.opt_args.save_git:
266
330
  git_push(target_path)
@@ -283,36 +347,39 @@ class RepoCheckout(object):
283
347
  def main(cli_args=None):
284
348
  cli_args = cli_args or sys.argv[1:]
285
349
  parser = argparse.ArgumentParser(
286
- description="Create new repo branch",
287
- epilog="© 2022-2023 by SHS-AV s.r.l."
350
+ description="Create new repo branch", epilog="© 2022-2023 by SHS-AV s.r.l."
351
+ )
352
+ parser.add_argument(
353
+ "-b", "--odoo-branch", dest="odoo_branch", help="New Odoo branch"
288
354
  )
289
- parser.add_argument("-b", "--odoo-branch",
290
- dest="odoo_branch",
291
- help="New Odoo branch")
292
- parser.add_argument("-G", "--git-org",
293
- help="Git organization to checkout")
355
+ parser.add_argument("-G", "--git-org", help="Git organization to checkout")
294
356
  parser.add_argument("-n", "--dry-run", action="store_true")
295
357
  parser.add_argument(
296
- "-o", "--origin-path",
297
- help="Local origin directory to merge or ./ if not origin (best is OCA path)")
298
- parser.add_argument("-p", "--target-path",
299
- help="Local directory for checkout")
358
+ "-o",
359
+ "--origin-path",
360
+ help="Local origin directory to merge or ./ if not origin (best is OCA path)",
361
+ )
362
+ parser.add_argument("-p", "--target-path", help="Local directory for checkout")
300
363
  parser.add_argument(
301
- "-R", "--remove-unrelated-branch",
364
+ "-R",
365
+ "--remove-unrelated-branch",
302
366
  help="Remove not required unrelated branch from local directory",
303
- action="store_true")
304
- parser.add_argument("-S", "--save-git",
305
- help="Execute git pull after checkout",
306
- action="store_true")
307
- parser.add_argument("-U",
308
- "--update",
309
- help="Update target directory if exists",
310
- action="store_true")
367
+ action="store_true",
368
+ )
369
+ parser.add_argument(
370
+ "-S", "--save-git", help="Execute git pull after checkout", action="store_true"
371
+ )
372
+ parser.add_argument(
373
+ "-U", "--update", help="Update target directory if exists", action="store_true"
374
+ )
311
375
  parser.add_argument("-v", "--verbose", action="count", default=0)
312
376
  parser.add_argument("-V", "--version", action="version", version=__version__)
313
- parser.add_argument("-x", "--exclude-path",
314
- help="Directories to exclude (comma separated)",
315
- default="setup,venv_odoo")
377
+ parser.add_argument(
378
+ "-x",
379
+ "--exclude-path",
380
+ help="Directories to exclude (comma separated)",
381
+ default="setup,venv_odoo",
382
+ )
316
383
  opt_args = parser.parse_args(cli_args)
317
384
  repo = RepoCheckout(opt_args)
318
385
  return repo.do_git_checkout()