From abc6a1faa332a69c431142a1d5bf53de0a1d548f Mon Sep 17 00:00:00 2001 From: Trinh Anh Ngoc Date: Thu, 18 May 2023 17:43:49 +0700 Subject: [PATCH] Cleanup --- odoo-stubs/__init__.pyi | 4 +-- odoo-stubs/addons/__init__.pyi | 3 --- odoo-stubs/cli/__init__.pyi | 14 ----------- odoo-stubs/cli/cloc.pyi | 4 --- odoo-stubs/cli/command.pyi | 12 --------- odoo-stubs/cli/db.pyi | 15 ----------- odoo-stubs/cli/deploy.pyi | 10 -------- odoo-stubs/cli/genproxytoken.pyi | 5 ---- odoo-stubs/cli/neutralize.pyi | 4 --- odoo-stubs/cli/populate.pyi | 11 -------- odoo-stubs/cli/scaffold.pyi | 25 ------------------- odoo-stubs/cli/server.pyi | 18 ------------- odoo-stubs/cli/shell.pyi | 21 ---------------- odoo-stubs/cli/start.pyi | 7 ------ odoo-stubs/cli/tsconfig.pyi | 11 -------- odoo-stubs/modules/loading.pyi | 2 +- odoo-stubs/modules/registry.pyi | 2 +- odoo-stubs/tests/__init__.pyi | 2 +- odoo-stubs/tests/common.pyi | 3 +-- odoo-stubs/tests/test_module_operations.pyi | 20 --------------- .../tests/test_parse_inline_template.pyi | 6 ----- odoo-stubs/tools/__init__.pyi | 4 +-- odoo-stubs/tools/_monkeypatches.pyi | 0 odoo-stubs/tools/win32.pyi | 1 - odoo-stubs/upgrade/__init__.pyi | 0 25 files changed, 6 insertions(+), 198 deletions(-) delete mode 100644 odoo-stubs/cli/__init__.pyi delete mode 100644 odoo-stubs/cli/cloc.pyi delete mode 100644 odoo-stubs/cli/command.pyi delete mode 100644 odoo-stubs/cli/db.pyi delete mode 100644 odoo-stubs/cli/deploy.pyi delete mode 100644 odoo-stubs/cli/genproxytoken.pyi delete mode 100644 odoo-stubs/cli/neutralize.pyi delete mode 100644 odoo-stubs/cli/populate.pyi delete mode 100644 odoo-stubs/cli/scaffold.pyi delete mode 100644 odoo-stubs/cli/server.pyi delete mode 100644 odoo-stubs/cli/shell.pyi delete mode 100644 odoo-stubs/cli/start.pyi delete mode 100644 odoo-stubs/cli/tsconfig.pyi delete mode 100644 odoo-stubs/tests/test_module_operations.pyi delete mode 100644 odoo-stubs/tests/test_parse_inline_template.pyi delete mode 100644 odoo-stubs/tools/_monkeypatches.pyi delete mode 100644 odoo-stubs/tools/win32.pyi delete mode 100644 odoo-stubs/upgrade/__init__.pyi diff --git a/odoo-stubs/__init__.pyi b/odoo-stubs/__init__.pyi index 9860744..b45557d 100644 --- a/odoo-stubs/__init__.pyi +++ b/odoo-stubs/__init__.pyi @@ -3,7 +3,6 @@ from psycopg2 import connection from . import ( addons as addons, api as api, - cli as cli, conf as conf, fields as fields, http as http, @@ -14,8 +13,7 @@ from . import ( release as release, service as service, sql_db as sql_db, - tools as tools, - upgrade as upgrade + tools as tools ) from .api import Registry from .fields import Command as Command diff --git a/odoo-stubs/addons/__init__.pyi b/odoo-stubs/addons/__init__.pyi index 0cc7ebf..e69de29 100644 --- a/odoo-stubs/addons/__init__.pyi +++ b/odoo-stubs/addons/__init__.pyi @@ -1,3 +0,0 @@ -from typing import Any - -__path__: Any diff --git a/odoo-stubs/cli/__init__.pyi b/odoo-stubs/cli/__init__.pyi deleted file mode 100644 index 50e7aa7..0000000 --- a/odoo-stubs/cli/__init__.pyi +++ /dev/null @@ -1,14 +0,0 @@ -from . import ( - cloc as cloc, - db as db, - deploy as deploy, - genproxytoken as genproxytoken, - neutralize as neutralize, - populate as populate, - scaffold as scaffold, - server as server, - shell as shell, - start as start, - tsconfig as tsconfig -) -from .command import Command as Command, main as main diff --git a/odoo-stubs/cli/cloc.pyi b/odoo-stubs/cli/cloc.pyi deleted file mode 100644 index 78aa9f5..0000000 --- a/odoo-stubs/cli/cloc.pyi +++ /dev/null @@ -1,4 +0,0 @@ -from . import Command - -class Cloc(Command): - def run(self, args) -> None: ... diff --git a/odoo-stubs/cli/command.pyi b/odoo-stubs/cli/command.pyi deleted file mode 100644 index 4cbc0e8..0000000 --- a/odoo-stubs/cli/command.pyi +++ /dev/null @@ -1,12 +0,0 @@ -commands: dict[str, type[Command]] - -class Command: - name: str - def __init_subclass__(cls) -> None: ... - -ODOO_HELP: str - -class Help(Command): - def run(self, args) -> None: ... - -def main() -> None: ... diff --git a/odoo-stubs/cli/db.pyi b/odoo-stubs/cli/db.pyi deleted file mode 100644 index bb8ebf8..0000000 --- a/odoo-stubs/cli/db.pyi +++ /dev/null @@ -1,15 +0,0 @@ -from typing import Callable - -from . import Command - -eprint: Callable - -class Db(Command): - name: str - def run(self, cmdargs): ... - def load(self, args) -> None: ... - def dump(self, args) -> None: ... - def duplicate(self, args) -> None: ... - def rename(self, args) -> None: ... - def drop(self, args) -> None: ... - def _check_target(self, target, *, delete_if_exists) -> None: ... diff --git a/odoo-stubs/cli/deploy.pyi b/odoo-stubs/cli/deploy.pyi deleted file mode 100644 index f2a67db..0000000 --- a/odoo-stubs/cli/deploy.pyi +++ /dev/null @@ -1,10 +0,0 @@ -from . import Command -from typing import Any - -class Deploy(Command): - session: Any - def __init__(self) -> None: ... - def deploy_module(self, module_path, url, login, password, db: str = ..., force: bool = ...): ... - def login_upload_module(self, module_file, url, login, password, db, force: bool = ...): ... - def zip_module(self, path): ... - def run(self, cmdargs) -> None: ... diff --git a/odoo-stubs/cli/genproxytoken.pyi b/odoo-stubs/cli/genproxytoken.pyi deleted file mode 100644 index e95a6e3..0000000 --- a/odoo-stubs/cli/genproxytoken.pyi +++ /dev/null @@ -1,5 +0,0 @@ -from . import Command - -class GenProxyToken(Command): - def generate_token(self, length: int = ...): ... - def run(self, cmdargs) -> None: ... diff --git a/odoo-stubs/cli/neutralize.pyi b/odoo-stubs/cli/neutralize.pyi deleted file mode 100644 index da7638b..0000000 --- a/odoo-stubs/cli/neutralize.pyi +++ /dev/null @@ -1,4 +0,0 @@ -from . import Command - -class Neutralize(Command): - def run(self, args) -> None: ... diff --git a/odoo-stubs/cli/populate.pyi b/odoo-stubs/cli/populate.pyi deleted file mode 100644 index d9188d5..0000000 --- a/odoo-stubs/cli/populate.pyi +++ /dev/null @@ -1,11 +0,0 @@ -from . import Command -from ..api import Environment -from ..models import BaseModel - -class Populate(Command): - def run(self, cmdargs) -> None: ... - @classmethod - def populate(cls, env: Environment, size, model_patterns: bool = ..., profiling_enabled: bool = ..., - commit: bool = ...) -> dict: ... - @classmethod - def _get_ordered_models(cls, env: Environment, model_patterns: bool = ...) -> list[BaseModel]: ... diff --git a/odoo-stubs/cli/scaffold.pyi b/odoo-stubs/cli/scaffold.pyi deleted file mode 100644 index ff10ad4..0000000 --- a/odoo-stubs/cli/scaffold.pyi +++ /dev/null @@ -1,25 +0,0 @@ -from . import Command -from typing import Any - -class Scaffold(Command): - def run(self, cmdargs) -> None: ... - def epilog(self): ... - -builtins: Any - -def snake(s): ... -def pascal(s): ... -def directory(p, create: bool = ...): ... - -env: Any - -class template: - id: Any - path: Any - def __init__(self, identifier) -> None: ... - def __str__(self): ... - def files(self) -> None: ... - def render_to(self, modname, directory, params: Any | None = ...) -> None: ... - -def die(message, code: int = ...) -> None: ... -def warn(message) -> None: ... diff --git a/odoo-stubs/cli/server.pyi b/odoo-stubs/cli/server.pyi deleted file mode 100644 index 761dd46..0000000 --- a/odoo-stubs/cli/server.pyi +++ /dev/null @@ -1,18 +0,0 @@ -from . import Command -from typing import Any - -__author__: Any -__version__: Any -_logger: Any - -def check_root_user() -> None: ... -def check_postgres_user() -> None: ... -def report_configuration() -> None: ... -def rm_pid_file(main_pid) -> None: ... -def setup_pid_file() -> None: ... -def export_translation() -> None: ... -def import_translation() -> None: ... -def main(args) -> None: ... - -class Server(Command): - def run(self, args) -> None: ... diff --git a/odoo-stubs/cli/shell.pyi b/odoo-stubs/cli/shell.pyi deleted file mode 100644 index 62df714..0000000 --- a/odoo-stubs/cli/shell.pyi +++ /dev/null @@ -1,21 +0,0 @@ -import code -from . import Command -from typing import Any - -_logger: Any - -def raise_keyboard_interrupt(*a) -> None: ... - -class Console(code.InteractiveConsole): - def __init__(self, locals: Any | None = ..., filename: str = ...) -> None: ... - -class Shell(Command): - supported_shells: Any - def init(self, args) -> None: ... - def console(self, local_vars): ... - def ipython(self, local_vars) -> None: ... - def ptpython(self, local_vars) -> None: ... - def bpython(self, local_vars) -> None: ... - def python(self, local_vars) -> None: ... - def shell(self, dbname) -> None: ... - def run(self, args): ... diff --git a/odoo-stubs/cli/start.pyi b/odoo-stubs/cli/start.pyi deleted file mode 100644 index f60e6f0..0000000 --- a/odoo-stubs/cli/start.pyi +++ /dev/null @@ -1,7 +0,0 @@ -from . import Command - -class Start(Command): - def get_module_list(self, path): ... - def run(self, cmdargs): ... - -def die(message, code: int = ...) -> None: ... diff --git a/odoo-stubs/cli/tsconfig.pyi b/odoo-stubs/cli/tsconfig.pyi deleted file mode 100644 index ad6f622..0000000 --- a/odoo-stubs/cli/tsconfig.pyi +++ /dev/null @@ -1,11 +0,0 @@ -from . import Command - -class TSConfig(Command): - def get_module_list(self, path): ... - def clean_path(self, path): ... - def prefix_suffix_path(self, path, prefix, suffix): ... - def remove_(self, modules, module) -> None: ... - def run(self, cmdargs) -> None: ... - def generate_imports(self, modules): ... - def generate_file_content(self, modules, paths): ... - def generate_excludes(self): ... diff --git a/odoo-stubs/modules/loading.pyi b/odoo-stubs/modules/loading.pyi index ea67b12..e545cae 100644 --- a/odoo-stubs/modules/loading.pyi +++ b/odoo-stubs/modules/loading.pyi @@ -3,7 +3,7 @@ from typing import Any, Iterable from .graph import Graph, Node from .registry import Registry from ..sql_db import Cursor -from ..tests.runner import OdooTestResult +from ..tests.result import OdooTestResult def load_data(cr: Cursor, idref: dict, mode: str, kind: str, package: Node) -> bool: ... def load_demo(cr: Cursor, package: Node, idref: dict, mode: str) -> bool: ... diff --git a/odoo-stubs/modules/registry.pyi b/odoo-stubs/modules/registry.pyi index 458b6c3..0024b5c 100644 --- a/odoo-stubs/modules/registry.pyi +++ b/odoo-stubs/modules/registry.pyi @@ -8,7 +8,7 @@ from .graph import Node from ..models import BaseModel from ..fields import Field from ..sql_db import Connection, Cursor -from ..tests.runner import OdooTestResult +from ..tests.result import OdooTestResult from ..tools import Collector from ..tools.lru import LRU diff --git a/odoo-stubs/tests/__init__.pyi b/odoo-stubs/tests/__init__.pyi index a208a5b..fabbb63 100644 --- a/odoo-stubs/tests/__init__.pyi +++ b/odoo-stubs/tests/__init__.pyi @@ -1,2 +1,2 @@ from .common import * -from . import common as common, test_parse_inline_template as test_parse_inline_template +from . import common as common diff --git a/odoo-stubs/tests/common.pyi b/odoo-stubs/tests/common.pyi index e68ef1e..ff07092 100644 --- a/odoo-stubs/tests/common.pyi +++ b/odoo-stubs/tests/common.pyi @@ -1,6 +1,5 @@ import collections import logging -import sys from concurrent.futures import Future from itertools import count from subprocess import Popen @@ -13,7 +12,7 @@ from lxml.etree import _Element from websocket import WebSocket from . import case -from .runner import OdooTestResult +from .result import OdooTestResult from ..api import Environment from ..http import Session from ..models import BaseModel diff --git a/odoo-stubs/tests/test_module_operations.pyi b/odoo-stubs/tests/test_module_operations.pyi deleted file mode 100644 index 8825e08..0000000 --- a/odoo-stubs/tests/test_module_operations.pyi +++ /dev/null @@ -1,20 +0,0 @@ -from argparse import Action, Namespace - -BLACKLIST: set[str] -IGNORE: tuple[str, ...] -INSTALL_BLACKLIST: set[str] - -def install(db_name: str, module_id: int, module_name: str) -> None: ... -def uninstall(db_name: str, module_id: int, module_name: str) -> None: ... -def cycle(db_name: str, module_id: int, module_name: str) -> None: ... -def parse_args() -> Namespace: ... - -class UninstallAction(Action): - def __call__(self, parser, namespace, values, option_string = ...) -> None: ... - -class StandaloneAction(Action): - def __call__(self, parser, namespace, values, option_string = ...) -> None: ... - -def test_cycle(args: Namespace) -> None: ... -def test_uninstall(args: Namespace) -> None: ... -def test_standalone(args: Namespace) -> None: ... diff --git a/odoo-stubs/tests/test_parse_inline_template.pyi b/odoo-stubs/tests/test_parse_inline_template.pyi deleted file mode 100644 index f07d8d9..0000000 --- a/odoo-stubs/tests/test_parse_inline_template.pyi +++ /dev/null @@ -1,6 +0,0 @@ -from odoo.tests import BaseCase - -class TestParseInlineTemplate(BaseCase): - def test_no_expression(self) -> None: ... - def test_expression1(self) -> None: ... - def test_expression2(self) -> None: ... diff --git a/odoo-stubs/tools/__init__.pyi b/odoo-stubs/tools/__init__.pyi index 90aae3b..a8e8350 100644 --- a/odoo-stubs/tools/__init__.pyi +++ b/odoo-stubs/tools/__init__.pyi @@ -11,13 +11,11 @@ from .translate import * from .xml_utils import * from .convert import * from . import ( - _monkeypatches as _monkeypatches, appdirs as appdirs, cloc as cloc, osutil as osutil, pdf as pdf, - pycompat as pycompat, - win32 as win32 + pycompat as pycompat ) from .config import config as config from .js_transpiler import ( diff --git a/odoo-stubs/tools/_monkeypatches.pyi b/odoo-stubs/tools/_monkeypatches.pyi deleted file mode 100644 index e69de29..0000000 diff --git a/odoo-stubs/tools/win32.pyi b/odoo-stubs/tools/win32.pyi deleted file mode 100644 index dc78c10..0000000 --- a/odoo-stubs/tools/win32.pyi +++ /dev/null @@ -1 +0,0 @@ -def nl_langinfo(param) -> str: ... diff --git a/odoo-stubs/upgrade/__init__.pyi b/odoo-stubs/upgrade/__init__.pyi deleted file mode 100644 index e69de29..0000000