gOdoo-cli 0.11.9__tar.gz → 0.11.11__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 (51) hide show
  1. {godoo_cli-0.11.9 → godoo_cli-0.11.11}/PKG-INFO +1 -1
  2. {godoo_cli-0.11.9 → godoo_cli-0.11.11}/pyproject.toml +1 -1
  3. {godoo_cli-0.11.9 → godoo_cli-0.11.11}/src/godoo_cli/commands/backup/dump.py +12 -11
  4. {godoo_cli-0.11.9 → godoo_cli-0.11.11}/src/godoo_cli/commands/backup/load.py +2 -1
  5. {godoo_cli-0.11.9 → godoo_cli-0.11.11}/src/godoo_cli/commands/backup/util.py +0 -1
  6. godoo_cli-0.11.11/src/godoo_cli/version.py +1 -0
  7. godoo_cli-0.11.9/src/godoo_cli/version.py +0 -1
  8. {godoo_cli-0.11.9 → godoo_cli-0.11.11}/LICENSE +0 -0
  9. {godoo_cli-0.11.9 → godoo_cli-0.11.11}/README.md +0 -0
  10. {godoo_cli-0.11.9 → godoo_cli-0.11.11}/src/godoo_cli/__init__.py +0 -0
  11. {godoo_cli-0.11.9 → godoo_cli-0.11.11}/src/godoo_cli/__main__.py +0 -0
  12. {godoo_cli-0.11.9 → godoo_cli-0.11.11}/src/godoo_cli/cli.py +0 -0
  13. {godoo_cli-0.11.9 → godoo_cli-0.11.11}/src/godoo_cli/cli_common.py +0 -0
  14. {godoo_cli-0.11.9 → godoo_cli-0.11.11}/src/godoo_cli/commands/__init__.py +0 -0
  15. {godoo_cli-0.11.9 → godoo_cli-0.11.11}/src/godoo_cli/commands/backup/__init__.py +0 -0
  16. {godoo_cli-0.11.9 → godoo_cli-0.11.11}/src/godoo_cli/commands/backup/cli.py +0 -0
  17. {godoo_cli-0.11.9 → godoo_cli-0.11.11}/src/godoo_cli/commands/backup/pull.py +0 -0
  18. {godoo_cli-0.11.9 → godoo_cli-0.11.11}/src/godoo_cli/commands/bootstrap.py +0 -0
  19. {godoo_cli-0.11.9 → godoo_cli-0.11.11}/src/godoo_cli/commands/config.py +0 -0
  20. {godoo_cli-0.11.9 → godoo_cli-0.11.11}/src/godoo_cli/commands/db/__init__.py +0 -0
  21. {godoo_cli-0.11.9 → godoo_cli-0.11.11}/src/godoo_cli/commands/db/cli.py +0 -0
  22. {godoo_cli-0.11.9 → godoo_cli-0.11.11}/src/godoo_cli/commands/db/connection.py +0 -0
  23. {godoo_cli-0.11.9 → godoo_cli-0.11.11}/src/godoo_cli/commands/db/passwords.py +0 -0
  24. {godoo_cli-0.11.9 → godoo_cli-0.11.11}/src/godoo_cli/commands/db/query.py +0 -0
  25. {godoo_cli-0.11.9 → godoo_cli-0.11.11}/src/godoo_cli/commands/launch.py +0 -0
  26. {godoo_cli-0.11.9 → godoo_cli-0.11.11}/src/godoo_cli/commands/rpc/__init__.py +0 -0
  27. {godoo_cli-0.11.9 → godoo_cli-0.11.11}/src/godoo_cli/commands/rpc/cli.py +0 -0
  28. {godoo_cli-0.11.9 → godoo_cli-0.11.11}/src/godoo_cli/commands/rpc/config_parameters.py +0 -0
  29. {godoo_cli-0.11.9 → godoo_cli-0.11.11}/src/godoo_cli/commands/rpc/importer.py +0 -0
  30. {godoo_cli-0.11.9 → godoo_cli-0.11.11}/src/godoo_cli/commands/rpc/modules.py +0 -0
  31. {godoo_cli-0.11.9 → godoo_cli-0.11.11}/src/godoo_cli/commands/rpc/translations.py +0 -0
  32. {godoo_cli-0.11.9 → godoo_cli-0.11.11}/src/godoo_cli/commands/shell.py +0 -0
  33. {godoo_cli-0.11.9 → godoo_cli-0.11.11}/src/godoo_cli/commands/source_get.py +0 -0
  34. {godoo_cli-0.11.9 → godoo_cli-0.11.11}/src/godoo_cli/commands/test/__init__.py +0 -0
  35. {godoo_cli-0.11.9 → godoo_cli-0.11.11}/src/godoo_cli/commands/test/cli.py +0 -0
  36. {godoo_cli-0.11.9 → godoo_cli-0.11.11}/src/godoo_cli/commands/test/test_load_data.py +0 -0
  37. {godoo_cli-0.11.9 → godoo_cli-0.11.11}/src/godoo_cli/commands/test/test_run.py +0 -0
  38. {godoo_cli-0.11.9 → godoo_cli-0.11.11}/src/godoo_cli/git/__init__.py +0 -0
  39. {godoo_cli-0.11.9 → godoo_cli-0.11.11}/src/godoo_cli/git/git_odoo.py +0 -0
  40. {godoo_cli-0.11.9 → godoo_cli-0.11.11}/src/godoo_cli/git/git_odoo_addons.py +0 -0
  41. {godoo_cli-0.11.9 → godoo_cli-0.11.11}/src/godoo_cli/git/git_repo.py +0 -0
  42. {godoo_cli-0.11.9 → godoo_cli-0.11.11}/src/godoo_cli/git/git_url.py +0 -0
  43. {godoo_cli-0.11.9 → godoo_cli-0.11.11}/src/godoo_cli/git/zip_download.py +0 -0
  44. {godoo_cli-0.11.9 → godoo_cli-0.11.11}/src/godoo_cli/helpers/__init__.py +0 -0
  45. {godoo_cli-0.11.9 → godoo_cli-0.11.11}/src/godoo_cli/helpers/cli.py +0 -0
  46. {godoo_cli-0.11.9 → godoo_cli-0.11.11}/src/godoo_cli/helpers/modules.py +0 -0
  47. {godoo_cli-0.11.9 → godoo_cli-0.11.11}/src/godoo_cli/helpers/modules_git.py +0 -0
  48. {godoo_cli-0.11.9 → godoo_cli-0.11.11}/src/godoo_cli/helpers/modules_py.py +0 -0
  49. {godoo_cli-0.11.9 → godoo_cli-0.11.11}/src/godoo_cli/helpers/odoo_files.py +0 -0
  50. {godoo_cli-0.11.9 → godoo_cli-0.11.11}/src/godoo_cli/helpers/odoo_manifest.py +0 -0
  51. {godoo_cli-0.11.9 → godoo_cli-0.11.11}/src/godoo_cli/helpers/system.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: gOdoo-cli
3
- Version: 0.11.9
3
+ Version: 0.11.11
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,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "gOdoo-cli"
3
- version = "0.11.9"
3
+ version = "0.11.11"
4
4
  description = "Wrapper around Odoo-Bin with some convinience RPC functions."
5
5
  authors = ["Joshua Kreuder <Joshua_Kreuder@outlook.com>"]
6
6
  license = "LGPL-3"
@@ -1,5 +1,4 @@
1
1
  import logging
2
- import shutil
3
2
  from configparser import ConfigParser
4
3
  from datetime import datetime
5
4
  from pathlib import Path
@@ -9,6 +8,7 @@ import typer
9
8
  from ...cli_common import CommonCLI
10
9
  from ...helpers.odoo_files import odoo_bin_get_version
11
10
  from ..db.connection import DBConnection
11
+ from .util import call_rsync
12
12
 
13
13
  LOGGER = logging.getLogger(__name__)
14
14
  CLI = CommonCLI()
@@ -23,6 +23,7 @@ def dump_instance(
23
23
  dir_okay=True,
24
24
  writable=True,
25
25
  resolve_path=True,
26
+ envvar="GODOO_DUMP_PATH",
26
27
  ),
27
28
  db_name=CLI.database.db_name,
28
29
  db_host=CLI.database.db_host,
@@ -40,33 +41,32 @@ def dump_instance(
40
41
  password=db_password,
41
42
  port=db_port,
42
43
  )
43
- dump_path.mkdir(parents=True, exist_ok=True)
44
+ if not conf_path.exists():
45
+ raise typer.Exit("No Odoo Conf Path provided or doesnt exists: '%s'" % conf_path)
44
46
 
45
- if not conf_path:
46
- raise typer.Exit("No Odoo Conf Path provided. Cannot dump Filestore")
47
+ if not dump_path.exists():
48
+ raise typer.Exit("No Dump Path provided or doesnt exists: %s" % dump_path)
47
49
 
48
50
  # Read .conf value [options] datad_dir
49
- conf_path = Path(conf_path)
50
51
  parser = ConfigParser()
51
52
  parser.read(conf_path)
52
53
  data_dir = parser["options"]["data_dir"]
53
54
  data_dir = Path(data_dir)
54
55
 
55
56
  # Copy Filestore
56
- LOGGER.info("Dumping Filestore")
57
57
  filestore_target = dump_path / "odoo_filestore"
58
- shutil.rmtree(filestore_target, ignore_errors=True)
59
- shutil.copytree(data_dir, filestore_target)
58
+ LOGGER.info("Dumping Filestore -> %s", filestore_target)
59
+ call_rsync(source_folder=data_dir, target_folder=filestore_target)
60
60
 
61
61
  # Dump DB using pg_dump
62
- LOGGER.info("Dumping DB")
63
62
  db_dump_target = dump_path / "odoo.dump"
63
+ LOGGER.info("Dumping DB -> %s", db_dump_target)
64
64
  db_dump_target.unlink(missing_ok=True)
65
65
  db_connection.run_psql_shell_command("pg_dump --format c {} > %s" % db_dump_target)
66
+ LOGGER.info("SQL Dump Completed with size -> %.2f MB", db_dump_target.stat().st_size / (1024 * 1024))
66
67
 
67
- readme_path = Path(dump_path) / "README.md"
68
+ readme_path = dump_path / "README.md"
68
69
  readme_path.unlink(missing_ok=True)
69
-
70
70
  odoo_version = odoo_bin_get_version(odoo_main_path)
71
71
 
72
72
  readme_content = f"""
@@ -83,3 +83,4 @@ SQL Dump and Filestore of gOdoo Instance.
83
83
 
84
84
  """
85
85
  readme_path.write_text(readme_content)
86
+ LOGGER.info("Odoo Dump Completed -> %s", dump_path)
@@ -22,7 +22,7 @@ def load_pg_dump(
22
22
  ):
23
23
  """Drop and recreate db_name and restore dump_path into it."""
24
24
  if not dump_path.exists():
25
- raise FileNotFoundError("Cannot find PG dump @ %s" % dump_path)
25
+ raise FileNotFoundError("Cannot find Odoo Dump @ %s" % dump_path)
26
26
 
27
27
  conn = DBConnection(
28
28
  db_name="postgres",
@@ -71,6 +71,7 @@ def load_instance_data(
71
71
  file_okay=False,
72
72
  dir_okay=True,
73
73
  exists=True,
74
+ envvar="GODOO_DUMP_PATH",
74
75
  ),
75
76
  ],
76
77
  filestore_target_folder: Annotated[
@@ -16,7 +16,6 @@ def call_rsync(source_folder: Path, target_folder: Path, rsync_delete: bool = Tr
16
16
  args += ["--delete"]
17
17
  args += [f"{source_folder}/", f"{target_folder}/"]
18
18
  command = " ".join(map(str, args))
19
- LOGGER.info("Rysnc filestore to: %s", source_folder)
20
19
  LOGGER.debug("Running: %s", command)
21
20
  return subprocess.run(command, shell=True).returncode
22
21
 
@@ -0,0 +1 @@
1
+ __version__ = "0.11.11"
@@ -1 +0,0 @@
1
- __version__ = "0.11.9"
File without changes
File without changes