diff --git a/odev/_version.py b/odev/_version.py index 12102f76..3273ca43 100644 --- a/odev/_version.py +++ b/odev/_version.py @@ -22,4 +22,4 @@ # or merged change. # ------------------------------------------------------------------------------ -__version__ = "4.29.2" +__version__ = "4.29.3" diff --git a/odev/commands/database/create.py b/odev/commands/database/create.py index 684aa9fd..57432319 100644 --- a/odev/commands/database/create.py +++ b/odev/commands/database/create.py @@ -9,7 +9,6 @@ from odev.common.databases import LocalDatabase from odev.common.errors.odev import OdevError from odev.common.odev import logger -from odev.common.odoobin import OdoobinProcess from odev.common.version import OdooVersion @@ -176,14 +175,14 @@ def initialize_database(self) -> None: if not re.search(r"--st(op-after-init)?", joined_args): args.append("--stop-after-init") - process = self.odoobin or OdoobinProcess(self._database) + process = self.odoobin or self.odev.odoobin_process_class(self._database) process.with_edition("enterprise" if self.args.enterprise else "community") process.with_version(self.version) process.with_venv(self.venv) process.with_worktree(self.worktree) try: - run_process = process.run(args=args, progress=self.odoobin_progress, prepare=True) + run_process = process.run(args=args, stream_filter=self.odoobin_progress, prepare=True) self.console.print() except OdevError as error: logger.error(str(error)) diff --git a/odev/commands/database/deploy.py b/odev/commands/database/deploy.py index 9e96af41..925135e7 100644 --- a/odev/commands/database/deploy.py +++ b/odev/commands/database/deploy.py @@ -32,7 +32,7 @@ def run(self): odoobin: OdoobinProcess = ( self._database.process if isinstance(self._database, LocalDatabase) - else OdoobinProcess(LocalDatabase(self.odev.name), version=self._database.version) + else self.odev.odoobin_process_class(LocalDatabase(self.odev.name), version=self._database.version) ) url = self._database.url if isinstance(self._database, RemoteDatabase) else None diff --git a/odev/commands/database/run.py b/odev/commands/database/run.py index 3ae8a81d..a0b54ace 100644 --- a/odev/commands/database/run.py +++ b/odev/commands/database/run.py @@ -76,7 +76,7 @@ def run(self): if self.odoobin.is_running: raise self.error(f"Database {self._database.name!r} is already running") - process = self.odoobin.run(args=self.args.odoo_args, progress=self.odoobin_progress) + process = self.odoobin.run(args=self.args.odoo_args, stream_filter=self.odoobin_progress) if process and process.returncode: raise self.error("Odoo process failed") diff --git a/odev/commands/database/test.py b/odev/commands/database/test.py index b5270b36..afb3057f 100644 --- a/odev/commands/database/test.py +++ b/odev/commands/database/test.py @@ -123,7 +123,7 @@ def run_test_database(self): if not self.test_database.exists: self.create_test_database() - odoobin = self.test_database.process or OdoobinProcess(self.test_database) + odoobin = self.test_database.process or self.odev.odoobin_process_class(self.test_database) odoobin.with_version(self.version) edition = ( @@ -138,7 +138,7 @@ def run_test_database(self): odoobin.additional_addons_paths = cast(OdoobinProcess, self.odoobin).additional_addons_paths try: - process = odoobin.run(args=args, progress=self.odoobin_progress) + process = odoobin.run(args=args, stream_filter=self.odoobin_progress) if process is not None and process.returncode != 0 and not self.test_buffer: raise self.error("Odoo crashed during initialization. Check the logs above.") diff --git a/odev/commands/database/upgrade_code.py b/odev/commands/database/upgrade_code.py index f4ebb60e..61f7e39f 100644 --- a/odev/commands/database/upgrade_code.py +++ b/odev/commands/database/upgrade_code.py @@ -116,7 +116,7 @@ def run(self): self.odoobin.odoobin_path, cmd_args, stream=True, - progress=lambda line: self.odoobin.console.print(line, end=""), + stream_filter=lambda line: (self.odoobin.console.print(line, end=""), line)[1], ) if result.returncode not in (0, 1): raise self.error(f"Odoo exited with code {result.returncode}") diff --git a/odev/common/commands/base.py b/odev/common/commands/base.py index 3c56b517..e85c20b2 100644 --- a/odev/common/commands/base.py +++ b/odev/common/commands/base.py @@ -300,12 +300,12 @@ def _rescue_positional_from_unknown_flag( if captured is None: continue - raw_val = ( - captured[0] - if isinstance(captured, list) and captured - else (str(captured) if not isinstance(captured, list) else None) - ) - if raw_val is None: + if isinstance(captured, list): + raw_val = ",".join(map(str, captured)) + else: + raw_val = str(captured) + + if not raw_val: continue try: diff --git a/odev/common/commands/odoobin.py b/odev/common/commands/odoobin.py index 4b2256e4..a6088f56 100644 --- a/odev/common/commands/odoobin.py +++ b/odev/common/commands/odoobin.py @@ -83,41 +83,6 @@ class OdoobinCommand(LocalDatabaseCommand, ABC): # Properties # -------------------------------------------------------------------------- - ODOO_LOG_REGEX: re.Pattern = re.compile( - r""" - (?: - ((?P\d{4}-\d{2}-\d{2})\s)? - (?P