gOdoo-cli 0.3.3__py3-none-any.whl → 0.3.4__py3-none-any.whl

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.
godoo_cli/__init__.py CHANGED
@@ -1,2 +1,2 @@
1
- __version__ = "0.3.3"
1
+ __version__ = "0.3.4"
2
2
  from .cli import launch_cli
@@ -116,15 +116,14 @@ def launch_odoo(
116
116
  rpc_callback(ctx) # Add RPC Options using Defaults and Envvars
117
117
 
118
118
  if load_data_path:
119
- for p in load_data_path:
120
- LOGGER.info("Starting Data Importer Thread for: '%s'", str(p))
121
- loader_thread = threading.Thread(
122
- target=import_to_odoo,
123
- name="DataLoader",
124
- args=(ctx,),
125
- kwargs={"read_path": p.absolute()},
126
- )
127
- loader_thread.start()
119
+ LOGGER.info("Starting Data Importer Thread for: '%s'", ", ".join(map(str, load_data_path)))
120
+ loader_thread = threading.Thread(
121
+ target=import_to_odoo,
122
+ name="DataLoader",
123
+ args=(ctx,),
124
+ kwargs={"read_paths": load_data_path},
125
+ )
126
+ loader_thread.start()
128
127
 
129
128
  cmd_string = _launch_command(
130
129
  odoo_path=ctx.obj.odoo_main_path,
@@ -6,6 +6,7 @@ Places Systemparam to Track if import was already done.
6
6
 
7
7
  import logging
8
8
  from pathlib import Path
9
+ from typing import List
9
10
 
10
11
  import typer
11
12
  from godoo_rpc import import_data
@@ -21,7 +22,7 @@ LOGGER = logging.getLogger(__name__)
21
22
  @typer_unpacker
22
23
  def import_to_odoo(
23
24
  ctx: typer.Context,
24
- read_path: Path = typer.Argument(
25
+ read_paths: List[Path] = typer.Argument(
25
26
  ...,
26
27
  readable=True,
27
28
  exists=True,
@@ -53,18 +54,16 @@ def import_to_odoo(
53
54
  odoo_user=ctx.obj.odoo_rpc_user,
54
55
  odoo_password=ctx.obj.odoo_rpc_password,
55
56
  )
56
- if not read_path.exists():
57
- raise ValueError("Provided import Path: %s doesn't exist", read_path)
58
57
 
59
- if read_path.is_file():
60
- product_image_regex = ""
61
- file_regex = ""
58
+ if missing_paths := [p for p in read_paths if not p.exists()]:
59
+ raise ValueError("Provided import Paths: %s doesn't exist", ", ".join(missing_paths))
62
60
 
63
- import_data(
64
- odoo_api=odoo_api,
65
- read_path=read_path.absolute(),
66
- data_regex=file_regex,
67
- product_image_regex=product_image_regex,
68
- check_dataset_timestamp=check_data_timestamp,
69
- skip_existing_ids=skip_existing_ids,
70
- )
61
+ for path in read_paths:
62
+ import_data(
63
+ odoo_api=odoo_api,
64
+ read_path=path.absolute(),
65
+ data_regex=file_regex,
66
+ product_image_regex="" if path.is_file() else product_image_regex,
67
+ check_dataset_timestamp="" if path.is_file() else check_data_timestamp,
68
+ skip_existing_ids=skip_existing_ids,
69
+ )
godoo_cli/git/git_repo.py CHANGED
@@ -55,9 +55,12 @@ def git_pull_checkout_reset(
55
55
  pull : str, optional
56
56
  specific target to pull. Usually used in conjunction with branch.
57
57
  reset_hard : bool, optional
58
- will call reset --hard after checkout to ensure clean git repo, by default True
58
+ will call reset --hard before checkout to ensure clean git repo, by default True
59
59
  """
60
60
 
61
+ if reset_hard:
62
+ repo.git.reset("--hard", "HEAD")
63
+
61
64
  if pull:
62
65
  LOGGER.debug("Pulling Repo: %s, %s", repo.working_dir, pull)
63
66
  try:
@@ -78,8 +81,6 @@ def git_pull_checkout_reset(
78
81
  if branch:
79
82
  LOGGER.debug("Checking Out repo %s to Branch: %s", repo.git_dir, branch)
80
83
  repo.git.checkout(branch)
81
- if reset_hard:
82
- repo.git.reset("--hard")
83
84
 
84
85
 
85
86
  def git_ensure_ref(
@@ -120,7 +121,10 @@ def git_ensure_ref(
120
121
 
121
122
  if not pull and branch and not commit:
122
123
  remote_name = str(repo.remotes[0].name)
123
- remote_commit = repo.git.rev_parse(remote_name + "/" + str(branch))
124
+ try:
125
+ remote_commit = repo.git.rev_parse(remote_name + "/" + str(branch))
126
+ except Exception:
127
+ remote_commit = "unknown"
124
128
  LOGGER.debug(
125
129
  "Repo: %s comparing local head '%s' with remote head '%s'", repo.working_dir, current, remote_commit
126
130
  )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: godoo-cli
3
- Version: 0.3.3
3
+ Version: 0.3.4
4
4
  Summary: Wrapper around Odoo-Bin with some convinience RPC functions.
5
5
  Home-page: https://github.com/OpenJKSoftware/gOdoo
6
6
  License: LGPL-3
@@ -1,14 +1,14 @@
1
- godoo_cli/__init__.py,sha256=n2lCqLhzcysVlbDc8ikwgjoqM4IDNZHh-F1w-i-6k68,50
1
+ godoo_cli/__init__.py,sha256=7iTjToT0wGWlEd6W2DJq4nft2IxH4EchU9cVde6W0hQ,50
2
2
  godoo_cli/__main__.py,sha256=vabFnEJgLssqYOmHzo8rZx_uDdsSc3aQnD3bYXGjBNc,88
3
3
  godoo_cli/cli.py,sha256=GQzVhEhwSsPXDyGzF3W5sfwIgXINYZYuSVA7mTO15FU,2737
4
4
  godoo_cli/commands/__init__.py,sha256=O8GGxem4uKZjv8mbHOS2xUPpqAK_eT_JQTysv3fs5AQ,293
5
5
  godoo_cli/commands/bootstrap.py,sha256=lZAptOORjApxdAvf2wc2-fL51RhT55DuDmnnoLOsQ0E,6443
6
6
  godoo_cli/commands/config.py,sha256=yUe8bIeL-VYInWBeJlO5GrATDgpLZuKoKSnQKuxJGNI,986
7
- godoo_cli/commands/launch.py,sha256=-hGE2p43dhon0Zsmqqm6DJk7gz7A2yDHgIUKC3Xgx-c,5268
7
+ godoo_cli/commands/launch.py,sha256=IkASQs0aWyyPwMOIzTNg0wIlpw0wUJ9LsVzTLhp4BTE,5235
8
8
  godoo_cli/commands/rpc/__init__.py,sha256=yFdMBrNgS2OGheOD4voUOHUXW6XZyL6T11kN0CvOnNI,177
9
9
  godoo_cli/commands/rpc/cli.py,sha256=OVMeLRJDfRGqFN6Uysn1vSADRJOXWdXyginhKxvErnI,702
10
10
  godoo_cli/commands/rpc/cli_callbacks.py,sha256=TfvvKNJY7Dyq4ggtaLDxrVE0OgN-PMM_AcXFnl-cU2U,870
11
- godoo_cli/commands/rpc/importer.py,sha256=EHu3hBlxfGUaELBpXTm0jRnigHEVrqs2aOqbW_t5SXs,2257
11
+ godoo_cli/commands/rpc/importer.py,sha256=NQcpJdXRReL8nLdnvEs4oHj5BXEyA7IEUxnWJmGqi-o,2362
12
12
  godoo_cli/commands/rpc/modules.py,sha256=DXxrdN3gh2hB24ngqrOrLtj3gbAaJBlFYIXi1lgHA7c,3346
13
13
  godoo_cli/commands/rpc/translations.py,sha256=D43y1hYp8AloZxX_wxiZw_Wl4Y2b_H2Lj50_cVXqxW0,2977
14
14
  godoo_cli/commands/shell.py,sha256=L4NPW8ZBOoZ_Sv9AxydK-uDaerkAEOkl67PlD0v0Q74,1445
@@ -17,7 +17,7 @@ godoo_cli/commands/test.py,sha256=B5o27hsmMxLExuSmpUKJQRaSM6eQS2vL0UF8AnBTsz4,34
17
17
  godoo_cli/git/__init__.py,sha256=gIn8mWrsacA671ZcBVzY-hnJKrsF3v4gEqgQGFTH2t0,161
18
18
  godoo_cli/git/git_odoo.py,sha256=wMF2jG4V6TrQTdx_2GBEQh9G8ZCP22AaYgcg_OEQI98,1299
19
19
  godoo_cli/git/git_odoo_addons.py,sha256=CRcclkFy1amtQ5q2JxioEfdTLpiQYBcQF7RAmwwRNSI,3296
20
- godoo_cli/git/git_repo.py,sha256=cU6M7qtg-D7Uqxtm1TaIo_CocckyOEBQc3q1s3XPi8U,6277
20
+ godoo_cli/git/git_repo.py,sha256=XJeaA20Bjw1C2H09Yg6aJvq_QVXe8B5RFLmU5HplRXs,6380
21
21
  godoo_cli/git/git_url.py,sha256=5sDx2xnTXPLhCY6w2yRnUscMtCVObC281v0t6xzGUBA,4585
22
22
  godoo_cli/git/zip_download.py,sha256=rSEd9iFsWU-lraIOyw7AkMbLRAf6RuUR0IMDfwFr9WI,1500
23
23
  godoo_cli/helpers/__init__.py,sha256=t4VzYapYAMxzwgv6kQu8wvaLnkXFvPNyO15LnRZqzkE,49
@@ -26,8 +26,8 @@ godoo_cli/helpers/cli.py,sha256=qyI1yvTh1EwsTY7zd-EQeNAceeW6_cshimdlH1mWJqA,3115
26
26
  godoo_cli/helpers/odoo_files.py,sha256=yHV2hAHWPxKoQVq_Zy-jQSK3nWid6zIbT1uzNmaW0TQ,7871
27
27
  godoo_cli/helpers/odoo_manifest.py,sha256=8_kI22kF80raiF-ttRDRwudwAfaem7mcAks_BJi_R5E,3277
28
28
  godoo_cli/helpers/system.py,sha256=1e20_rl4Q7fnfj5iT69CMGKBeT8hXz_uB7Ye7k_rlxA,2588
29
- godoo_cli-0.3.3.dist-info/entry_points.txt,sha256=jXhSyRfKYyScnprAvzGkRdqaZCP5EPJahfzs1NfRzzU,46
30
- godoo_cli-0.3.3.dist-info/LICENSE,sha256=ZVetxLwdWSMuJ1Z6GF3XDPLsyjFUAYsL5h6inPnoFOI,7633
31
- godoo_cli-0.3.3.dist-info/WHEEL,sha256=vxFmldFsRN_Hx10GDvsdv1wroKq8r5Lzvjp6GZ4OO8c,88
32
- godoo_cli-0.3.3.dist-info/METADATA,sha256=jxq-MRFtFznpRGTNtF2Ag3tfMcvlBml5p7Z9eUdGRMU,8647
33
- godoo_cli-0.3.3.dist-info/RECORD,,
29
+ godoo_cli-0.3.4.dist-info/entry_points.txt,sha256=jXhSyRfKYyScnprAvzGkRdqaZCP5EPJahfzs1NfRzzU,46
30
+ godoo_cli-0.3.4.dist-info/LICENSE,sha256=ZVetxLwdWSMuJ1Z6GF3XDPLsyjFUAYsL5h6inPnoFOI,7633
31
+ godoo_cli-0.3.4.dist-info/WHEEL,sha256=vxFmldFsRN_Hx10GDvsdv1wroKq8r5Lzvjp6GZ4OO8c,88
32
+ godoo_cli-0.3.4.dist-info/METADATA,sha256=9lUMQFaiFUDzumy_pOh8Yf3rNTvjv6-roeEB6bAoors,8647
33
+ godoo_cli-0.3.4.dist-info/RECORD,,