diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000000000000000000000000000000000000..e10c267b43ae1bb7cbc362fed7f83b6e97e68f46 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,12 @@ +# See https://pre-commit.com for more information +repos: + - repo: https://github.com/PyCQA/flake8 + rev: '6.1.0' + hooks: + - id: flake8 + # Required to make flake8 read fdrom pyproject.toml for now :( + additional_dependencies: ["flake8-pyproject"] + - repo: https://github.com/psf/black + rev: 23.10.1 + hooks: + - id: black diff --git a/plugins/Makefile b/plugins/Makefile index 77d1b595aafb285a2fb63a05581d51f265961810..b55acc29a4f83f14290b3a627a99335a68502350 100644 --- a/plugins/Makefile +++ b/plugins/Makefile @@ -78,6 +78,7 @@ download-firmwares : .PHONY : upload-firmwares upload-firmwares: + chmod +r $(FIRMWARES_PATH)/* rsync -v -rt $(FIRMWARES_PATH)/ $(REMOTE_USER)@$(REMOTE_HOST):$(REMOTE_FIRMWARES_PATH) diff --git a/plugins/conftest.py b/plugins/conftest.py index 789accb2a32279bb3c4a3004c58ee081cda05cc1..e908eada579d2dcece11a12bdec7e1fed9347258 100644 --- a/plugins/conftest.py +++ b/plugins/conftest.py @@ -1,29 +1,42 @@ -from os import path +from __future__ import annotations + +import importlib.util +from os.path import basename +from types import ModuleType +from typing import Any, Generator, Callable import pytest +from pytest import FixtureRequest + + +ModuleInitializer = Callable[[str, dict[str, Any]], ModuleType] + @pytest.fixture() -def module_initializer(request): +def module_initializer( + request: FixtureRequest, +) -> Generator[ModuleInitializer, None, None]: """ Create a method to import files that need global overrides or special modifications before import. This is usually just the entry.py, but could be used with others. The fixture will automatically use the path of the module using it. """ - base_module = request.module.__name__.split('.')[0] - file_path = request.module.__name__.replace('.', path.sep) + '.py' - module_path = request.module.__file__.replace(file_path, base_module) - - def initialize_module(module_name, global_overrides): - import imp - from types import ModuleType + plugin_base_path = request.path.parents[2] + plugin_version = basename(request.path.parents[1]) - module = ModuleType(f'{base_module}.{module_name}') + def initialize_module(module_name: str, global_overrides: dict[str, Any]): + module_file_path = plugin_base_path / plugin_version / f'{module_name}.py' + spec = importlib.util.spec_from_file_location( + f'{plugin_version}.{module_name}', + module_file_path, + submodule_search_locations=[str(plugin_base_path / plugin_version)], + ) + module = importlib.util.module_from_spec(spec) if global_overrides is not None: module.__dict__.update(global_overrides) - source_file, filename = imp.find_module(module_name, [module_path])[:2] - exec(source_file.read(), module.__dict__) + spec.loader.exec_module(module) return module yield initialize_module diff --git a/plugins/pgbuild.py b/plugins/pgbuild.py index eb9fac8581f9944b5bd67318ec148b81ca3730d6..fbdf9bce8903c8c4435eefb5554bf561909e4bee 100755 --- a/plugins/pgbuild.py +++ b/plugins/pgbuild.py @@ -1,13 +1,13 @@ #!/usr/bin/env python3 """ -Copyright 2010-2022 The Wazo Authors (see AUTHORS file) +Copyright 2010-2023 The Wazo Authors (see the AUTHORS file) SPDX-License-Identifier: GPL-3.0-or-later A tool for building provd plugins. """ +from __future__ import annotations - -import errno +import argparse import glob import hashlib import json @@ -17,8 +17,53 @@ import tarfile import traceback from argparse import ArgumentParser from itertools import zip_longest +from pathlib import Path from subprocess import check_call from sys import exit, stderr +from typing import Any, TYPE_CHECKING, Sequence + +if TYPE_CHECKING: + from typing import TypedDict, Literal + from collections.abc import Iterable, Callable + + PhoneTypes = Literal[ + 'ata', + 'conference', + 'deskphone', + 'dect', + 'doorphone', + 'gateway', + 'generic', + 'softphone', + ] + Protocols = Literal['sip', 'sccp'] + TargetCallback = Callable[[str], None] + + class TargetDict(TypedDict): + fun: TargetCallback + pg_id: str + std_dirs: str + + class PluginCapabilities(TypedDict): + lines: int + high_availability: bool + function_keys: int + expansion_modules: int + switchboard: int + multicell: bool + type: PhoneTypes + protocol: Protocols + + class RawPluginInfo(TypedDict): + version: str + description: str + capabilities: dict[str, PluginCapabilities] + + class PluginInfo(RawPluginInfo): + filename: str + dsize: int + sha1sum: str + BUILD_FILENAME = 'build.py' DB_FILENAME = 'plugins.db' @@ -26,11 +71,11 @@ PLUGIN_INFO_FILENAME = 'plugin-info' PACKAGE_SUFFIX = '.tar.bz2' -def cmp(a, b): +def cmp(a: Any, b: Any) -> bool: return (a > b) - (a < b) -def count(iterable, function=bool): +def count(iterable: Iterable, function: Callable[[Any], bool] = bool): """Return the number of element 'e' in iterable for which function(e) is true. @@ -51,26 +96,13 @@ def _is_build_plugin(path): return os.path.isfile(os.path.join(path, BUILD_FILENAME)) -def _list_build_plugins(directory): - def aux(): - for file in os.listdir(directory): - file = os.path.join(directory, file) - if _is_build_plugin(file): - yield file - - return list(aux()) - - -def _mkdir(path): - # Similar to os.mkdir but does not raise an exception if the directory - # already exist - try: - os.mkdir(path) - except OSError as e: - if e.errno == errno.EEXIST and os.path.isdir(path): - pass - else: - raise +def _list_build_plugins(directory: str) -> list[str]: + build_plugins: list[str] = [] + for file in os.listdir(directory): + file = os.path.join(directory, file) + if _is_build_plugin(file): + build_plugins.append(file) + return build_plugins class BuildPlugin: @@ -85,10 +117,12 @@ class BuildPlugin: self.name = os.path.basename(path) def _load_build_plugin(self, path): - targets = {} + targets: dict[str, TargetDict] = {} - def _target(target_id, pg_id, std_dirs=True): - def aux(fun): + def _target( + target_id: str, pg_id: str, std_dirs: bool = True + ) -> Callable[[TargetCallback], TargetCallback]: + def aux(fun: TargetCallback) -> TargetCallback: if target_id in targets: raise Exception( f"in build_plugin '{self.name}': target redefinition for '{target_id}'" @@ -130,7 +164,7 @@ class BuildPlugin: self._mk_std_dirs(abs_path) @staticmethod - def _mk_std_dirs(abs_path): + def _mk_std_dirs(abs_path: str) -> None: for directory in [ 'var', 'var/cache', @@ -138,10 +172,12 @@ class BuildPlugin: 'var/templates', 'var/tftpboot', ]: - _mkdir(os.path.join(abs_path, directory)) + os.makedirs(Path(abs_path) / directory, exist_ok=True) -def build_op(opts, args, src_dir, dest_dir): +def build_op( + opts: argparse.Namespace, args: Sequence[str], src_dir: str, dest_dir: str +) -> None: # Pre: src_dir is a directory # Pre: dest_dir is a directory build_dir = src_dir @@ -197,11 +233,11 @@ def build_op(opts, args, src_dir, dest_dir): traceback.print_exc(None, stderr) -def _is_plugin(path): - return os.path.isfile(os.path.join(path, PLUGIN_INFO_FILENAME)) +def _is_plugin(path: str) -> bool: + return (Path(path) / PLUGIN_INFO_FILENAME).is_file() -def _list_plugins(directory): +def _list_plugins(directory: str) -> list[str]: def aux(): for file in os.listdir(directory): file = os.path.join(directory, file) @@ -211,7 +247,7 @@ def _list_plugins(directory): return list(aux()) -def _get_plugin_version(plugin): +def _get_plugin_version(plugin: str) -> str: # Pre: plugin is a directory with an PLUGIN_INFO_FILENAME file fobj = open(os.path.join(plugin, PLUGIN_INFO_FILENAME)) try: @@ -224,7 +260,9 @@ def _get_plugin_version(plugin): fobj.close() -def package_op(opts, args, src_dir, dest_dir): +def package_op( + opts: argparse.Namespace, args: Sequence[str], src_dir: str, dest_dir: str +) -> None: pg_dir = src_dir pkg_dir = dest_dir @@ -244,7 +282,8 @@ def package_op(opts, args, src_dir, dest_dir): # build packages for plugin in plugins: plugin_version = _get_plugin_version(plugin) - package_path = os.path.join(pkg_dir, os.path.basename(plugin)) + plugin_name = os.path.basename(plugin).replace('_', '-') + package_path = os.path.join(pkg_dir, plugin_name) package = f"{package_path}-{plugin_version}{PACKAGE_SUFFIX}" print(f"Packaging plugin '{plugin}' into '{package}'...") check_call( @@ -259,15 +298,15 @@ def package_op(opts, args, src_dir, dest_dir): ) -def _list_packages(directory): +def _list_packages(directory: str) -> list[str]: return glob.glob(os.path.join(directory, '*' + PACKAGE_SUFFIX)) -def _get_package_filename(package): +def _get_package_filename(package: str) -> str: return os.path.basename(package) -def _get_package_name(package): +def _get_package_name(package: str) -> str: tar_package = tarfile.open(package) try: shortest_name = min(tar_package.getnames()) @@ -282,7 +321,7 @@ def _get_package_name(package): tar_package.close() -def _get_package_plugin_info(package, package_name): +def _get_package_plugin_info(package: str, package_name: str) -> dict: # Return a dictionary representing the standardized content of the # plugin-info file tar_package = tarfile.open(package) @@ -313,19 +352,18 @@ def _get_package_plugin_info(package, package_name): tar_package.close() -def _get_package_dsize(package): +def _get_package_dsize(package: str) -> int: return os.path.getsize(package) -def _get_package_sha1sum(package): +def _get_package_sha1sum(package: str) -> str: package_hash = hashlib.sha1() with open(package, 'rb') as f: package_hash.update(f.read()) return package_hash.hexdigest() -def _get_package_info(package): - # Return a tuple +def _get_package_info(package: str) -> tuple[str, PluginInfo]: result = {'filename': _get_package_filename(package)} name = _get_package_name(package) result.update(_get_package_plugin_info(package, name)) @@ -334,19 +372,19 @@ def _get_package_info(package): return name, result -def _version_cmp(version1, version2): +def _version_cmp(version1: str, version2: str) -> int | bool: """Compare the version version1 to version version2 and return: - negative if version1version2. - + - or bool.. Will be evaluated as 0 or 1, but should be made explicit. """ start1, _, last1 = version1.rpartition('-') start2, _, last2 = version2.rpartition('-') for i1, i2 in zip_longest(start1.split('.'), start2.split('.'), fillvalue='0'): res_cmp = cmp(i1, i2) if res_cmp != 0: - return res_cmp + return int(res_cmp) if not last1 and last2 or not last1.startswith('dev') and last2.startswith('dev'): return 1 elif last1 and not last2 or last1.startswith('dev') and not last2.startswith('dev'): @@ -354,7 +392,9 @@ def _version_cmp(version1, version2): return cmp(last1, last2) -def create_db_op(opts, args, src_dir, dest_dir): +def create_db_op( + opts: argparse.Namespace, args: Sequence[str], src_dir: str, dest_dir: str +) -> None: pkg_dir = src_dir db_file = os.path.join(dest_dir, DB_FILENAME) @@ -364,7 +404,7 @@ def create_db_op(opts, args, src_dir, dest_dir): else: packages = _list_packages(pkg_dir) - # get package infos, and only for the most recent packages + # get package info, and only for the most recent packages package_infos = {} for package in packages: package_name, package_info = _get_package_info(package) @@ -405,7 +445,7 @@ def _get_directories(opts): return _get_directory(opts.source), _get_directory(opts.destination) -def main(): +def main() -> None: parser = ArgumentParser() parser.add_argument( '-B', @@ -460,4 +500,5 @@ def main(): raise AssertionError('unknown operation... this is a bug') -main() +if __name__ == '__main__': + main() diff --git a/plugins/wazo-alcatel/build.py b/plugins/wazo-alcatel/build.py deleted file mode 100644 index 7c8794530f7d2a4d8d2c76aee1c852ee1c657c0a..0000000000000000000000000000000000000000 --- a/plugins/wazo-alcatel/build.py +++ /dev/null @@ -1,22 +0,0 @@ -# Copyright 2022 The Wazo Authors (see the AUTHORS file) -# SPDX-License-Identifier: GPL-3.0-or-later - -# Depends on the following external programs: -# -rsync - -from subprocess import check_call - - -@target('2.01.10', 'wazo-alcatel-2.01.10') -def build_2_01_10(path): - check_call(['rsync', '-rlp', '--exclude', '.*', '2.01.10/', path]) - - -@target('2.13.02', 'wazo-alcatel-2.13.02') -def build_2_13_02(path): - check_call(['rsync', '-rlp', '--exclude', '.*', '2.13.02/', path]) - - -@target('1.51.52', 'wazo-alcatel-1.51.52') -def build_1_51_52(path): - check_call(['rsync', '-rlp', '--exclude', '.*', '1.51.52/', path]) diff --git a/plugins/wazo-cisco-sip/build.py b/plugins/wazo-cisco-sip/build.py deleted file mode 100644 index 0bcdb7845989d5210418d5ac4f5b040d7ce77bb6..0000000000000000000000000000000000000000 --- a/plugins/wazo-cisco-sip/build.py +++ /dev/null @@ -1,29 +0,0 @@ -# Copyright 2018-2022 The Wazo Authors (see AUTHORS file) -# SPDX-License-Identifier: GPL-3.0-or-later - -# Depends on the following external programs: -# -rsync - -from subprocess import check_call - - -@target('9.3', 'wazo-cisco-sip-9.3') -def build_9_3(path): - check_call(['rsync', '-rlp', '--exclude', '.*', 'common/', path]) - - check_call(['rsync', '-rlp', '--exclude', '.*', '9.3/', path]) - - -@target('11.1.0', 'wazo-cisco-sip-11.1.0') -def build_11_1_0(path): - check_call(['rsync', '-rlp', '--exclude', '.*', '11.1.0/', path]) - - -@target('11.3.1', 'wazo-cisco-sip-11.3.1') -def build_11_3_1(path): - check_call(['rsync', '-rlp', '--exclude', '.*', '11.3.1/', path]) - - -@target('12.0.1', 'wazo-cisco-sip-12.0.1') -def build_12_0_1(path): - check_call(['rsync', '-rlp', '--exclude', '.*', '12.0.1/', path]) diff --git a/plugins/wazo-cisco-spa/build.py b/plugins/wazo-cisco-spa/build.py deleted file mode 100644 index 0edeeffbdd87d1adae4d3bdf1399eb82f2220b0b..0000000000000000000000000000000000000000 --- a/plugins/wazo-cisco-spa/build.py +++ /dev/null @@ -1,72 +0,0 @@ -""" -Copyright 2014-2022 The Wazo Authors (see the AUTHORS file) -SPDX-License-Identifier: GPL-3.0+ - -Depends on the following external programs: - -rsync -""" - -from subprocess import check_call - - -@target('7.5.5', 'wazo-cisco-spa-7.5.5') -def build_7_5_5(path): - check_call(['rsync', '-rlp', '--exclude', '.*', 'common/', path]) - - check_call(['rsync', '-rlp', '--exclude', '.*', '7.5.5/', path]) - - -@target('legacy', 'wazo-cisco-spa-legacy') -def build_legacy(path): - check_call(['rsync', '-rlp', '--exclude', '.*', 'common/', path]) - - check_call(['rsync', '-rlp', '--exclude', '.*', 'legacy/', path]) - - -@target('pap2t-5.1.6', 'wazo-cisco-pap2t-5.1.6') -def build_pap2t_5_1_6(path): - check_call(['rsync', '-rlp', '--exclude', '.*', 'common/', path]) - - check_call(['rsync', '-rlp', '--exclude', '.*', 'pap2t-5.1.6/', path]) - - -@target('spa100-1.3.5p', 'wazo-cisco-spa100-1.3.5p') -def build_spa100_1_3_5p(path): - check_call(['rsync', '-rlp', '--exclude', '.*', 'common/', path]) - - check_call(['rsync', '-rlp', '--exclude', '.*', 'spa100-1.3.5p/', path]) - - -@target('spa2102-5.2.12', 'wazo-cisco-spa2102-5.2.12') -def build_spa2102_5_2_12(path): - check_call(['rsync', '-rlp', '--exclude', '.*', 'common/', path]) - - check_call(['rsync', '-rlp', '--exclude', '.*', 'spa2102-5.2.12/', path]) - - -@target('spa3102-5.1.10', 'wazo-cisco-spa3102-5.1.10') -def build_spa3102_5_1_10(path): - check_call(['rsync', '-rlp', '--exclude', '.*', 'common/', path]) - - check_call(['rsync', '-rlp', '--exclude', '.*', 'spa3102-5.1.10/', path]) - - -@target('spa8000-6.1.11', 'wazo-cisco-spa8000-6.1.11') -def build_spa8000_6_1_11(path): - check_call(['rsync', '-rlp', '--exclude', '.*', 'common/', path]) - - check_call(['rsync', '-rlp', '--exclude', '.*', 'spa8000-6.1.11/', path]) - - -@target('spa8800-6.1.7', 'wazo-cisco-spa8800-6.1.7') -def build_spa8800_6_1_7(path): - check_call(['rsync', '-rlp', '--exclude', '.*', 'common/', path]) - - check_call(['rsync', '-rlp', '--exclude', '.*', 'spa8800-6.1.7/', path]) - - -@target('ata190-1.2.2', 'wazo-cisco-ata190-1.2.2') -def build_ata190_1_2_2(path): - check_call(['rsync', '-rlp', '--exclude', '.*', 'common/', path]) - - check_call(['rsync', '-rlp', '--exclude', '.*', 'ata190-1.2.2/', path]) diff --git a/plugins/wazo-fanvil/build.py b/plugins/wazo-fanvil/build.py deleted file mode 100644 index cf67595a4a4b792ebaab08a0ee2079ebd5a4f5b5..0000000000000000000000000000000000000000 --- a/plugins/wazo-fanvil/build.py +++ /dev/null @@ -1,37 +0,0 @@ -""" -Copyright 2013-2023 The Wazo Authors (see the AUTHORS file) -SPDX-License-Identifier: GPL-3.0-or-later - -Depends on the following external programs: - -rsync -""" - -from subprocess import check_call - - -@target('2.3', 'wazo-fanvil-2.3') -def build_2_3(path): - check_call(['rsync', '-rlp', '--exclude', '.*', 'common/', path]) - - check_call(['rsync', '-rlp', '--exclude', '.*', '2.3/', path]) - - -@target('serie-x', 'wazo-fanvil-serie-x') -def build_x(path): - check_call(['rsync', '-rlp', '--exclude', '.*', 'common/', path]) - - check_call(['rsync', '-rlp', '--exclude', '.*', 'serie-x/', path]) - - -@target('serie-v', 'wazo-fanvil-serie-v') -def build_v(path): - check_call(['rsync', '-rlp', '--exclude', '.*', 'common/', path]) - - check_call(['rsync', '-rlp', '--exclude', '.*', 'serie-v/', path]) - - -@target('serie-i', 'wazo-fanvil-serie-i') -def build_i(path): - check_call(['rsync', '-rlp', '--exclude', '.*', 'common/', path]) - - check_call(['rsync', '-rlp', '--exclude', '.*', 'serie-i/', path]) diff --git a/plugins/wazo-gigaset/build.py b/plugins/wazo-gigaset/build.py deleted file mode 100644 index 3154b20504ec1ee231f9f0f7c6837205012c2e45..0000000000000000000000000000000000000000 --- a/plugins/wazo-gigaset/build.py +++ /dev/null @@ -1,50 +0,0 @@ -# Copyright 2013-2022 The Wazo Authors (see the AUTHORS file) -# SPDX-License-Identifier: GPL-3.0-or-later - -# Depends on the following external programs: -# -rsync - -from subprocess import check_call - - -@target('N510', 'wazo-gigaset-N510') -def build_N510(path): - check_call(['rsync', '-rlp', '--exclude', '.*', 'common/', path]) - - check_call(['rsync', '-rlp', '--exclude', '.*', 'N510/', path]) - - -@target('N720', 'wazo-gigaset-N720') -def build_N720(path): - check_call(['rsync', '-rlp', '--exclude', '.*', 'common/', path]) - - check_call(['rsync', '-rlp', '--exclude', '.*', 'N720/', path]) - - -@target('N870-83.v2.39.0', 'wazo-gigaset-N870-83.v2.39.0') -def build_N870_83_v2_39_0(path): - check_call(['rsync', '-rlp', '--exclude', '.*', 'N870-83.v2.39.0/', path]) - - -@target('N870-83.v2.48.0', 'wazo-gigaset-N870-83.v2.48.0') -def build_N870_83_v2_48_0(path): - check_call(['rsync', '-rlp', '--exclude', '.*', 'N870-83.v2.48.0/', path]) - - -@target('Nx70-83.v2.49.1', 'wazo-gigaset-Nx70-83.v2.49.1') -def build_Nx70_83_v2_49_1(path): - check_call(['rsync', '-rlp', '--exclude', '.*', 'Nx70-83.v2.49.1/', path]) - - -@target('C470', 'wazo-gigaset-C470') -def build_C470(path): - check_call(['rsync', '-rlp', '--exclude', '.*', 'common-c/', path]) - - check_call(['rsync', '-rlp', '--exclude', '.*', 'C470/', path]) - - -@target('C590', 'wazo-gigaset-C590') -def build_C590(path): - check_call(['rsync', '-rlp', '--exclude', '.*', 'common-c/', path]) - - check_call(['rsync', '-rlp', '--exclude', '.*', 'C590/', path]) diff --git a/plugins/wazo-htek/build.py b/plugins/wazo-htek/build.py deleted file mode 100644 index 47a367755e4ace52885f7fcc64f433a97497c0ad..0000000000000000000000000000000000000000 --- a/plugins/wazo-htek/build.py +++ /dev/null @@ -1,23 +0,0 @@ -""" -Copyright 2017-2022 The Wazo Authors (see the AUTHORS file) -SPDX-License-Identifier: GPL-3.0-or-later - -Depends on the following external programs: - -rsync -""" - -from subprocess import check_call - - -@target('2.0.4.4.58', 'wazo-htek-2.0.4.4.58') -def build_2_0_4_4_58(path): - check_call(['rsync', '-rlp', '--exclude', '.*', 'common/', path]) - - check_call(['rsync', '-rlp', '--exclude', '.*', '2.0.4.4.58/', path]) - - -@target('2.0.4.6.41', 'wazo-htek-2.0.4.6.41') -def build_2_0_4_6_41(path): - check_call(['rsync', '-rlp', '--exclude', '.*', 'common/', path]) - - check_call(['rsync', '-rlp', '--exclude', '.*', '2.0.4.6.41/', path]) diff --git a/plugins/wazo-patton/build.py b/plugins/wazo-patton/build.py deleted file mode 100644 index 8577c26d616acf748984f9de248f415d850e78e0..0000000000000000000000000000000000000000 --- a/plugins/wazo-patton/build.py +++ /dev/null @@ -1,23 +0,0 @@ -""" -Copyright 2016-2022 The Wazo Authors (see the AUTHORS file) -SPDX-License-Identifier: GPL-3.0-or-later - -Depends on the following external programs: - -rsync -""" - -from subprocess import check_call - - -@target('6.11', 'wazo-patton-6.11') -def build_6_11(path): - check_call(['rsync', '-rlp', '--exclude', '.*', 'common/', path]) - - check_call(['rsync', '-rlp', '--exclude', '.*', '6.11/', path]) - - -@target('6.9', 'wazo-patton-6.9') -def build_6_9(path): - check_call(['rsync', '-rlp', '--exclude', '.*', 'common/', path]) - - check_call(['rsync', '-rlp', '--exclude', '.*', '6.9/', path]) diff --git a/plugins/wazo-aastra/build.py b/plugins/wazo_aastra/build.py similarity index 61% rename from plugins/wazo-aastra/build.py rename to plugins/wazo_aastra/build.py index 2b955040c5953ab1e371c2b0672e5acf47d720d5..6aa47b43f3d47a593af849cb59d17904fdbf5bb1 100644 --- a/plugins/wazo-aastra/build.py +++ b/plugins/wazo_aastra/build.py @@ -1,18 +1,29 @@ -# Copyright 2014-2022 The Wazo Authors (see the AUTHORS file) +# Copyright 2014-2023 The Wazo Authors (see the AUTHORS file) # SPDX-License-Identifier: GPL-3.0-or-later # Depends on the following external programs: # -rsync +from __future__ import annotations +from typing import TYPE_CHECKING, Callable from subprocess import check_call +if TYPE_CHECKING: + + def target( + target_id: str, plugin_id: str, std_dirs: bool = True + ) -> Callable[[str], None]: + """ + The `target` method is injected in `exec` call by the build script. + + Any error raised will be considered a build error + Current directory is the one of the bplugin script and `pg_dir` is initially empty + """ + return lambda x: None + -# target(, ) -# any error raised will be considered a build error -# Pre: pg_dir is initially empty -# Pre: current directory is the one of the bplugin @target('3.3.1-SP4', 'wazo-aastra-3.3.1-SP4') -def build_3_3_1_sp4(path): +def build_3_3_1_sp4(path: str) -> None: check_call( [ 'rsync', @@ -25,12 +36,11 @@ def build_3_3_1_sp4(path): path, ] ) - - check_call(['rsync', '-rlp', '--exclude', '.*', '3.3.1-SP4/', path]) + check_call(['rsync', '-rlp', '--exclude', '.*', 'v3_3_1_SP4/', path]) @target('4.3.0', 'wazo-aastra-4.3.0') -def build_4_3_0(path): +def build_4_3_0(path: str) -> None: check_call( [ 'rsync', @@ -45,12 +55,11 @@ def build_4_3_0(path): path, ] ) - - check_call(['rsync', '-rlp', '--exclude', '.*', '4.3.0/', path]) + check_call(['rsync', '-rlp', '--exclude', '.*', 'v4_3_0/', path]) @target('4.2.0', 'wazo-aastra-4.2.0') -def build_4_2_0(path): +def build_4_2_0(path: str) -> None: check_call( [ 'rsync', @@ -65,12 +74,11 @@ def build_4_2_0(path): path, ] ) - - check_call(['rsync', '-rlp', '--exclude', '.*', '4.2.0/', path]) + check_call(['rsync', '-rlp', '--exclude', '.*', 'v4_2_0/', path]) @target('5.0.0', 'wazo-aastra-5.0.0') -def build_5_0_0(path): +def build_5_0_0(path: str) -> None: check_call( [ 'rsync', @@ -85,12 +93,11 @@ def build_5_0_0(path): path, ] ) - - check_call(['rsync', '-rlp', '--exclude', '.*', '5.0.0/', path]) + check_call(['rsync', '-rlp', '--exclude', '.*', 'v5_0_0/', path]) @target('5.1.0', 'wazo-aastra-5.1.0') -def build_5_1_0(path): +def build_5_1_0(path: str) -> None: check_call( [ 'rsync', @@ -107,5 +114,4 @@ def build_5_1_0(path): path, ] ) - - check_call(['rsync', '-rlp', '--exclude', '.*', '5.1.0/', path]) + check_call(['rsync', '-rlp', '--exclude', '.*', 'v5_1_0/', path]) diff --git a/plugins/wazo-aastra/common/common.py b/plugins/wazo_aastra/common/common.py similarity index 100% rename from plugins/wazo-aastra/common/common.py rename to plugins/wazo_aastra/common/common.py diff --git a/plugins/wazo-aastra/common/templates/6730i.tpl b/plugins/wazo_aastra/common/templates/6730i.tpl similarity index 100% rename from plugins/wazo-aastra/common/templates/6730i.tpl rename to plugins/wazo_aastra/common/templates/6730i.tpl diff --git a/plugins/wazo-aastra/common/templates/6731i.tpl b/plugins/wazo_aastra/common/templates/6731i.tpl similarity index 100% rename from plugins/wazo-aastra/common/templates/6731i.tpl rename to plugins/wazo_aastra/common/templates/6731i.tpl diff --git a/plugins/wazo-aastra/common/templates/6735i.tpl b/plugins/wazo_aastra/common/templates/6735i.tpl similarity index 100% rename from plugins/wazo-aastra/common/templates/6735i.tpl rename to plugins/wazo_aastra/common/templates/6735i.tpl diff --git a/plugins/wazo-aastra/common/templates/6737i.tpl b/plugins/wazo_aastra/common/templates/6737i.tpl similarity index 100% rename from plugins/wazo-aastra/common/templates/6737i.tpl rename to plugins/wazo_aastra/common/templates/6737i.tpl diff --git a/plugins/wazo-aastra/common/templates/6739i.tpl b/plugins/wazo_aastra/common/templates/6739i.tpl similarity index 100% rename from plugins/wazo-aastra/common/templates/6739i.tpl rename to plugins/wazo_aastra/common/templates/6739i.tpl diff --git a/plugins/wazo-aastra/common/templates/6753i.tpl b/plugins/wazo_aastra/common/templates/6753i.tpl similarity index 100% rename from plugins/wazo-aastra/common/templates/6753i.tpl rename to plugins/wazo_aastra/common/templates/6753i.tpl diff --git a/plugins/wazo-aastra/common/templates/6755i.tpl b/plugins/wazo_aastra/common/templates/6755i.tpl similarity index 100% rename from plugins/wazo-aastra/common/templates/6755i.tpl rename to plugins/wazo_aastra/common/templates/6755i.tpl diff --git a/plugins/wazo-aastra/common/templates/6757i.tpl b/plugins/wazo_aastra/common/templates/6757i.tpl similarity index 100% rename from plugins/wazo-aastra/common/templates/6757i.tpl rename to plugins/wazo_aastra/common/templates/6757i.tpl diff --git a/plugins/wazo-aastra/common/templates/6863i.tpl b/plugins/wazo_aastra/common/templates/6863i.tpl similarity index 100% rename from plugins/wazo-aastra/common/templates/6863i.tpl rename to plugins/wazo_aastra/common/templates/6863i.tpl diff --git a/plugins/wazo-aastra/common/templates/6865i.tpl b/plugins/wazo_aastra/common/templates/6865i.tpl similarity index 100% rename from plugins/wazo-aastra/common/templates/6865i.tpl rename to plugins/wazo_aastra/common/templates/6865i.tpl diff --git a/plugins/wazo-aastra/common/templates/6867i.tpl b/plugins/wazo_aastra/common/templates/6867i.tpl similarity index 100% rename from plugins/wazo-aastra/common/templates/6867i.tpl rename to plugins/wazo_aastra/common/templates/6867i.tpl diff --git a/plugins/wazo-aastra/common/templates/6869i.tpl b/plugins/wazo_aastra/common/templates/6869i.tpl similarity index 100% rename from plugins/wazo-aastra/common/templates/6869i.tpl rename to plugins/wazo_aastra/common/templates/6869i.tpl diff --git a/plugins/wazo-aastra/common/templates/6873i.tpl b/plugins/wazo_aastra/common/templates/6873i.tpl similarity index 100% rename from plugins/wazo-aastra/common/templates/6873i.tpl rename to plugins/wazo_aastra/common/templates/6873i.tpl diff --git a/plugins/wazo-aastra/common/templates/6930.tpl b/plugins/wazo_aastra/common/templates/6930.tpl similarity index 100% rename from plugins/wazo-aastra/common/templates/6930.tpl rename to plugins/wazo_aastra/common/templates/6930.tpl diff --git a/plugins/wazo-aastra/common/templates/9143i.tpl b/plugins/wazo_aastra/common/templates/9143i.tpl similarity index 100% rename from plugins/wazo-aastra/common/templates/9143i.tpl rename to plugins/wazo_aastra/common/templates/9143i.tpl diff --git a/plugins/wazo-aastra/common/templates/9480i.tpl b/plugins/wazo_aastra/common/templates/9480i.tpl similarity index 100% rename from plugins/wazo-aastra/common/templates/9480i.tpl rename to plugins/wazo_aastra/common/templates/9480i.tpl diff --git a/plugins/wazo-aastra/common/templates/base.tpl b/plugins/wazo_aastra/common/templates/base.tpl similarity index 100% rename from plugins/wazo-aastra/common/templates/base.tpl rename to plugins/wazo_aastra/common/templates/base.tpl diff --git a/plugins/wazo-aastra/common/var/tftpboot/Aastra/aastra.cfg b/plugins/wazo_aastra/common/var/tftpboot/Aastra/aastra.cfg similarity index 100% rename from plugins/wazo-aastra/common/var/tftpboot/Aastra/aastra.cfg rename to plugins/wazo_aastra/common/var/tftpboot/Aastra/aastra.cfg diff --git a/plugins/wazo-yealink/__init__.py b/plugins/wazo_aastra/v3_3_1_SP4/__init__.py similarity index 100% rename from plugins/wazo-yealink/__init__.py rename to plugins/wazo_aastra/v3_3_1_SP4/__init__.py diff --git a/plugins/wazo-aastra/3.3.1-SP4/entry.py b/plugins/wazo_aastra/v3_3_1_SP4/entry.py similarity index 100% rename from plugins/wazo-aastra/3.3.1-SP4/entry.py rename to plugins/wazo_aastra/v3_3_1_SP4/entry.py diff --git a/plugins/wazo-aastra/3.3.1-SP4/pkgs/pkgs.db b/plugins/wazo_aastra/v3_3_1_SP4/pkgs/pkgs.db similarity index 100% rename from plugins/wazo-aastra/3.3.1-SP4/pkgs/pkgs.db rename to plugins/wazo_aastra/v3_3_1_SP4/pkgs/pkgs.db diff --git a/plugins/wazo-aastra/3.3.1-SP4/plugin-info b/plugins/wazo_aastra/v3_3_1_SP4/plugin-info similarity index 100% rename from plugins/wazo-aastra/3.3.1-SP4/plugin-info rename to plugins/wazo_aastra/v3_3_1_SP4/plugin-info diff --git a/plugins/wazo-aastra/4.2.0/entry.py b/plugins/wazo_aastra/v4_2_0/entry.py similarity index 100% rename from plugins/wazo-aastra/4.2.0/entry.py rename to plugins/wazo_aastra/v4_2_0/entry.py diff --git a/plugins/wazo-aastra/4.2.0/pkgs/pkgs.db b/plugins/wazo_aastra/v4_2_0/pkgs/pkgs.db similarity index 100% rename from plugins/wazo-aastra/4.2.0/pkgs/pkgs.db rename to plugins/wazo_aastra/v4_2_0/pkgs/pkgs.db diff --git a/plugins/wazo-aastra/4.2.0/plugin-info b/plugins/wazo_aastra/v4_2_0/plugin-info similarity index 100% rename from plugins/wazo-aastra/4.2.0/plugin-info rename to plugins/wazo_aastra/v4_2_0/plugin-info diff --git a/plugins/wazo-aastra/4.3.0/entry.py b/plugins/wazo_aastra/v4_3_0/entry.py similarity index 100% rename from plugins/wazo-aastra/4.3.0/entry.py rename to plugins/wazo_aastra/v4_3_0/entry.py diff --git a/plugins/wazo-aastra/4.3.0/pkgs/pkgs.db b/plugins/wazo_aastra/v4_3_0/pkgs/pkgs.db similarity index 100% rename from plugins/wazo-aastra/4.3.0/pkgs/pkgs.db rename to plugins/wazo_aastra/v4_3_0/pkgs/pkgs.db diff --git a/plugins/wazo-aastra/4.3.0/plugin-info b/plugins/wazo_aastra/v4_3_0/plugin-info similarity index 100% rename from plugins/wazo-aastra/4.3.0/plugin-info rename to plugins/wazo_aastra/v4_3_0/plugin-info diff --git a/plugins/wazo-aastra/5.0.0/entry.py b/plugins/wazo_aastra/v5_0_0/entry.py similarity index 100% rename from plugins/wazo-aastra/5.0.0/entry.py rename to plugins/wazo_aastra/v5_0_0/entry.py diff --git a/plugins/wazo-aastra/5.0.0/pkgs/pkgs.db b/plugins/wazo_aastra/v5_0_0/pkgs/pkgs.db similarity index 100% rename from plugins/wazo-aastra/5.0.0/pkgs/pkgs.db rename to plugins/wazo_aastra/v5_0_0/pkgs/pkgs.db diff --git a/plugins/wazo-aastra/5.0.0/plugin-info b/plugins/wazo_aastra/v5_0_0/plugin-info similarity index 100% rename from plugins/wazo-aastra/5.0.0/plugin-info rename to plugins/wazo_aastra/v5_0_0/plugin-info diff --git a/plugins/wazo-aastra/5.1.0/entry.py b/plugins/wazo_aastra/v5_1_0/entry.py similarity index 100% rename from plugins/wazo-aastra/5.1.0/entry.py rename to plugins/wazo_aastra/v5_1_0/entry.py diff --git a/plugins/wazo-aastra/5.1.0/pkgs/pkgs.db b/plugins/wazo_aastra/v5_1_0/pkgs/pkgs.db similarity index 100% rename from plugins/wazo-aastra/5.1.0/pkgs/pkgs.db rename to plugins/wazo_aastra/v5_1_0/pkgs/pkgs.db diff --git a/plugins/wazo-aastra/5.1.0/plugin-info b/plugins/wazo_aastra/v5_1_0/plugin-info similarity index 100% rename from plugins/wazo-aastra/5.1.0/plugin-info rename to plugins/wazo_aastra/v5_1_0/plugin-info diff --git a/plugins/wazo_alcatel/build.py b/plugins/wazo_alcatel/build.py new file mode 100644 index 0000000000000000000000000000000000000000..528952f19f24c5f6a0f3669300e4309d0beae7ec --- /dev/null +++ b/plugins/wazo_alcatel/build.py @@ -0,0 +1,32 @@ +# Copyright 2022-2023 The Wazo Authors (see the AUTHORS file) +# SPDX-License-Identifier: GPL-3.0-or-later + +# Depends on the following external programs: +# -rsync +from __future__ import annotations + +from typing import TYPE_CHECKING, Callable +from subprocess import check_call + +if TYPE_CHECKING: + + def target( + target_id: str, plugin_id: str, std_dirs: bool = True + ) -> Callable[[str], None]: + """The `target` method is injected in `exec` call by the build script.""" + return lambda x: None + + +@target('2.01.10', 'wazo-alcatel-2.01.10') +def build_2_01_10(path: str) -> None: + check_call(['rsync', '-rlp', '--exclude', '.*', 'v2_01_10/', path]) + + +@target('2.13.02', 'wazo-alcatel-2.13.02') +def build_2_13_02(path: str) -> None: + check_call(['rsync', '-rlp', '--exclude', '.*', 'v2_13_02/', path]) + + +@target('1.51.52', 'wazo-alcatel-1.51.52') +def build_1_51_52(path: str) -> None: + check_call(['rsync', '-rlp', '--exclude', '.*', 'v1_51_52/', path]) diff --git a/plugins/wazo-alcatel/1.51.52/common.py b/plugins/wazo_alcatel/v1_51_52/common.py similarity index 100% rename from plugins/wazo-alcatel/1.51.52/common.py rename to plugins/wazo_alcatel/v1_51_52/common.py diff --git a/plugins/wazo-alcatel/1.51.52/entry.py b/plugins/wazo_alcatel/v1_51_52/entry.py similarity index 100% rename from plugins/wazo-alcatel/1.51.52/entry.py rename to plugins/wazo_alcatel/v1_51_52/entry.py diff --git a/plugins/wazo-alcatel/1.51.52/pkgs/pkgs.db b/plugins/wazo_alcatel/v1_51_52/pkgs/pkgs.db similarity index 100% rename from plugins/wazo-alcatel/1.51.52/pkgs/pkgs.db rename to plugins/wazo_alcatel/v1_51_52/pkgs/pkgs.db diff --git a/plugins/wazo-alcatel/1.51.52/plugin-info b/plugins/wazo_alcatel/v1_51_52/plugin-info similarity index 100% rename from plugins/wazo-alcatel/1.51.52/plugin-info rename to plugins/wazo_alcatel/v1_51_52/plugin-info diff --git a/plugins/wazo-alcatel/1.51.52/templates/8028.tpl b/plugins/wazo_alcatel/v1_51_52/templates/8028.tpl similarity index 100% rename from plugins/wazo-alcatel/1.51.52/templates/8028.tpl rename to plugins/wazo_alcatel/v1_51_52/templates/8028.tpl diff --git a/plugins/wazo-alcatel/1.51.52/templates/base.tpl b/plugins/wazo_alcatel/v1_51_52/templates/base.tpl similarity index 100% rename from plugins/wazo-alcatel/1.51.52/templates/base.tpl rename to plugins/wazo_alcatel/v1_51_52/templates/base.tpl diff --git a/plugins/wazo-alcatel/1.51.52/templates/common/config.model.xml.tpl b/plugins/wazo_alcatel/v1_51_52/templates/common/config.model.xml.tpl similarity index 100% rename from plugins/wazo-alcatel/1.51.52/templates/common/config.model.xml.tpl rename to plugins/wazo_alcatel/v1_51_52/templates/common/config.model.xml.tpl diff --git a/plugins/wazo-alcatel/2.01.10/common.py b/plugins/wazo_alcatel/v2_01_10/common.py similarity index 100% rename from plugins/wazo-alcatel/2.01.10/common.py rename to plugins/wazo_alcatel/v2_01_10/common.py diff --git a/plugins/wazo-alcatel/2.01.10/entry.py b/plugins/wazo_alcatel/v2_01_10/entry.py similarity index 100% rename from plugins/wazo-alcatel/2.01.10/entry.py rename to plugins/wazo_alcatel/v2_01_10/entry.py diff --git a/plugins/wazo-alcatel/2.01.10/install.md b/plugins/wazo_alcatel/v2_01_10/install.md similarity index 100% rename from plugins/wazo-alcatel/2.01.10/install.md rename to plugins/wazo_alcatel/v2_01_10/install.md diff --git a/plugins/wazo-alcatel/2.01.10/pkgs/pkgs.db b/plugins/wazo_alcatel/v2_01_10/pkgs/pkgs.db similarity index 100% rename from plugins/wazo-alcatel/2.01.10/pkgs/pkgs.db rename to plugins/wazo_alcatel/v2_01_10/pkgs/pkgs.db diff --git a/plugins/wazo-alcatel/2.01.10/plugin-info b/plugins/wazo_alcatel/v2_01_10/plugin-info similarity index 100% rename from plugins/wazo-alcatel/2.01.10/plugin-info rename to plugins/wazo_alcatel/v2_01_10/plugin-info diff --git a/plugins/wazo-alcatel/2.01.10/templates/4008.tpl b/plugins/wazo_alcatel/v2_01_10/templates/4008.tpl similarity index 100% rename from plugins/wazo-alcatel/2.01.10/templates/4008.tpl rename to plugins/wazo_alcatel/v2_01_10/templates/4008.tpl diff --git a/plugins/wazo-alcatel/2.01.10/templates/4018.tpl b/plugins/wazo_alcatel/v2_01_10/templates/4018.tpl similarity index 100% rename from plugins/wazo-alcatel/2.01.10/templates/4018.tpl rename to plugins/wazo_alcatel/v2_01_10/templates/4018.tpl diff --git a/plugins/wazo-alcatel/2.01.10/templates/base.tpl b/plugins/wazo_alcatel/v2_01_10/templates/base.tpl similarity index 100% rename from plugins/wazo-alcatel/2.01.10/templates/base.tpl rename to plugins/wazo_alcatel/v2_01_10/templates/base.tpl diff --git a/plugins/wazo-alcatel/2.01.10/var/tftpboot/lanpbx.cfg b/plugins/wazo_alcatel/v2_01_10/var/tftpboot/lanpbx.cfg similarity index 100% rename from plugins/wazo-alcatel/2.01.10/var/tftpboot/lanpbx.cfg rename to plugins/wazo_alcatel/v2_01_10/var/tftpboot/lanpbx.cfg diff --git a/plugins/wazo-alcatel/2.01.10/var/tftpboot/sipconfig.txt b/plugins/wazo_alcatel/v2_01_10/var/tftpboot/sipconfig.txt similarity index 100% rename from plugins/wazo-alcatel/2.01.10/var/tftpboot/sipconfig.txt rename to plugins/wazo_alcatel/v2_01_10/var/tftpboot/sipconfig.txt diff --git a/plugins/wazo-alcatel/2.13.02/common.py b/plugins/wazo_alcatel/v2_13_02/common.py similarity index 100% rename from plugins/wazo-alcatel/2.13.02/common.py rename to plugins/wazo_alcatel/v2_13_02/common.py diff --git a/plugins/wazo-alcatel/2.13.02/entry.py b/plugins/wazo_alcatel/v2_13_02/entry.py similarity index 100% rename from plugins/wazo-alcatel/2.13.02/entry.py rename to plugins/wazo_alcatel/v2_13_02/entry.py diff --git a/plugins/wazo-alcatel/2.13.02/pkgs/pkgs.db b/plugins/wazo_alcatel/v2_13_02/pkgs/pkgs.db similarity index 100% rename from plugins/wazo-alcatel/2.13.02/pkgs/pkgs.db rename to plugins/wazo_alcatel/v2_13_02/pkgs/pkgs.db diff --git a/plugins/wazo-alcatel/2.13.02/plugin-info b/plugins/wazo_alcatel/v2_13_02/plugin-info similarity index 100% rename from plugins/wazo-alcatel/2.13.02/plugin-info rename to plugins/wazo_alcatel/v2_13_02/plugin-info diff --git a/plugins/wazo-alcatel/2.13.02/templates/M3.tpl b/plugins/wazo_alcatel/v2_13_02/templates/M3.tpl similarity index 100% rename from plugins/wazo-alcatel/2.13.02/templates/M3.tpl rename to plugins/wazo_alcatel/v2_13_02/templates/M3.tpl diff --git a/plugins/wazo-alcatel/2.13.02/templates/M5.tpl b/plugins/wazo_alcatel/v2_13_02/templates/M5.tpl similarity index 100% rename from plugins/wazo-alcatel/2.13.02/templates/M5.tpl rename to plugins/wazo_alcatel/v2_13_02/templates/M5.tpl diff --git a/plugins/wazo-alcatel/2.13.02/templates/M7.tpl b/plugins/wazo_alcatel/v2_13_02/templates/M7.tpl similarity index 100% rename from plugins/wazo-alcatel/2.13.02/templates/M7.tpl rename to plugins/wazo_alcatel/v2_13_02/templates/M7.tpl diff --git a/plugins/wazo-alcatel/2.13.02/templates/base.tpl b/plugins/wazo_alcatel/v2_13_02/templates/base.tpl similarity index 100% rename from plugins/wazo-alcatel/2.13.02/templates/base.tpl rename to plugins/wazo_alcatel/v2_13_02/templates/base.tpl diff --git a/plugins/wazo-alcatel/2.13.02/templates/common/config.model.xml.tpl b/plugins/wazo_alcatel/v2_13_02/templates/common/config.model.xml.tpl similarity index 100% rename from plugins/wazo-alcatel/2.13.02/templates/common/config.model.xml.tpl rename to plugins/wazo_alcatel/v2_13_02/templates/common/config.model.xml.tpl diff --git a/plugins/wazo-avaya/build.py b/plugins/wazo_avaya/build.py similarity index 63% rename from plugins/wazo-avaya/build.py rename to plugins/wazo_avaya/build.py index 8de3055a07cc2293d7278dfc302415e08a95e549..634d32956df2dfcb818b680268bacec52dde29ef 100644 --- a/plugins/wazo-avaya/build.py +++ b/plugins/wazo_avaya/build.py @@ -1,4 +1,4 @@ -# Copyright (C) 2013-2022 The Wazo Authors (see the AUTHORS file) +# Copyright 2013-2023 The Wazo Authors (see the AUTHORS file) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -15,12 +15,21 @@ # Depends on the following external programs: # -rsync +from __future__ import annotations +from typing import TYPE_CHECKING, Callable from subprocess import check_call +if TYPE_CHECKING: + + def target( + target_id: str, plugin_id: str, std_dirs: bool = True + ) -> Callable[[str], None]: + """The `target` method is injected in `exec` call by the build script.""" + return lambda x: None + @target('4.1.13', 'wazo-avaya-4.1.13') -def build_4_1_13(path): +def build_4_1_13(path: str) -> None: check_call(['rsync', '-rlp', '--exclude', '.*', 'common/', path]) - - check_call(['rsync', '-rlp', '--exclude', '.*', '4.1.13/', path]) + check_call(['rsync', '-rlp', '--exclude', '.*', 'v4_1_13/', path]) diff --git a/plugins/wazo-avaya/common/common.py b/plugins/wazo_avaya/common/common.py similarity index 100% rename from plugins/wazo-avaya/common/common.py rename to plugins/wazo_avaya/common/common.py diff --git a/plugins/wazo-avaya/common/templates/1220IP.tpl b/plugins/wazo_avaya/common/templates/1220IP.tpl similarity index 100% rename from plugins/wazo-avaya/common/templates/1220IP.tpl rename to plugins/wazo_avaya/common/templates/1220IP.tpl diff --git a/plugins/wazo-avaya/common/templates/1230IP.tpl b/plugins/wazo_avaya/common/templates/1230IP.tpl similarity index 100% rename from plugins/wazo-avaya/common/templates/1230IP.tpl rename to plugins/wazo_avaya/common/templates/1230IP.tpl diff --git a/plugins/wazo-avaya/common/templates/base.tpl b/plugins/wazo_avaya/common/templates/base.tpl similarity index 100% rename from plugins/wazo-avaya/common/templates/base.tpl rename to plugins/wazo_avaya/common/templates/base.tpl diff --git a/plugins/wazo-avaya/common/var/tftpboot/DeviceConfig.cfg b/plugins/wazo_avaya/common/var/tftpboot/DeviceConfig.cfg similarity index 100% rename from plugins/wazo-avaya/common/var/tftpboot/DeviceConfig.cfg rename to plugins/wazo_avaya/common/var/tftpboot/DeviceConfig.cfg diff --git a/plugins/wazo-avaya/4.1.13/entry.py b/plugins/wazo_avaya/v4_1_13/entry.py similarity index 100% rename from plugins/wazo-avaya/4.1.13/entry.py rename to plugins/wazo_avaya/v4_1_13/entry.py diff --git a/plugins/wazo-avaya/4.1.13/install.md b/plugins/wazo_avaya/v4_1_13/install.md similarity index 100% rename from plugins/wazo-avaya/4.1.13/install.md rename to plugins/wazo_avaya/v4_1_13/install.md diff --git a/plugins/wazo-avaya/4.1.13/limitations.md b/plugins/wazo_avaya/v4_1_13/limitations.md similarity index 100% rename from plugins/wazo-avaya/4.1.13/limitations.md rename to plugins/wazo_avaya/v4_1_13/limitations.md diff --git a/plugins/wazo-avaya/4.1.13/pkgs/pkgs.db b/plugins/wazo_avaya/v4_1_13/pkgs/pkgs.db similarity index 100% rename from plugins/wazo-avaya/4.1.13/pkgs/pkgs.db rename to plugins/wazo_avaya/v4_1_13/pkgs/pkgs.db diff --git a/plugins/wazo-avaya/4.1.13/plugin-info b/plugins/wazo_avaya/v4_1_13/plugin-info similarity index 100% rename from plugins/wazo-avaya/4.1.13/plugin-info rename to plugins/wazo_avaya/v4_1_13/plugin-info diff --git a/plugins/wazo-avaya/4.1.13/var/tftpboot/1220.cfg b/plugins/wazo_avaya/v4_1_13/var/tftpboot/1220.cfg similarity index 100% rename from plugins/wazo-avaya/4.1.13/var/tftpboot/1220.cfg rename to plugins/wazo_avaya/v4_1_13/var/tftpboot/1220.cfg diff --git a/plugins/wazo-avaya/4.1.13/var/tftpboot/1220SIP.cfg b/plugins/wazo_avaya/v4_1_13/var/tftpboot/1220SIP.cfg similarity index 100% rename from plugins/wazo-avaya/4.1.13/var/tftpboot/1220SIP.cfg rename to plugins/wazo_avaya/v4_1_13/var/tftpboot/1220SIP.cfg diff --git a/plugins/wazo-avaya/4.1.13/var/tftpboot/1230.cfg b/plugins/wazo_avaya/v4_1_13/var/tftpboot/1230.cfg similarity index 100% rename from plugins/wazo-avaya/4.1.13/var/tftpboot/1230.cfg rename to plugins/wazo_avaya/v4_1_13/var/tftpboot/1230.cfg diff --git a/plugins/wazo-avaya/4.1.13/var/tftpboot/1230SIP.cfg b/plugins/wazo_avaya/v4_1_13/var/tftpboot/1230SIP.cfg similarity index 100% rename from plugins/wazo-avaya/4.1.13/var/tftpboot/1230SIP.cfg rename to plugins/wazo_avaya/v4_1_13/var/tftpboot/1230SIP.cfg diff --git a/plugins/wazo-cisco-sccp/build.py b/plugins/wazo_cisco_sccp/build.py similarity index 61% rename from plugins/wazo-cisco-sccp/build.py rename to plugins/wazo_cisco_sccp/build.py index 22b3648f9f2f7ab93656a05c84434085fe0d1e91..2655e8affcca4aab14d621a8072424a371d47787 100644 --- a/plugins/wazo-cisco-sccp/build.py +++ b/plugins/wazo_cisco_sccp/build.py @@ -1,4 +1,4 @@ -# Copyright (C) 2013-2022 The Wazo Authors (see the AUTHORS file) +# Copyright 2013-2023 The Wazo Authors (see the AUTHORS file) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -15,40 +15,45 @@ # Depends on the following external programs: # -rsync +from __future__ import annotations +from typing import TYPE_CHECKING, Callable from subprocess import check_call +if TYPE_CHECKING: + + def target( + target_id: str, plugin_id: str, std_dirs: bool = True + ) -> Callable[[str], None]: + """The `target` method is injected in `exec` call by the build script.""" + return lambda x: None + @target('8.5.2', 'wazo-cisco-sccp-8.5.2') -def build_8_5_2(path): +def build_8_5_2(path: str) -> None: check_call(['rsync', '-rlp', '--exclude', '.*', 'common/', path]) - - check_call(['rsync', '-rlp', '--exclude', '.*', '8.5.2/', path]) + check_call(['rsync', '-rlp', '--exclude', '.*', 'v8_5_2/', path]) @target('9.4', 'wazo-cisco-sccp-9.4') -def build_9_4(path): +def build_9_4(path: str) -> None: check_call(['rsync', '-rlp', '--exclude', '.*', 'common/', path]) - - check_call(['rsync', '-rlp', '--exclude', '.*', '9.4/', path]) + check_call(['rsync', '-rlp', '--exclude', '.*', 'v9_4/', path]) @target('cipc-2.1.2', 'wazo-cisco-sccp-cipc-2.1.2') -def build_cipc_2_1_2(path): +def build_cipc_2_1_2(path: str) -> None: check_call(['rsync', '-rlp', '--exclude', '.*', 'common/', path]) - - check_call(['rsync', '-rlp', '--exclude', '.*', 'cipc-2.1.2/', path]) + check_call(['rsync', '-rlp', '--exclude', '.*', 'cipc_v2_1_2/', path]) @target('legacy', 'wazo-cisco-sccp-legacy') -def build_legacy(path): +def build_legacy(path: str) -> None: check_call(['rsync', '-rlp', '--exclude', '.*', 'common/', path]) - check_call(['rsync', '-rlp', '--exclude', '.*', 'legacy/', path]) @target('wireless-1.4.5', 'wazo-cisco-sccp-wireless-1.4.5') -def build_wireless(path): +def build_wireless(path: str) -> None: check_call(['rsync', '-rlp', '--exclude', '.*', 'common/', path]) - - check_call(['rsync', '-rlp', '--exclude', '.*', 'wireless-1.4.5/', path]) + check_call(['rsync', '-rlp', '--exclude', '.*', 'wireless_v1_4_5/', path]) diff --git a/plugins/wazo-cisco-sccp/cipc-2.1.2/entry.py b/plugins/wazo_cisco_sccp/cipc_v2_1_2/entry.py similarity index 100% rename from plugins/wazo-cisco-sccp/cipc-2.1.2/entry.py rename to plugins/wazo_cisco_sccp/cipc_v2_1_2/entry.py diff --git a/plugins/wazo-cisco-sccp/cipc-2.1.2/pkgs/pkgs.db b/plugins/wazo_cisco_sccp/cipc_v2_1_2/pkgs/pkgs.db similarity index 100% rename from plugins/wazo-cisco-sccp/cipc-2.1.2/pkgs/pkgs.db rename to plugins/wazo_cisco_sccp/cipc_v2_1_2/pkgs/pkgs.db diff --git a/plugins/wazo-cisco-sccp/cipc-2.1.2/plugin-info b/plugins/wazo_cisco_sccp/cipc_v2_1_2/plugin-info similarity index 100% rename from plugins/wazo-cisco-sccp/cipc-2.1.2/plugin-info rename to plugins/wazo_cisco_sccp/cipc_v2_1_2/plugin-info diff --git a/plugins/wazo-cisco-sccp/cipc-2.1.2/templates/CIPC.tpl b/plugins/wazo_cisco_sccp/cipc_v2_1_2/templates/CIPC.tpl similarity index 100% rename from plugins/wazo-cisco-sccp/cipc-2.1.2/templates/CIPC.tpl rename to plugins/wazo_cisco_sccp/cipc_v2_1_2/templates/CIPC.tpl diff --git a/plugins/wazo-cisco-sccp/common/common.py b/plugins/wazo_cisco_sccp/common/common.py similarity index 100% rename from plugins/wazo-cisco-sccp/common/common.py rename to plugins/wazo_cisco_sccp/common/common.py diff --git a/plugins/wazo-cisco-sccp/common/templates/base.tpl b/plugins/wazo_cisco_sccp/common/templates/base.tpl similarity index 100% rename from plugins/wazo-cisco-sccp/common/templates/base.tpl rename to plugins/wazo_cisco_sccp/common/templates/base.tpl diff --git a/plugins/wazo-cisco-sccp/legacy/entry.py b/plugins/wazo_cisco_sccp/legacy/entry.py similarity index 100% rename from plugins/wazo-cisco-sccp/legacy/entry.py rename to plugins/wazo_cisco_sccp/legacy/entry.py diff --git a/plugins/wazo-cisco-sccp/legacy/pkgs/pkgs.db b/plugins/wazo_cisco_sccp/legacy/pkgs/pkgs.db similarity index 100% rename from plugins/wazo-cisco-sccp/legacy/pkgs/pkgs.db rename to plugins/wazo_cisco_sccp/legacy/pkgs/pkgs.db diff --git a/plugins/wazo-cisco-sccp/legacy/plugin-info b/plugins/wazo_cisco_sccp/legacy/plugin-info similarity index 100% rename from plugins/wazo-cisco-sccp/legacy/plugin-info rename to plugins/wazo_cisco_sccp/legacy/plugin-info diff --git a/plugins/wazo-cisco-sccp/legacy/templates/7905G.tpl b/plugins/wazo_cisco_sccp/legacy/templates/7905G.tpl similarity index 100% rename from plugins/wazo-cisco-sccp/legacy/templates/7905G.tpl rename to plugins/wazo_cisco_sccp/legacy/templates/7905G.tpl diff --git a/plugins/wazo-cisco-sccp/legacy/templates/7912G.tpl b/plugins/wazo_cisco_sccp/legacy/templates/7912G.tpl similarity index 100% rename from plugins/wazo-cisco-sccp/legacy/templates/7912G.tpl rename to plugins/wazo_cisco_sccp/legacy/templates/7912G.tpl diff --git a/plugins/wazo-cisco-sccp/legacy/templates/7920.tpl b/plugins/wazo_cisco_sccp/legacy/templates/7920.tpl similarity index 100% rename from plugins/wazo-cisco-sccp/legacy/templates/7920.tpl rename to plugins/wazo_cisco_sccp/legacy/templates/7920.tpl diff --git a/plugins/wazo-cisco-sccp/legacy/templates/7937G.tpl b/plugins/wazo_cisco_sccp/legacy/templates/7937G.tpl similarity index 100% rename from plugins/wazo-cisco-sccp/legacy/templates/7937G.tpl rename to plugins/wazo_cisco_sccp/legacy/templates/7937G.tpl diff --git a/plugins/wazo-cisco-sccp/legacy/templates/7940.tpl b/plugins/wazo_cisco_sccp/legacy/templates/7940.tpl similarity index 100% rename from plugins/wazo-cisco-sccp/legacy/templates/7940.tpl rename to plugins/wazo_cisco_sccp/legacy/templates/7940.tpl diff --git a/plugins/wazo-cisco-sccp/legacy/templates/7940G.tpl b/plugins/wazo_cisco_sccp/legacy/templates/7940G.tpl similarity index 100% rename from plugins/wazo-cisco-sccp/legacy/templates/7940G.tpl rename to plugins/wazo_cisco_sccp/legacy/templates/7940G.tpl diff --git a/plugins/wazo-cisco-sccp/legacy/templates/7960G.tpl b/plugins/wazo_cisco_sccp/legacy/templates/7960G.tpl similarity index 100% rename from plugins/wazo-cisco-sccp/legacy/templates/7960G.tpl rename to plugins/wazo_cisco_sccp/legacy/templates/7960G.tpl diff --git a/plugins/wazo-cisco-sccp/legacy/var/tftpboot/DISTINCTIVERINGLIST.XML b/plugins/wazo_cisco_sccp/legacy/var/tftpboot/DISTINCTIVERINGLIST.XML similarity index 100% rename from plugins/wazo-cisco-sccp/legacy/var/tftpboot/DISTINCTIVERINGLIST.XML rename to plugins/wazo_cisco_sccp/legacy/var/tftpboot/DISTINCTIVERINGLIST.XML diff --git a/plugins/wazo-cisco-sccp/legacy/var/tftpboot/RINGLIST.XML b/plugins/wazo_cisco_sccp/legacy/var/tftpboot/RINGLIST.XML similarity index 100% rename from plugins/wazo-cisco-sccp/legacy/var/tftpboot/RINGLIST.XML rename to plugins/wazo_cisco_sccp/legacy/var/tftpboot/RINGLIST.XML diff --git a/plugins/wazo-cisco-sccp/legacy/var/tftpboot/Ringlist.xml b/plugins/wazo_cisco_sccp/legacy/var/tftpboot/Ringlist.xml similarity index 100% rename from plugins/wazo-cisco-sccp/legacy/var/tftpboot/Ringlist.xml rename to plugins/wazo_cisco_sccp/legacy/var/tftpboot/Ringlist.xml diff --git a/plugins/wazo-cisco-sccp/legacy/var/tftpboot/i18n/french_france/7905-font.xml b/plugins/wazo_cisco_sccp/legacy/var/tftpboot/i18n/french_france/7905-font.xml similarity index 100% rename from plugins/wazo-cisco-sccp/legacy/var/tftpboot/i18n/french_france/7905-font.xml rename to plugins/wazo_cisco_sccp/legacy/var/tftpboot/i18n/french_france/7905-font.xml diff --git a/plugins/wazo-cisco-sccp/8.5.2/entry.py b/plugins/wazo_cisco_sccp/v8_5_2/entry.py similarity index 100% rename from plugins/wazo-cisco-sccp/8.5.2/entry.py rename to plugins/wazo_cisco_sccp/v8_5_2/entry.py diff --git a/plugins/wazo-cisco-sccp/8.5.2/install.md b/plugins/wazo_cisco_sccp/v8_5_2/install.md similarity index 100% rename from plugins/wazo-cisco-sccp/8.5.2/install.md rename to plugins/wazo_cisco_sccp/v8_5_2/install.md diff --git a/plugins/wazo-cisco-sccp/8.5.2/pkgs/pkgs.db b/plugins/wazo_cisco_sccp/v8_5_2/pkgs/pkgs.db similarity index 100% rename from plugins/wazo-cisco-sccp/8.5.2/pkgs/pkgs.db rename to plugins/wazo_cisco_sccp/v8_5_2/pkgs/pkgs.db diff --git a/plugins/wazo-cisco-sccp/8.5.2/plugin-info b/plugins/wazo_cisco_sccp/v8_5_2/plugin-info similarity index 100% rename from plugins/wazo-cisco-sccp/8.5.2/plugin-info rename to plugins/wazo_cisco_sccp/v8_5_2/plugin-info diff --git a/plugins/wazo-cisco-sccp/8.5.2/templates/7906G.tpl b/plugins/wazo_cisco_sccp/v8_5_2/templates/7906G.tpl similarity index 100% rename from plugins/wazo-cisco-sccp/8.5.2/templates/7906G.tpl rename to plugins/wazo_cisco_sccp/v8_5_2/templates/7906G.tpl diff --git a/plugins/wazo-cisco-sccp/8.5.2/templates/7911G.tpl b/plugins/wazo_cisco_sccp/v8_5_2/templates/7911G.tpl similarity index 100% rename from plugins/wazo-cisco-sccp/8.5.2/templates/7911G.tpl rename to plugins/wazo_cisco_sccp/v8_5_2/templates/7911G.tpl diff --git a/plugins/wazo-cisco-sccp/8.5.2/templates/7931G.tpl b/plugins/wazo_cisco_sccp/v8_5_2/templates/7931G.tpl similarity index 100% rename from plugins/wazo-cisco-sccp/8.5.2/templates/7931G.tpl rename to plugins/wazo_cisco_sccp/v8_5_2/templates/7931G.tpl diff --git a/plugins/wazo-cisco-sccp/8.5.2/templates/7941G.tpl b/plugins/wazo_cisco_sccp/v8_5_2/templates/7941G.tpl similarity index 100% rename from plugins/wazo-cisco-sccp/8.5.2/templates/7941G.tpl rename to plugins/wazo_cisco_sccp/v8_5_2/templates/7941G.tpl diff --git a/plugins/wazo-cisco-sccp/8.5.2/templates/7942G.tpl b/plugins/wazo_cisco_sccp/v8_5_2/templates/7942G.tpl similarity index 100% rename from plugins/wazo-cisco-sccp/8.5.2/templates/7942G.tpl rename to plugins/wazo_cisco_sccp/v8_5_2/templates/7942G.tpl diff --git a/plugins/wazo-cisco-sccp/8.5.2/templates/7945G.tpl b/plugins/wazo_cisco_sccp/v8_5_2/templates/7945G.tpl similarity index 100% rename from plugins/wazo-cisco-sccp/8.5.2/templates/7945G.tpl rename to plugins/wazo_cisco_sccp/v8_5_2/templates/7945G.tpl diff --git a/plugins/wazo-cisco-sccp/8.5.2/templates/7961G.tpl b/plugins/wazo_cisco_sccp/v8_5_2/templates/7961G.tpl similarity index 100% rename from plugins/wazo-cisco-sccp/8.5.2/templates/7961G.tpl rename to plugins/wazo_cisco_sccp/v8_5_2/templates/7961G.tpl diff --git a/plugins/wazo-cisco-sccp/8.5.2/templates/7962G.tpl b/plugins/wazo_cisco_sccp/v8_5_2/templates/7962G.tpl similarity index 100% rename from plugins/wazo-cisco-sccp/8.5.2/templates/7962G.tpl rename to plugins/wazo_cisco_sccp/v8_5_2/templates/7962G.tpl diff --git a/plugins/wazo-cisco-sccp/8.5.2/templates/7965G.tpl b/plugins/wazo_cisco_sccp/v8_5_2/templates/7965G.tpl similarity index 100% rename from plugins/wazo-cisco-sccp/8.5.2/templates/7965G.tpl rename to plugins/wazo_cisco_sccp/v8_5_2/templates/7965G.tpl diff --git a/plugins/wazo-cisco-sccp/8.5.2/templates/7970G.tpl b/plugins/wazo_cisco_sccp/v8_5_2/templates/7970G.tpl similarity index 100% rename from plugins/wazo-cisco-sccp/8.5.2/templates/7970G.tpl rename to plugins/wazo_cisco_sccp/v8_5_2/templates/7970G.tpl diff --git a/plugins/wazo-cisco-sccp/8.5.2/templates/7971G.tpl b/plugins/wazo_cisco_sccp/v8_5_2/templates/7971G.tpl similarity index 100% rename from plugins/wazo-cisco-sccp/8.5.2/templates/7971G.tpl rename to plugins/wazo_cisco_sccp/v8_5_2/templates/7971G.tpl diff --git a/plugins/wazo-cisco-sccp/8.5.2/templates/7975G.tpl b/plugins/wazo_cisco_sccp/v8_5_2/templates/7975G.tpl similarity index 100% rename from plugins/wazo-cisco-sccp/8.5.2/templates/7975G.tpl rename to plugins/wazo_cisco_sccp/v8_5_2/templates/7975G.tpl diff --git a/plugins/wazo-cisco-sccp/9.4/entry.py b/plugins/wazo_cisco_sccp/v9_4/entry.py similarity index 100% rename from plugins/wazo-cisco-sccp/9.4/entry.py rename to plugins/wazo_cisco_sccp/v9_4/entry.py diff --git a/plugins/wazo-cisco-sccp/9.4/install.md b/plugins/wazo_cisco_sccp/v9_4/install.md similarity index 100% rename from plugins/wazo-cisco-sccp/9.4/install.md rename to plugins/wazo_cisco_sccp/v9_4/install.md diff --git a/plugins/wazo-cisco-sccp/9.4/limitations.md b/plugins/wazo_cisco_sccp/v9_4/limitations.md similarity index 100% rename from plugins/wazo-cisco-sccp/9.4/limitations.md rename to plugins/wazo_cisco_sccp/v9_4/limitations.md diff --git a/plugins/wazo-cisco-sccp/9.4/pkgs/pkgs.db b/plugins/wazo_cisco_sccp/v9_4/pkgs/pkgs.db similarity index 100% rename from plugins/wazo-cisco-sccp/9.4/pkgs/pkgs.db rename to plugins/wazo_cisco_sccp/v9_4/pkgs/pkgs.db diff --git a/plugins/wazo-cisco-sccp/9.4/plugin-info b/plugins/wazo_cisco_sccp/v9_4/plugin-info similarity index 100% rename from plugins/wazo-cisco-sccp/9.4/plugin-info rename to plugins/wazo_cisco_sccp/v9_4/plugin-info diff --git a/plugins/wazo-cisco-sccp/9.4/templates/7906G.tpl b/plugins/wazo_cisco_sccp/v9_4/templates/7906G.tpl similarity index 100% rename from plugins/wazo-cisco-sccp/9.4/templates/7906G.tpl rename to plugins/wazo_cisco_sccp/v9_4/templates/7906G.tpl diff --git a/plugins/wazo-cisco-sccp/9.4/templates/7911G.tpl b/plugins/wazo_cisco_sccp/v9_4/templates/7911G.tpl similarity index 100% rename from plugins/wazo-cisco-sccp/9.4/templates/7911G.tpl rename to plugins/wazo_cisco_sccp/v9_4/templates/7911G.tpl diff --git a/plugins/wazo-cisco-sccp/9.4/templates/7931G.tpl b/plugins/wazo_cisco_sccp/v9_4/templates/7931G.tpl similarity index 100% rename from plugins/wazo-cisco-sccp/9.4/templates/7931G.tpl rename to plugins/wazo_cisco_sccp/v9_4/templates/7931G.tpl diff --git a/plugins/wazo-cisco-sccp/9.4/templates/7941G.tpl b/plugins/wazo_cisco_sccp/v9_4/templates/7941G.tpl similarity index 100% rename from plugins/wazo-cisco-sccp/9.4/templates/7941G.tpl rename to plugins/wazo_cisco_sccp/v9_4/templates/7941G.tpl diff --git a/plugins/wazo-cisco-sccp/9.4/templates/7942G.tpl b/plugins/wazo_cisco_sccp/v9_4/templates/7942G.tpl similarity index 100% rename from plugins/wazo-cisco-sccp/9.4/templates/7942G.tpl rename to plugins/wazo_cisco_sccp/v9_4/templates/7942G.tpl diff --git a/plugins/wazo-cisco-sccp/9.4/templates/7945G.tpl b/plugins/wazo_cisco_sccp/v9_4/templates/7945G.tpl similarity index 100% rename from plugins/wazo-cisco-sccp/9.4/templates/7945G.tpl rename to plugins/wazo_cisco_sccp/v9_4/templates/7945G.tpl diff --git a/plugins/wazo-cisco-sccp/9.4/templates/7961G.tpl b/plugins/wazo_cisco_sccp/v9_4/templates/7961G.tpl similarity index 100% rename from plugins/wazo-cisco-sccp/9.4/templates/7961G.tpl rename to plugins/wazo_cisco_sccp/v9_4/templates/7961G.tpl diff --git a/plugins/wazo-cisco-sccp/9.4/templates/7962G.tpl b/plugins/wazo_cisco_sccp/v9_4/templates/7962G.tpl similarity index 100% rename from plugins/wazo-cisco-sccp/9.4/templates/7962G.tpl rename to plugins/wazo_cisco_sccp/v9_4/templates/7962G.tpl diff --git a/plugins/wazo-cisco-sccp/9.4/templates/7965G.tpl b/plugins/wazo_cisco_sccp/v9_4/templates/7965G.tpl similarity index 100% rename from plugins/wazo-cisco-sccp/9.4/templates/7965G.tpl rename to plugins/wazo_cisco_sccp/v9_4/templates/7965G.tpl diff --git a/plugins/wazo-cisco-sccp/9.4/templates/7970G.tpl b/plugins/wazo_cisco_sccp/v9_4/templates/7970G.tpl similarity index 100% rename from plugins/wazo-cisco-sccp/9.4/templates/7970G.tpl rename to plugins/wazo_cisco_sccp/v9_4/templates/7970G.tpl diff --git a/plugins/wazo-cisco-sccp/9.4/templates/7971G.tpl b/plugins/wazo_cisco_sccp/v9_4/templates/7971G.tpl similarity index 100% rename from plugins/wazo-cisco-sccp/9.4/templates/7971G.tpl rename to plugins/wazo_cisco_sccp/v9_4/templates/7971G.tpl diff --git a/plugins/wazo-cisco-sccp/wireless-1.4.5/entry.py b/plugins/wazo_cisco_sccp/wireless_v1_4_5/entry.py similarity index 100% rename from plugins/wazo-cisco-sccp/wireless-1.4.5/entry.py rename to plugins/wazo_cisco_sccp/wireless_v1_4_5/entry.py diff --git a/plugins/wazo-cisco-sccp/wireless-1.4.5/pkgs/pkgs.db b/plugins/wazo_cisco_sccp/wireless_v1_4_5/pkgs/pkgs.db similarity index 100% rename from plugins/wazo-cisco-sccp/wireless-1.4.5/pkgs/pkgs.db rename to plugins/wazo_cisco_sccp/wireless_v1_4_5/pkgs/pkgs.db diff --git a/plugins/wazo-cisco-sccp/wireless-1.4.5/plugin-info b/plugins/wazo_cisco_sccp/wireless_v1_4_5/plugin-info similarity index 100% rename from plugins/wazo-cisco-sccp/wireless-1.4.5/plugin-info rename to plugins/wazo_cisco_sccp/wireless_v1_4_5/plugin-info diff --git a/plugins/wazo-cisco-sccp/wireless-1.4.5/templates/7921G.tpl b/plugins/wazo_cisco_sccp/wireless_v1_4_5/templates/7921G.tpl similarity index 100% rename from plugins/wazo-cisco-sccp/wireless-1.4.5/templates/7921G.tpl rename to plugins/wazo_cisco_sccp/wireless_v1_4_5/templates/7921G.tpl diff --git a/plugins/wazo_cisco_sip/build.py b/plugins/wazo_cisco_sip/build.py new file mode 100644 index 0000000000000000000000000000000000000000..23590cc4b2bef24edb5ccf7465e3b81ce4ed90f7 --- /dev/null +++ b/plugins/wazo_cisco_sip/build.py @@ -0,0 +1,38 @@ +# Copyright 2018-2023 The Wazo Authors (see the AUTHORS file) +# SPDX-License-Identifier: GPL-3.0-or-later + +# Depends on the following external programs: +# -rsync +from __future__ import annotations + +from typing import TYPE_CHECKING, Callable +from subprocess import check_call + +if TYPE_CHECKING: + + def target( + target_id: str, plugin_id: str, std_dirs: bool = True + ) -> Callable[[str], None]: + """The `target` method is injected in `exec` call by the build script.""" + return lambda x: None + + +@target('9.3', 'wazo-cisco-sip-9.3') +def build_9_3(path: str) -> None: + check_call(['rsync', '-rlp', '--exclude', '.*', 'common/', path]) + check_call(['rsync', '-rlp', '--exclude', '.*', 'v9_3/', path]) + + +@target('11.1.0', 'wazo-cisco-sip-11.1.0') +def build_11_1_0(path: str) -> None: + check_call(['rsync', '-rlp', '--exclude', '.*', 'v11_1_0/', path]) + + +@target('11.3.1', 'wazo-cisco-sip-11.3.1') +def build_11_3_1(path: str) -> None: + check_call(['rsync', '-rlp', '--exclude', '.*', 'v11_3_1/', path]) + + +@target('12.0.1', 'wazo-cisco-sip-12.0.1') +def build_12_0_1(path: str) -> None: + check_call(['rsync', '-rlp', '--exclude', '.*', 'v12_0_1/', path]) diff --git a/plugins/wazo-cisco-sip/common/common.py b/plugins/wazo_cisco_sip/common/common.py similarity index 100% rename from plugins/wazo-cisco-sip/common/common.py rename to plugins/wazo_cisco_sip/common/common.py diff --git a/plugins/wazo-cisco-sip/common/templates/base.tpl b/plugins/wazo_cisco_sip/common/templates/base.tpl similarity index 100% rename from plugins/wazo-cisco-sip/common/templates/base.tpl rename to plugins/wazo_cisco_sip/common/templates/base.tpl diff --git a/plugins/wazo-cisco-sip/common/var/tftpboot/SoftKeys.xml b/plugins/wazo_cisco_sip/common/var/tftpboot/SoftKeys.xml similarity index 100% rename from plugins/wazo-cisco-sip/common/var/tftpboot/SoftKeys.xml rename to plugins/wazo_cisco_sip/common/var/tftpboot/SoftKeys.xml diff --git a/plugins/wazo-cisco-sip/common/var/tftpboot/dialplan.xml b/plugins/wazo_cisco_sip/common/var/tftpboot/dialplan.xml similarity index 100% rename from plugins/wazo-cisco-sip/common/var/tftpboot/dialplan.xml rename to plugins/wazo_cisco_sip/common/var/tftpboot/dialplan.xml diff --git a/plugins/wazo-cisco-sip/limitations.md b/plugins/wazo_cisco_sip/limitations.md similarity index 100% rename from plugins/wazo-cisco-sip/limitations.md rename to plugins/wazo_cisco_sip/limitations.md diff --git a/plugins/wazo-cisco-sip/11.1.0/common.py b/plugins/wazo_cisco_sip/v11_1_0/common.py similarity index 96% rename from plugins/wazo-cisco-sip/11.1.0/common.py rename to plugins/wazo_cisco_sip/v11_1_0/common.py index 1eaa35ae61a6e1fdbc06504e51266f3e70024a11..48e7b3e56791cd4318d0d5a4ea8507aa3409a637 100644 --- a/plugins/wazo-cisco-sip/11.1.0/common.py +++ b/plugins/wazo_cisco_sip/v11_1_0/common.py @@ -212,6 +212,7 @@ class BaseCiscoSipPlugin(StandardPlugin): def configure_common(self, raw_config): tpl = self._tpl_helper.get_template('common/model.cfg.tpl') common_filenames = self._COMMON_FILENAMES + self._add_server_url(raw_config) for filename in common_filenames: dst = os.path.join(self._tftpboot_dir, filename) self._tpl_helper.dump(tpl, raw_config, dst, self._ENCODING) @@ -349,6 +350,16 @@ class BaseCiscoSipPlugin(StandardPlugin): def _add_xivo_phonebook_url(self, raw_config): plugins.add_xivo_phonebook_url(raw_config, 'cisco') + def _add_server_url(self, raw_config): + if 'http_base_url' in raw_config: + _, _, remaining_url = raw_config['http_base_url'].partition('://') + raw_config['XX_server_url'] = raw_config['http_base_url'] + raw_config['XX_server_url_without_scheme'] = remaining_url + else: + base_url = f"{raw_config['ip']}:{raw_config['http_port']}" + raw_config['XX_server_url_without_scheme'] = base_url + raw_config['XX_server_url'] = f"http://{base_url}" + def _dev_specific_filename(self, dev): # Return the device specific filename (not pathname) of device formatted_mac = format_mac(dev['mac'], separator='') @@ -375,6 +386,7 @@ class BaseCiscoSipPlugin(StandardPlugin): self._add_directory_name(raw_config) self._add_locale(raw_config) self._add_xivo_phonebook_url(raw_config) + self._add_server_url(raw_config) path = os.path.join(self._tftpboot_dir, filename) self._tpl_helper.dump(tpl, raw_config, path, self._ENCODING, errors='replace') diff --git a/plugins/wazo-cisco-sip/11.1.0/entry.py b/plugins/wazo_cisco_sip/v11_1_0/entry.py similarity index 100% rename from plugins/wazo-cisco-sip/11.1.0/entry.py rename to plugins/wazo_cisco_sip/v11_1_0/entry.py diff --git a/plugins/wazo-cisco-sip/11.1.0/pkgs/pkgs.db b/plugins/wazo_cisco_sip/v11_1_0/pkgs/pkgs.db similarity index 100% rename from plugins/wazo-cisco-sip/11.1.0/pkgs/pkgs.db rename to plugins/wazo_cisco_sip/v11_1_0/pkgs/pkgs.db diff --git a/plugins/wazo-cisco-sip/11.1.0/plugin-info b/plugins/wazo_cisco_sip/v11_1_0/plugin-info similarity index 97% rename from plugins/wazo-cisco-sip/11.1.0/plugin-info rename to plugins/wazo_cisco_sip/v11_1_0/plugin-info index c1534d02d6a0a2a03d927fe633ac3a1fb9d470f6..6c26fed93b66ed28fb9541a38fb099d79daef071 100644 --- a/plugins/wazo-cisco-sip/11.1.0/plugin-info +++ b/plugins/wazo_cisco_sip/v11_1_0/plugin-info @@ -1,5 +1,5 @@ { - "version": "0.1.7", + "version": "0.1.9", "description": "Plugin for Cisco ATA 191 and 192 in version 11.1.0 of the SIP software.
Please see the documentation if you want to install Cisco firmwares.", "description_fr": "Greffon pour Cisco ATA 191 et 192 en version 11.1.0 du logiciel SIP.
Veuillez vous référer à la documentation pour l'installation de firmwares Cisco.", "capabilities": { diff --git a/plugins/wazo-cisco-sip/11.1.0/templates/ATA191.tpl b/plugins/wazo_cisco_sip/v11_1_0/templates/ATA191.tpl similarity index 100% rename from plugins/wazo-cisco-sip/11.1.0/templates/ATA191.tpl rename to plugins/wazo_cisco_sip/v11_1_0/templates/ATA191.tpl diff --git a/plugins/wazo-cisco-sip/11.1.0/templates/ATA192.tpl b/plugins/wazo_cisco_sip/v11_1_0/templates/ATA192.tpl similarity index 100% rename from plugins/wazo-cisco-sip/11.1.0/templates/ATA192.tpl rename to plugins/wazo_cisco_sip/v11_1_0/templates/ATA192.tpl diff --git a/plugins/wazo-cisco-sip/11.1.0/templates/base.tpl b/plugins/wazo_cisco_sip/v11_1_0/templates/base.tpl similarity index 100% rename from plugins/wazo-cisco-sip/11.1.0/templates/base.tpl rename to plugins/wazo_cisco_sip/v11_1_0/templates/base.tpl diff --git a/plugins/wazo-cisco-sip/11.1.0/templates/common/model.cfg.tpl b/plugins/wazo_cisco_sip/v11_1_0/templates/common/model.cfg.tpl similarity index 100% rename from plugins/wazo-cisco-sip/11.1.0/templates/common/model.cfg.tpl rename to plugins/wazo_cisco_sip/v11_1_0/templates/common/model.cfg.tpl diff --git a/plugins/wazo-cisco-sip/11.1.0/var/tftpboot/spa-ata.xml b/plugins/wazo_cisco_sip/v11_1_0/var/tftpboot/spa-ata.xml similarity index 100% rename from plugins/wazo-cisco-sip/11.1.0/var/tftpboot/spa-ata.xml rename to plugins/wazo_cisco_sip/v11_1_0/var/tftpboot/spa-ata.xml diff --git a/plugins/wazo-cisco-sip/11.3.1/common.py b/plugins/wazo_cisco_sip/v11_3_1/common.py similarity index 96% rename from plugins/wazo-cisco-sip/11.3.1/common.py rename to plugins/wazo_cisco_sip/v11_3_1/common.py index ab8521a343e5f91a0857c963b7f2527f97f98287..9d3b8a2a4f6c78b99fc7508ad52d38e0a129d773 100644 --- a/plugins/wazo-cisco-sip/11.3.1/common.py +++ b/plugins/wazo_cisco_sip/v11_3_1/common.py @@ -217,6 +217,7 @@ class BaseCiscoSipPlugin(StandardPlugin): def configure_common(self, raw_config): tpl = self._tpl_helper.get_template('common/model.cfg.tpl') common_filenames = self._COMMON_FILENAMES + self._add_server_url(raw_config) for filename in common_filenames: dst = os.path.join(self._tftpboot_dir, filename) self._tpl_helper.dump(tpl, raw_config, dst, self._ENCODING) @@ -354,6 +355,16 @@ class BaseCiscoSipPlugin(StandardPlugin): def _add_xivo_phonebook_url(self, raw_config): plugins.add_xivo_phonebook_url(raw_config, 'cisco') + def _add_server_url(self, raw_config): + if 'http_base_url' in raw_config: + _, _, remaining_url = raw_config['http_base_url'].partition('://') + raw_config['XX_server_url'] = raw_config['http_base_url'] + raw_config['XX_server_url_without_scheme'] = remaining_url + else: + base_url = f"{raw_config['ip']}:{raw_config['http_port']}" + raw_config['XX_server_url_without_scheme'] = base_url + raw_config['XX_server_url'] = f"http://{base_url}" + def _dev_specific_filename(self, dev: dict[str, str]) -> str: # Return the device specific filename (not pathname) of device formatted_mac = format_mac(dev['mac'], separator='') @@ -380,6 +391,7 @@ class BaseCiscoSipPlugin(StandardPlugin): self._add_directory_name(raw_config) self._add_locale(raw_config) self._add_xivo_phonebook_url(raw_config) + self._add_server_url(raw_config) path = os.path.join(self._tftpboot_dir, filename) self._tpl_helper.dump(tpl, raw_config, path, self._ENCODING, errors='replace') diff --git a/plugins/wazo-cisco-sip/11.3.1/entry.py b/plugins/wazo_cisco_sip/v11_3_1/entry.py similarity index 100% rename from plugins/wazo-cisco-sip/11.3.1/entry.py rename to plugins/wazo_cisco_sip/v11_3_1/entry.py diff --git a/plugins/wazo-cisco-sip/11.3.1/pkgs/pkgs.db b/plugins/wazo_cisco_sip/v11_3_1/pkgs/pkgs.db similarity index 100% rename from plugins/wazo-cisco-sip/11.3.1/pkgs/pkgs.db rename to plugins/wazo_cisco_sip/v11_3_1/pkgs/pkgs.db diff --git a/plugins/wazo-cisco-sip/11.3.1/plugin-info b/plugins/wazo_cisco_sip/v11_3_1/plugin-info similarity index 99% rename from plugins/wazo-cisco-sip/11.3.1/plugin-info rename to plugins/wazo_cisco_sip/v11_3_1/plugin-info index a19e92a7363a983a8f90cf0c0cd6da865995015b..53445fb4fafd28275e5d2973db5919830e7fa641 100644 --- a/plugins/wazo-cisco-sip/11.3.1/plugin-info +++ b/plugins/wazo_cisco_sip/v11_3_1/plugin-info @@ -1,5 +1,5 @@ { - "version": "0.1.7", + "version": "0.1.9", "description": "Plugin for Cisco 7811, 7821, 7832, 7841, 7861, 6821, 6841, 6851, 6861, 6871, 8811, 8841, 8851 and 8861 in version 11.3.1 of the SIP software.
Please see the documentation if you want to install Cisco firmwares.", "description_fr": "Greffon pour Cisco 7811, 7821, 7832, 7841, 7861, 6821, 6841, 6851, 6861, 6871, 8811, 8841, 8851 et 8861 en version 11.3.1 du logiciel SIP.
Veuillez vous référer à la documentation pour l'installation de firmwares Cisco.", "capabilities": { diff --git a/plugins/wazo-cisco-sip/11.3.1/templates/6821.tpl b/plugins/wazo_cisco_sip/v11_3_1/templates/6821.tpl similarity index 100% rename from plugins/wazo-cisco-sip/11.3.1/templates/6821.tpl rename to plugins/wazo_cisco_sip/v11_3_1/templates/6821.tpl diff --git a/plugins/wazo-cisco-sip/11.3.1/templates/6841.tpl b/plugins/wazo_cisco_sip/v11_3_1/templates/6841.tpl similarity index 100% rename from plugins/wazo-cisco-sip/11.3.1/templates/6841.tpl rename to plugins/wazo_cisco_sip/v11_3_1/templates/6841.tpl diff --git a/plugins/wazo-cisco-sip/11.3.1/templates/6851.tpl b/plugins/wazo_cisco_sip/v11_3_1/templates/6851.tpl similarity index 100% rename from plugins/wazo-cisco-sip/11.3.1/templates/6851.tpl rename to plugins/wazo_cisco_sip/v11_3_1/templates/6851.tpl diff --git a/plugins/wazo-cisco-sip/11.3.1/templates/6861.tpl b/plugins/wazo_cisco_sip/v11_3_1/templates/6861.tpl similarity index 100% rename from plugins/wazo-cisco-sip/11.3.1/templates/6861.tpl rename to plugins/wazo_cisco_sip/v11_3_1/templates/6861.tpl diff --git a/plugins/wazo-cisco-sip/11.3.1/templates/6871.tpl b/plugins/wazo_cisco_sip/v11_3_1/templates/6871.tpl similarity index 100% rename from plugins/wazo-cisco-sip/11.3.1/templates/6871.tpl rename to plugins/wazo_cisco_sip/v11_3_1/templates/6871.tpl diff --git a/plugins/wazo-cisco-sip/11.3.1/templates/7811.tpl b/plugins/wazo_cisco_sip/v11_3_1/templates/7811.tpl similarity index 100% rename from plugins/wazo-cisco-sip/11.3.1/templates/7811.tpl rename to plugins/wazo_cisco_sip/v11_3_1/templates/7811.tpl diff --git a/plugins/wazo-cisco-sip/11.3.1/templates/7821.tpl b/plugins/wazo_cisco_sip/v11_3_1/templates/7821.tpl similarity index 100% rename from plugins/wazo-cisco-sip/11.3.1/templates/7821.tpl rename to plugins/wazo_cisco_sip/v11_3_1/templates/7821.tpl diff --git a/plugins/wazo-cisco-sip/11.3.1/templates/7832.tpl b/plugins/wazo_cisco_sip/v11_3_1/templates/7832.tpl similarity index 100% rename from plugins/wazo-cisco-sip/11.3.1/templates/7832.tpl rename to plugins/wazo_cisco_sip/v11_3_1/templates/7832.tpl diff --git a/plugins/wazo-cisco-sip/11.3.1/templates/7841.tpl b/plugins/wazo_cisco_sip/v11_3_1/templates/7841.tpl similarity index 100% rename from plugins/wazo-cisco-sip/11.3.1/templates/7841.tpl rename to plugins/wazo_cisco_sip/v11_3_1/templates/7841.tpl diff --git a/plugins/wazo-cisco-sip/11.3.1/templates/7861.tpl b/plugins/wazo_cisco_sip/v11_3_1/templates/7861.tpl similarity index 100% rename from plugins/wazo-cisco-sip/11.3.1/templates/7861.tpl rename to plugins/wazo_cisco_sip/v11_3_1/templates/7861.tpl diff --git a/plugins/wazo-cisco-sip/11.3.1/templates/8811.tpl b/plugins/wazo_cisco_sip/v11_3_1/templates/8811.tpl similarity index 100% rename from plugins/wazo-cisco-sip/11.3.1/templates/8811.tpl rename to plugins/wazo_cisco_sip/v11_3_1/templates/8811.tpl diff --git a/plugins/wazo-cisco-sip/11.3.1/templates/8841.tpl b/plugins/wazo_cisco_sip/v11_3_1/templates/8841.tpl similarity index 100% rename from plugins/wazo-cisco-sip/11.3.1/templates/8841.tpl rename to plugins/wazo_cisco_sip/v11_3_1/templates/8841.tpl diff --git a/plugins/wazo-cisco-sip/11.3.1/templates/8851.tpl b/plugins/wazo_cisco_sip/v11_3_1/templates/8851.tpl similarity index 100% rename from plugins/wazo-cisco-sip/11.3.1/templates/8851.tpl rename to plugins/wazo_cisco_sip/v11_3_1/templates/8851.tpl diff --git a/plugins/wazo-cisco-sip/11.3.1/templates/8861.tpl b/plugins/wazo_cisco_sip/v11_3_1/templates/8861.tpl similarity index 100% rename from plugins/wazo-cisco-sip/11.3.1/templates/8861.tpl rename to plugins/wazo_cisco_sip/v11_3_1/templates/8861.tpl diff --git a/plugins/wazo-cisco-sip/11.3.1/templates/base.tpl b/plugins/wazo_cisco_sip/v11_3_1/templates/base.tpl similarity index 100% rename from plugins/wazo-cisco-sip/11.3.1/templates/base.tpl rename to plugins/wazo_cisco_sip/v11_3_1/templates/base.tpl diff --git a/plugins/wazo-cisco-sip/11.3.1/templates/common/model.cfg.tpl b/plugins/wazo_cisco_sip/v11_3_1/templates/common/model.cfg.tpl similarity index 100% rename from plugins/wazo-cisco-sip/11.3.1/templates/common/model.cfg.tpl rename to plugins/wazo_cisco_sip/v11_3_1/templates/common/model.cfg.tpl diff --git a/plugins/wazo-cisco-sip/11.3.1/var/tftpboot/cp-phone.xml b/plugins/wazo_cisco_sip/v11_3_1/var/tftpboot/cp-phone.xml similarity index 100% rename from plugins/wazo-cisco-sip/11.3.1/var/tftpboot/cp-phone.xml rename to plugins/wazo_cisco_sip/v11_3_1/var/tftpboot/cp-phone.xml diff --git a/plugins/wazo-cisco-sip/12.0.1/common.py b/plugins/wazo_cisco_sip/v12_0_1/common.py similarity index 96% rename from plugins/wazo-cisco-sip/12.0.1/common.py rename to plugins/wazo_cisco_sip/v12_0_1/common.py index 178d09d0591b16b1b88a8a7e68b1e05561f24bea..a2531947bbb1b1d0fb86893f2816eda8676d1e3c 100644 --- a/plugins/wazo-cisco-sip/12.0.1/common.py +++ b/plugins/wazo_cisco_sip/v12_0_1/common.py @@ -207,6 +207,7 @@ class BaseCiscoSipPlugin(StandardPlugin): def configure_common(self, raw_config): tpl = self._tpl_helper.get_template('common/model.cfg.tpl') common_filenames = self._COMMON_FILENAMES + self._add_server_url(raw_config) for filename in common_filenames: dst = os.path.join(self._tftpboot_dir, filename) self._tpl_helper.dump(tpl, raw_config, dst, self._ENCODING) @@ -349,6 +350,16 @@ class BaseCiscoSipPlugin(StandardPlugin): def _add_xivo_phonebook_url(self, raw_config): plugins.add_xivo_phonebook_url(raw_config, 'cisco') + def _add_server_url(self, raw_config): + if 'http_base_url' in raw_config: + _, _, remaining_url = raw_config['http_base_url'].partition('://') + raw_config['XX_server_url'] = raw_config['http_base_url'] + raw_config['XX_server_url_without_scheme'] = remaining_url + else: + base_url = f"{raw_config['ip']}:{raw_config['http_port']}" + raw_config['XX_server_url_without_scheme'] = base_url + raw_config['XX_server_url'] = f"http://{base_url}" + def _dev_specific_filename(self, dev: dict[str, str]) -> str: # Return the device specific filename (not pathname) of device formatted_mac = format_mac(dev['mac'], separator='') @@ -375,6 +386,7 @@ class BaseCiscoSipPlugin(StandardPlugin): self._add_directory_name(raw_config) self._add_locale(raw_config) self._add_xivo_phonebook_url(raw_config) + self._add_server_url(raw_config) path = os.path.join(self._tftpboot_dir, filename) self._tpl_helper.dump(tpl, raw_config, path, self._ENCODING, errors='replace') diff --git a/plugins/wazo-cisco-sip/12.0.1/entry.py b/plugins/wazo_cisco_sip/v12_0_1/entry.py similarity index 100% rename from plugins/wazo-cisco-sip/12.0.1/entry.py rename to plugins/wazo_cisco_sip/v12_0_1/entry.py diff --git a/plugins/wazo-cisco-sip/12.0.1/pkgs/pkgs.db b/plugins/wazo_cisco_sip/v12_0_1/pkgs/pkgs.db similarity index 100% rename from plugins/wazo-cisco-sip/12.0.1/pkgs/pkgs.db rename to plugins/wazo_cisco_sip/v12_0_1/pkgs/pkgs.db diff --git a/plugins/wazo-cisco-sip/12.0.1/plugin-info b/plugins/wazo_cisco_sip/v12_0_1/plugin-info similarity index 98% rename from plugins/wazo-cisco-sip/12.0.1/plugin-info rename to plugins/wazo_cisco_sip/v12_0_1/plugin-info index 469365d21f51dfe883dcd0004cbd7ed32284d6d2..758f83ac466078b39805701ce0143526aed79328 100644 --- a/plugins/wazo-cisco-sip/12.0.1/plugin-info +++ b/plugins/wazo_cisco_sip/v12_0_1/plugin-info @@ -1,5 +1,5 @@ { - "version": "0.1.2", + "version": "0.1.4", "description": "Plugin for Cisco 8811, 8841, 8851 and 8861 in version 12.0.1 of the SIP software. Please see the documentation if you want to install Cisco firmwares.", "description_fr": "Greffon pour Cisco 8811, 8841, 8851 et 8861 en version 12.0.1 du logiciel SIP. Veuillez vous référer à la documentation pour l'installation de firmwares Cisco.", "capabilities": { diff --git a/plugins/wazo-cisco-sip/12.0.1/templates/8811.tpl b/plugins/wazo_cisco_sip/v12_0_1/templates/8811.tpl similarity index 100% rename from plugins/wazo-cisco-sip/12.0.1/templates/8811.tpl rename to plugins/wazo_cisco_sip/v12_0_1/templates/8811.tpl diff --git a/plugins/wazo-cisco-sip/12.0.1/templates/8841.tpl b/plugins/wazo_cisco_sip/v12_0_1/templates/8841.tpl similarity index 100% rename from plugins/wazo-cisco-sip/12.0.1/templates/8841.tpl rename to plugins/wazo_cisco_sip/v12_0_1/templates/8841.tpl diff --git a/plugins/wazo-cisco-sip/12.0.1/templates/8851.tpl b/plugins/wazo_cisco_sip/v12_0_1/templates/8851.tpl similarity index 100% rename from plugins/wazo-cisco-sip/12.0.1/templates/8851.tpl rename to plugins/wazo_cisco_sip/v12_0_1/templates/8851.tpl diff --git a/plugins/wazo-cisco-sip/12.0.1/templates/8861.tpl b/plugins/wazo_cisco_sip/v12_0_1/templates/8861.tpl similarity index 100% rename from plugins/wazo-cisco-sip/12.0.1/templates/8861.tpl rename to plugins/wazo_cisco_sip/v12_0_1/templates/8861.tpl diff --git a/plugins/wazo-cisco-sip/12.0.1/templates/base.tpl b/plugins/wazo_cisco_sip/v12_0_1/templates/base.tpl similarity index 100% rename from plugins/wazo-cisco-sip/12.0.1/templates/base.tpl rename to plugins/wazo_cisco_sip/v12_0_1/templates/base.tpl diff --git a/plugins/wazo-cisco-sip/12.0.1/templates/common/model.cfg.tpl b/plugins/wazo_cisco_sip/v12_0_1/templates/common/model.cfg.tpl similarity index 100% rename from plugins/wazo-cisco-sip/12.0.1/templates/common/model.cfg.tpl rename to plugins/wazo_cisco_sip/v12_0_1/templates/common/model.cfg.tpl diff --git a/plugins/wazo-cisco-sip/12.0.1/var/tftpboot/cp-phone.xml b/plugins/wazo_cisco_sip/v12_0_1/var/tftpboot/cp-phone.xml similarity index 100% rename from plugins/wazo-cisco-sip/12.0.1/var/tftpboot/cp-phone.xml rename to plugins/wazo_cisco_sip/v12_0_1/var/tftpboot/cp-phone.xml diff --git a/plugins/wazo-cisco-sip/9.3/entry.py b/plugins/wazo_cisco_sip/v9_3/entry.py similarity index 100% rename from plugins/wazo-cisco-sip/9.3/entry.py rename to plugins/wazo_cisco_sip/v9_3/entry.py diff --git a/plugins/wazo-cisco-sip/9.3/pkgs/pkgs.db b/plugins/wazo_cisco_sip/v9_3/pkgs/pkgs.db similarity index 100% rename from plugins/wazo-cisco-sip/9.3/pkgs/pkgs.db rename to plugins/wazo_cisco_sip/v9_3/pkgs/pkgs.db diff --git a/plugins/wazo-cisco-sip/9.3/plugin-info b/plugins/wazo_cisco_sip/v9_3/plugin-info similarity index 100% rename from plugins/wazo-cisco-sip/9.3/plugin-info rename to plugins/wazo_cisco_sip/v9_3/plugin-info diff --git a/plugins/wazo-cisco-sip/9.3/templates/8941.tpl b/plugins/wazo_cisco_sip/v9_3/templates/8941.tpl similarity index 100% rename from plugins/wazo-cisco-sip/9.3/templates/8941.tpl rename to plugins/wazo_cisco_sip/v9_3/templates/8941.tpl diff --git a/plugins/wazo-cisco-sip/9.3/templates/8945.tpl b/plugins/wazo_cisco_sip/v9_3/templates/8945.tpl similarity index 100% rename from plugins/wazo-cisco-sip/9.3/templates/8945.tpl rename to plugins/wazo_cisco_sip/v9_3/templates/8945.tpl diff --git a/plugins/wazo-cisco-spa/ata190-1.2.2/entry.py b/plugins/wazo_cisco_spa/ata190_v1_2_2/entry.py similarity index 100% rename from plugins/wazo-cisco-spa/ata190-1.2.2/entry.py rename to plugins/wazo_cisco_spa/ata190_v1_2_2/entry.py diff --git a/plugins/wazo-cisco-spa/ata190-1.2.2/pkgs/pkgs.db b/plugins/wazo_cisco_spa/ata190_v1_2_2/pkgs/pkgs.db similarity index 100% rename from plugins/wazo-cisco-spa/ata190-1.2.2/pkgs/pkgs.db rename to plugins/wazo_cisco_spa/ata190_v1_2_2/pkgs/pkgs.db diff --git a/plugins/wazo-cisco-spa/ata190-1.2.2/plugin-info b/plugins/wazo_cisco_spa/ata190_v1_2_2/plugin-info similarity index 100% rename from plugins/wazo-cisco-spa/ata190-1.2.2/plugin-info rename to plugins/wazo_cisco_spa/ata190_v1_2_2/plugin-info diff --git a/plugins/wazo-cisco-spa/ata190-1.2.2/templates/ATA190.tpl b/plugins/wazo_cisco_spa/ata190_v1_2_2/templates/ATA190.tpl similarity index 100% rename from plugins/wazo-cisco-spa/ata190-1.2.2/templates/ATA190.tpl rename to plugins/wazo_cisco_spa/ata190_v1_2_2/templates/ATA190.tpl diff --git a/plugins/wazo-cisco-spa/ata190-1.2.2/templates/common/model.cfg.tpl b/plugins/wazo_cisco_spa/ata190_v1_2_2/templates/common/model.cfg.tpl similarity index 100% rename from plugins/wazo-cisco-spa/ata190-1.2.2/templates/common/model.cfg.tpl rename to plugins/wazo_cisco_spa/ata190_v1_2_2/templates/common/model.cfg.tpl diff --git a/plugins/wazo_cisco_spa/build.py b/plugins/wazo_cisco_spa/build.py new file mode 100644 index 0000000000000000000000000000000000000000..f9446b8788cf36297b9796d401312cd3b51c04e8 --- /dev/null +++ b/plugins/wazo_cisco_spa/build.py @@ -0,0 +1,73 @@ +""" +Copyright 2014-2023 The Wazo Authors (see the AUTHORS file) +SPDX-License-Identifier: GPL-3.0+ + +Depends on the following external programs: + -rsync +""" +from __future__ import annotations + +from typing import TYPE_CHECKING, Callable +from subprocess import check_call + +if TYPE_CHECKING: + + def target( + target_id: str, plugin_id: str, std_dirs: bool = True + ) -> Callable[[str], None]: + """The `target` method is injected in `exec` call by the build script.""" + return lambda x: None + + +@target('7.5.5', 'wazo-cisco-spa-7.5.5') +def build_7_5_5(path: str) -> None: + check_call(['rsync', '-rlp', '--exclude', '.*', 'common/', path]) + check_call(['rsync', '-rlp', '--exclude', '.*', 'v7_5_5/', path]) + + +@target('legacy', 'wazo-cisco-spa-legacy') +def build_legacy(path: str) -> None: + check_call(['rsync', '-rlp', '--exclude', '.*', 'common/', path]) + check_call(['rsync', '-rlp', '--exclude', '.*', 'legacy/', path]) + + +@target('pap2t-5.1.6', 'wazo-cisco-pap2t-5.1.6') +def build_pap2t_5_1_6(path: str) -> None: + check_call(['rsync', '-rlp', '--exclude', '.*', 'common/', path]) + check_call(['rsync', '-rlp', '--exclude', '.*', 'pap2t_v5_1_6/', path]) + + +@target('spa100-1.3.5p', 'wazo-cisco-spa100-1.3.5p') +def build_spa100_1_3_5p(path: str) -> None: + check_call(['rsync', '-rlp', '--exclude', '.*', 'common/', path]) + check_call(['rsync', '-rlp', '--exclude', '.*', 'spa100_v1_3_5p/', path]) + + +@target('spa2102-5.2.12', 'wazo-cisco-spa2102-5.2.12') +def build_spa2102_5_2_12(path: str) -> None: + check_call(['rsync', '-rlp', '--exclude', '.*', 'common/', path]) + check_call(['rsync', '-rlp', '--exclude', '.*', 'spa2102_v5_2_12/', path]) + + +@target('spa3102-5.1.10', 'wazo-cisco-spa3102-5.1.10') +def build_spa3102_5_1_10(path: str) -> None: + check_call(['rsync', '-rlp', '--exclude', '.*', 'common/', path]) + check_call(['rsync', '-rlp', '--exclude', '.*', 'spa3102_v5_1_10/', path]) + + +@target('spa8000-6.1.11', 'wazo-cisco-spa8000-6.1.11') +def build_spa8000_6_1_11(path: str) -> None: + check_call(['rsync', '-rlp', '--exclude', '.*', 'common/', path]) + check_call(['rsync', '-rlp', '--exclude', '.*', 'spa8000_v6_1_11/', path]) + + +@target('spa8800-6.1.7', 'wazo-cisco-spa8800-6.1.7') +def build_spa8800_6_1_7(path: str) -> None: + check_call(['rsync', '-rlp', '--exclude', '.*', 'common/', path]) + check_call(['rsync', '-rlp', '--exclude', '.*', 'spa8800_v6_1_7/', path]) + + +@target('ata190-1.2.2', 'wazo-cisco-ata190-1.2.2') +def build_ata190_1_2_2(path: str) -> None: + check_call(['rsync', '-rlp', '--exclude', '.*', 'common/', path]) + check_call(['rsync', '-rlp', '--exclude', '.*', 'ata190_v1_2_2/', path]) diff --git a/plugins/wazo-cisco-spa/common/common.py b/plugins/wazo_cisco_spa/common/common.py similarity index 100% rename from plugins/wazo-cisco-spa/common/common.py rename to plugins/wazo_cisco_spa/common/common.py diff --git a/plugins/wazo-cisco-spa/common/install.md b/plugins/wazo_cisco_spa/common/install.md similarity index 100% rename from plugins/wazo-cisco-spa/common/install.md rename to plugins/wazo_cisco_spa/common/install.md diff --git a/plugins/wazo-cisco-spa/common/templates/base.tpl b/plugins/wazo_cisco_spa/common/templates/base.tpl similarity index 100% rename from plugins/wazo-cisco-spa/common/templates/base.tpl rename to plugins/wazo_cisco_spa/common/templates/base.tpl diff --git a/plugins/wazo-cisco-spa/common/var/tftpboot/spa-ata.xml b/plugins/wazo_cisco_spa/common/var/tftpboot/spa-ata.xml similarity index 100% rename from plugins/wazo-cisco-spa/common/var/tftpboot/spa-ata.xml rename to plugins/wazo_cisco_spa/common/var/tftpboot/spa-ata.xml diff --git a/plugins/wazo-cisco-spa/common/var/tftpboot/spa-phone.xml b/plugins/wazo_cisco_spa/common/var/tftpboot/spa-phone.xml similarity index 100% rename from plugins/wazo-cisco-spa/common/var/tftpboot/spa-phone.xml rename to plugins/wazo_cisco_spa/common/var/tftpboot/spa-phone.xml diff --git a/plugins/wazo-cisco-spa/legacy/entry.py b/plugins/wazo_cisco_spa/legacy/entry.py similarity index 100% rename from plugins/wazo-cisco-spa/legacy/entry.py rename to plugins/wazo_cisco_spa/legacy/entry.py diff --git a/plugins/wazo-cisco-spa/legacy/install.md b/plugins/wazo_cisco_spa/legacy/install.md similarity index 100% rename from plugins/wazo-cisco-spa/legacy/install.md rename to plugins/wazo_cisco_spa/legacy/install.md diff --git a/plugins/wazo-cisco-spa/legacy/pkgs/pkgs.db b/plugins/wazo_cisco_spa/legacy/pkgs/pkgs.db similarity index 100% rename from plugins/wazo-cisco-spa/legacy/pkgs/pkgs.db rename to plugins/wazo_cisco_spa/legacy/pkgs/pkgs.db diff --git a/plugins/wazo-cisco-spa/legacy/plugin-info b/plugins/wazo_cisco_spa/legacy/plugin-info similarity index 100% rename from plugins/wazo-cisco-spa/legacy/plugin-info rename to plugins/wazo_cisco_spa/legacy/plugin-info diff --git a/plugins/wazo-cisco-spa/legacy/templates/SPA901.tpl b/plugins/wazo_cisco_spa/legacy/templates/SPA901.tpl similarity index 100% rename from plugins/wazo-cisco-spa/legacy/templates/SPA901.tpl rename to plugins/wazo_cisco_spa/legacy/templates/SPA901.tpl diff --git a/plugins/wazo-cisco-spa/legacy/templates/SPA921.tpl b/plugins/wazo_cisco_spa/legacy/templates/SPA921.tpl similarity index 100% rename from plugins/wazo-cisco-spa/legacy/templates/SPA921.tpl rename to plugins/wazo_cisco_spa/legacy/templates/SPA921.tpl diff --git a/plugins/wazo-cisco-spa/legacy/templates/SPA922.tpl b/plugins/wazo_cisco_spa/legacy/templates/SPA922.tpl similarity index 100% rename from plugins/wazo-cisco-spa/legacy/templates/SPA922.tpl rename to plugins/wazo_cisco_spa/legacy/templates/SPA922.tpl diff --git a/plugins/wazo-cisco-spa/legacy/templates/SPA941.tpl b/plugins/wazo_cisco_spa/legacy/templates/SPA941.tpl similarity index 100% rename from plugins/wazo-cisco-spa/legacy/templates/SPA941.tpl rename to plugins/wazo_cisco_spa/legacy/templates/SPA941.tpl diff --git a/plugins/wazo-cisco-spa/legacy/templates/SPA942.tpl b/plugins/wazo_cisco_spa/legacy/templates/SPA942.tpl similarity index 100% rename from plugins/wazo-cisco-spa/legacy/templates/SPA942.tpl rename to plugins/wazo_cisco_spa/legacy/templates/SPA942.tpl diff --git a/plugins/wazo-cisco-spa/legacy/templates/SPA962.tpl b/plugins/wazo_cisco_spa/legacy/templates/SPA962.tpl similarity index 100% rename from plugins/wazo-cisco-spa/legacy/templates/SPA962.tpl rename to plugins/wazo_cisco_spa/legacy/templates/SPA962.tpl diff --git a/plugins/wazo-cisco-spa/7.5.5/templates/common/model.cfg.tpl b/plugins/wazo_cisco_spa/legacy/templates/common/model.cfg.tpl similarity index 100% rename from plugins/wazo-cisco-spa/7.5.5/templates/common/model.cfg.tpl rename to plugins/wazo_cisco_spa/legacy/templates/common/model.cfg.tpl diff --git a/plugins/wazo-cisco-spa/pap2t-5.1.6/entry.py b/plugins/wazo_cisco_spa/pap2t_v5_1_6/entry.py similarity index 100% rename from plugins/wazo-cisco-spa/pap2t-5.1.6/entry.py rename to plugins/wazo_cisco_spa/pap2t_v5_1_6/entry.py diff --git a/plugins/wazo-cisco-spa/pap2t-5.1.6/pkgs/pkgs.db b/plugins/wazo_cisco_spa/pap2t_v5_1_6/pkgs/pkgs.db similarity index 100% rename from plugins/wazo-cisco-spa/pap2t-5.1.6/pkgs/pkgs.db rename to plugins/wazo_cisco_spa/pap2t_v5_1_6/pkgs/pkgs.db diff --git a/plugins/wazo-cisco-spa/pap2t-5.1.6/plugin-info b/plugins/wazo_cisco_spa/pap2t_v5_1_6/plugin-info similarity index 100% rename from plugins/wazo-cisco-spa/pap2t-5.1.6/plugin-info rename to plugins/wazo_cisco_spa/pap2t_v5_1_6/plugin-info diff --git a/plugins/wazo-cisco-spa/pap2t-5.1.6/templates/PAP2T.tpl b/plugins/wazo_cisco_spa/pap2t_v5_1_6/templates/PAP2T.tpl similarity index 100% rename from plugins/wazo-cisco-spa/pap2t-5.1.6/templates/PAP2T.tpl rename to plugins/wazo_cisco_spa/pap2t_v5_1_6/templates/PAP2T.tpl diff --git a/plugins/wazo-cisco-spa/pap2t-5.1.6/templates/common/model.cfg.tpl b/plugins/wazo_cisco_spa/pap2t_v5_1_6/templates/common/model.cfg.tpl similarity index 100% rename from plugins/wazo-cisco-spa/pap2t-5.1.6/templates/common/model.cfg.tpl rename to plugins/wazo_cisco_spa/pap2t_v5_1_6/templates/common/model.cfg.tpl diff --git a/plugins/wazo-cisco-spa/spa100-1.3.5p/entry.py b/plugins/wazo_cisco_spa/spa100_v1_3_5p/entry.py similarity index 100% rename from plugins/wazo-cisco-spa/spa100-1.3.5p/entry.py rename to plugins/wazo_cisco_spa/spa100_v1_3_5p/entry.py diff --git a/plugins/wazo-cisco-spa/spa100-1.3.5p/pkgs/pkgs.db b/plugins/wazo_cisco_spa/spa100_v1_3_5p/pkgs/pkgs.db similarity index 100% rename from plugins/wazo-cisco-spa/spa100-1.3.5p/pkgs/pkgs.db rename to plugins/wazo_cisco_spa/spa100_v1_3_5p/pkgs/pkgs.db diff --git a/plugins/wazo-cisco-spa/spa100-1.3.5p/plugin-info b/plugins/wazo_cisco_spa/spa100_v1_3_5p/plugin-info similarity index 100% rename from plugins/wazo-cisco-spa/spa100-1.3.5p/plugin-info rename to plugins/wazo_cisco_spa/spa100_v1_3_5p/plugin-info diff --git a/plugins/wazo-cisco-spa/spa100-1.3.5p/templates/SPA112.tpl b/plugins/wazo_cisco_spa/spa100_v1_3_5p/templates/SPA112.tpl similarity index 100% rename from plugins/wazo-cisco-spa/spa100-1.3.5p/templates/SPA112.tpl rename to plugins/wazo_cisco_spa/spa100_v1_3_5p/templates/SPA112.tpl diff --git a/plugins/wazo-cisco-spa/spa100-1.3.5p/templates/SPA122.tpl b/plugins/wazo_cisco_spa/spa100_v1_3_5p/templates/SPA122.tpl similarity index 100% rename from plugins/wazo-cisco-spa/spa100-1.3.5p/templates/SPA122.tpl rename to plugins/wazo_cisco_spa/spa100_v1_3_5p/templates/SPA122.tpl diff --git a/plugins/wazo-cisco-spa/spa100-1.3.5p/templates/common/model.cfg.tpl b/plugins/wazo_cisco_spa/spa100_v1_3_5p/templates/common/model.cfg.tpl similarity index 100% rename from plugins/wazo-cisco-spa/spa100-1.3.5p/templates/common/model.cfg.tpl rename to plugins/wazo_cisco_spa/spa100_v1_3_5p/templates/common/model.cfg.tpl diff --git a/plugins/wazo-cisco-spa/spa2102-5.2.12/entry.py b/plugins/wazo_cisco_spa/spa2102_v5_2_12/entry.py similarity index 100% rename from plugins/wazo-cisco-spa/spa2102-5.2.12/entry.py rename to plugins/wazo_cisco_spa/spa2102_v5_2_12/entry.py diff --git a/plugins/wazo-cisco-spa/spa2102-5.2.12/pkgs/pkgs.db b/plugins/wazo_cisco_spa/spa2102_v5_2_12/pkgs/pkgs.db similarity index 100% rename from plugins/wazo-cisco-spa/spa2102-5.2.12/pkgs/pkgs.db rename to plugins/wazo_cisco_spa/spa2102_v5_2_12/pkgs/pkgs.db diff --git a/plugins/wazo-cisco-spa/spa2102-5.2.12/plugin-info b/plugins/wazo_cisco_spa/spa2102_v5_2_12/plugin-info similarity index 100% rename from plugins/wazo-cisco-spa/spa2102-5.2.12/plugin-info rename to plugins/wazo_cisco_spa/spa2102_v5_2_12/plugin-info diff --git a/plugins/wazo-cisco-spa/spa2102-5.2.12/templates/SPA2102.tpl b/plugins/wazo_cisco_spa/spa2102_v5_2_12/templates/SPA2102.tpl similarity index 100% rename from plugins/wazo-cisco-spa/spa2102-5.2.12/templates/SPA2102.tpl rename to plugins/wazo_cisco_spa/spa2102_v5_2_12/templates/SPA2102.tpl diff --git a/plugins/wazo-cisco-spa/spa2102-5.2.12/templates/common/model.cfg.tpl b/plugins/wazo_cisco_spa/spa2102_v5_2_12/templates/common/model.cfg.tpl similarity index 100% rename from plugins/wazo-cisco-spa/spa2102-5.2.12/templates/common/model.cfg.tpl rename to plugins/wazo_cisco_spa/spa2102_v5_2_12/templates/common/model.cfg.tpl diff --git a/plugins/wazo-cisco-spa/spa3102-5.1.10/entry.py b/plugins/wazo_cisco_spa/spa3102_v5_1_10/entry.py similarity index 100% rename from plugins/wazo-cisco-spa/spa3102-5.1.10/entry.py rename to plugins/wazo_cisco_spa/spa3102_v5_1_10/entry.py diff --git a/plugins/wazo-cisco-spa/spa3102-5.1.10/pkgs/pkgs.db b/plugins/wazo_cisco_spa/spa3102_v5_1_10/pkgs/pkgs.db similarity index 100% rename from plugins/wazo-cisco-spa/spa3102-5.1.10/pkgs/pkgs.db rename to plugins/wazo_cisco_spa/spa3102_v5_1_10/pkgs/pkgs.db diff --git a/plugins/wazo-cisco-spa/spa3102-5.1.10/plugin-info b/plugins/wazo_cisco_spa/spa3102_v5_1_10/plugin-info similarity index 100% rename from plugins/wazo-cisco-spa/spa3102-5.1.10/plugin-info rename to plugins/wazo_cisco_spa/spa3102_v5_1_10/plugin-info diff --git a/plugins/wazo-cisco-spa/spa3102-5.1.10/templates/SPA3102.tpl b/plugins/wazo_cisco_spa/spa3102_v5_1_10/templates/SPA3102.tpl similarity index 100% rename from plugins/wazo-cisco-spa/spa3102-5.1.10/templates/SPA3102.tpl rename to plugins/wazo_cisco_spa/spa3102_v5_1_10/templates/SPA3102.tpl diff --git a/plugins/wazo-cisco-spa/spa3102-5.1.10/templates/common/model.cfg.tpl b/plugins/wazo_cisco_spa/spa3102_v5_1_10/templates/common/model.cfg.tpl similarity index 100% rename from plugins/wazo-cisco-spa/spa3102-5.1.10/templates/common/model.cfg.tpl rename to plugins/wazo_cisco_spa/spa3102_v5_1_10/templates/common/model.cfg.tpl diff --git a/plugins/wazo-cisco-spa/spa8000-6.1.11/entry.py b/plugins/wazo_cisco_spa/spa8000_v6_1_11/entry.py similarity index 100% rename from plugins/wazo-cisco-spa/spa8000-6.1.11/entry.py rename to plugins/wazo_cisco_spa/spa8000_v6_1_11/entry.py diff --git a/plugins/wazo-cisco-spa/spa8000-6.1.11/pkgs/pkgs.db b/plugins/wazo_cisco_spa/spa8000_v6_1_11/pkgs/pkgs.db similarity index 100% rename from plugins/wazo-cisco-spa/spa8000-6.1.11/pkgs/pkgs.db rename to plugins/wazo_cisco_spa/spa8000_v6_1_11/pkgs/pkgs.db diff --git a/plugins/wazo-cisco-spa/spa8000-6.1.11/plugin-info b/plugins/wazo_cisco_spa/spa8000_v6_1_11/plugin-info similarity index 100% rename from plugins/wazo-cisco-spa/spa8000-6.1.11/plugin-info rename to plugins/wazo_cisco_spa/spa8000_v6_1_11/plugin-info diff --git a/plugins/wazo-cisco-spa/spa8000-6.1.11/templates/SPA8000.tpl b/plugins/wazo_cisco_spa/spa8000_v6_1_11/templates/SPA8000.tpl similarity index 100% rename from plugins/wazo-cisco-spa/spa8000-6.1.11/templates/SPA8000.tpl rename to plugins/wazo_cisco_spa/spa8000_v6_1_11/templates/SPA8000.tpl diff --git a/plugins/wazo-cisco-spa/spa8000-6.1.11/templates/common/model.cfg.tpl b/plugins/wazo_cisco_spa/spa8000_v6_1_11/templates/common/model.cfg.tpl similarity index 100% rename from plugins/wazo-cisco-spa/spa8000-6.1.11/templates/common/model.cfg.tpl rename to plugins/wazo_cisco_spa/spa8000_v6_1_11/templates/common/model.cfg.tpl diff --git a/plugins/wazo-cisco-spa/spa8800-6.1.7/entry.py b/plugins/wazo_cisco_spa/spa8800_v6_1_7/entry.py similarity index 100% rename from plugins/wazo-cisco-spa/spa8800-6.1.7/entry.py rename to plugins/wazo_cisco_spa/spa8800_v6_1_7/entry.py diff --git a/plugins/wazo-cisco-spa/spa8800-6.1.7/pkgs/pkgs.db b/plugins/wazo_cisco_spa/spa8800_v6_1_7/pkgs/pkgs.db similarity index 100% rename from plugins/wazo-cisco-spa/spa8800-6.1.7/pkgs/pkgs.db rename to plugins/wazo_cisco_spa/spa8800_v6_1_7/pkgs/pkgs.db diff --git a/plugins/wazo-cisco-spa/spa8800-6.1.7/plugin-info b/plugins/wazo_cisco_spa/spa8800_v6_1_7/plugin-info similarity index 100% rename from plugins/wazo-cisco-spa/spa8800-6.1.7/plugin-info rename to plugins/wazo_cisco_spa/spa8800_v6_1_7/plugin-info diff --git a/plugins/wazo-cisco-spa/spa8800-6.1.7/templates/SPA8800.tpl b/plugins/wazo_cisco_spa/spa8800_v6_1_7/templates/SPA8800.tpl similarity index 100% rename from plugins/wazo-cisco-spa/spa8800-6.1.7/templates/SPA8800.tpl rename to plugins/wazo_cisco_spa/spa8800_v6_1_7/templates/SPA8800.tpl diff --git a/plugins/wazo-cisco-spa/spa8800-6.1.7/templates/common/model.cfg.tpl b/plugins/wazo_cisco_spa/spa8800_v6_1_7/templates/common/model.cfg.tpl similarity index 100% rename from plugins/wazo-cisco-spa/spa8800-6.1.7/templates/common/model.cfg.tpl rename to plugins/wazo_cisco_spa/spa8800_v6_1_7/templates/common/model.cfg.tpl diff --git a/plugins/wazo-cisco-spa/7.5.5/entry.py b/plugins/wazo_cisco_spa/v7_5_5/entry.py similarity index 100% rename from plugins/wazo-cisco-spa/7.5.5/entry.py rename to plugins/wazo_cisco_spa/v7_5_5/entry.py diff --git a/plugins/wazo-cisco-spa/7.5.5/pkgs/pkgs.db b/plugins/wazo_cisco_spa/v7_5_5/pkgs/pkgs.db similarity index 100% rename from plugins/wazo-cisco-spa/7.5.5/pkgs/pkgs.db rename to plugins/wazo_cisco_spa/v7_5_5/pkgs/pkgs.db diff --git a/plugins/wazo-cisco-spa/7.5.5/plugin-info b/plugins/wazo_cisco_spa/v7_5_5/plugin-info similarity index 100% rename from plugins/wazo-cisco-spa/7.5.5/plugin-info rename to plugins/wazo_cisco_spa/v7_5_5/plugin-info diff --git a/plugins/wazo-cisco-spa/7.5.5/templates/SPA301.tpl b/plugins/wazo_cisco_spa/v7_5_5/templates/SPA301.tpl similarity index 100% rename from plugins/wazo-cisco-spa/7.5.5/templates/SPA301.tpl rename to plugins/wazo_cisco_spa/v7_5_5/templates/SPA301.tpl diff --git a/plugins/wazo-cisco-spa/7.5.5/templates/SPA303.tpl b/plugins/wazo_cisco_spa/v7_5_5/templates/SPA303.tpl similarity index 100% rename from plugins/wazo-cisco-spa/7.5.5/templates/SPA303.tpl rename to plugins/wazo_cisco_spa/v7_5_5/templates/SPA303.tpl diff --git a/plugins/wazo-cisco-spa/7.5.5/templates/SPA501G.tpl b/plugins/wazo_cisco_spa/v7_5_5/templates/SPA501G.tpl similarity index 100% rename from plugins/wazo-cisco-spa/7.5.5/templates/SPA501G.tpl rename to plugins/wazo_cisco_spa/v7_5_5/templates/SPA501G.tpl diff --git a/plugins/wazo-cisco-spa/7.5.5/templates/SPA502G.tpl b/plugins/wazo_cisco_spa/v7_5_5/templates/SPA502G.tpl similarity index 100% rename from plugins/wazo-cisco-spa/7.5.5/templates/SPA502G.tpl rename to plugins/wazo_cisco_spa/v7_5_5/templates/SPA502G.tpl diff --git a/plugins/wazo-cisco-spa/7.5.5/templates/SPA504G.tpl b/plugins/wazo_cisco_spa/v7_5_5/templates/SPA504G.tpl similarity index 100% rename from plugins/wazo-cisco-spa/7.5.5/templates/SPA504G.tpl rename to plugins/wazo_cisco_spa/v7_5_5/templates/SPA504G.tpl diff --git a/plugins/wazo-cisco-spa/7.5.5/templates/SPA508G.tpl b/plugins/wazo_cisco_spa/v7_5_5/templates/SPA508G.tpl similarity index 100% rename from plugins/wazo-cisco-spa/7.5.5/templates/SPA508G.tpl rename to plugins/wazo_cisco_spa/v7_5_5/templates/SPA508G.tpl diff --git a/plugins/wazo-cisco-spa/7.5.5/templates/SPA509G.tpl b/plugins/wazo_cisco_spa/v7_5_5/templates/SPA509G.tpl similarity index 100% rename from plugins/wazo-cisco-spa/7.5.5/templates/SPA509G.tpl rename to plugins/wazo_cisco_spa/v7_5_5/templates/SPA509G.tpl diff --git a/plugins/wazo-cisco-spa/7.5.5/templates/SPA512G.tpl b/plugins/wazo_cisco_spa/v7_5_5/templates/SPA512G.tpl similarity index 100% rename from plugins/wazo-cisco-spa/7.5.5/templates/SPA512G.tpl rename to plugins/wazo_cisco_spa/v7_5_5/templates/SPA512G.tpl diff --git a/plugins/wazo-cisco-spa/7.5.5/templates/SPA514G.tpl b/plugins/wazo_cisco_spa/v7_5_5/templates/SPA514G.tpl similarity index 100% rename from plugins/wazo-cisco-spa/7.5.5/templates/SPA514G.tpl rename to plugins/wazo_cisco_spa/v7_5_5/templates/SPA514G.tpl diff --git a/plugins/wazo-cisco-spa/7.5.5/templates/SPA525G.tpl b/plugins/wazo_cisco_spa/v7_5_5/templates/SPA525G.tpl similarity index 100% rename from plugins/wazo-cisco-spa/7.5.5/templates/SPA525G.tpl rename to plugins/wazo_cisco_spa/v7_5_5/templates/SPA525G.tpl diff --git a/plugins/wazo-cisco-spa/7.5.5/templates/SPA525G2.tpl b/plugins/wazo_cisco_spa/v7_5_5/templates/SPA525G2.tpl similarity index 100% rename from plugins/wazo-cisco-spa/7.5.5/templates/SPA525G2.tpl rename to plugins/wazo_cisco_spa/v7_5_5/templates/SPA525G2.tpl diff --git a/plugins/wazo-cisco-spa/legacy/templates/common/model.cfg.tpl b/plugins/wazo_cisco_spa/v7_5_5/templates/common/model.cfg.tpl similarity index 100% rename from plugins/wazo-cisco-spa/legacy/templates/common/model.cfg.tpl rename to plugins/wazo_cisco_spa/v7_5_5/templates/common/model.cfg.tpl diff --git a/plugins/wazo-digium/build.py b/plugins/wazo_digium/build.py similarity index 60% rename from plugins/wazo-digium/build.py rename to plugins/wazo_digium/build.py index 1f9d4facc1af93b25e2e15f5f90bcde3b76f8335..00b9367de2def910d6d55db1b3ce2eb24e8a2bb8 100644 --- a/plugins/wazo-digium/build.py +++ b/plugins/wazo_digium/build.py @@ -1,4 +1,4 @@ -# Copyright 2014-2022 The Wazo Authors (see the AUTHORS file) +# Copyright 2014-2023 The Wazo Authors (see the AUTHORS file) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -12,26 +12,31 @@ # # You should have received a copy of the GNU General Public License # along with this program. If not, see - +from typing import TYPE_CHECKING, Callable from subprocess import check_call +if TYPE_CHECKING: + + def target( + target_id: str, plugin_id: str, std_dirs: bool = True + ) -> Callable[[str], None]: + """The `target` method is injected in `exec` call by the build script.""" + return lambda x: None + @target('1.4.0.0', 'wazo-digium-1.4.0.0') -def build_1_4_0_0(path): +def build_1_4_0_0(path: str) -> None: check_call(['rsync', '-rlp', '--exclude', '.*', 'common/', path]) - - check_call(['rsync', '-rlp', '--exclude', '.*', '1.4.0.0/', path]) + check_call(['rsync', '-rlp', '--exclude', '.*', 'v1_4_0_0/', path]) @target('2.2.1.8', 'wazo-digium-2.2.1.8') -def build_2_2_1_8(path): +def build_2_2_1_8(path: str) -> None: check_call(['rsync', '-rlp', '--exclude', '.*', 'common/', path]) - - check_call(['rsync', '-rlp', '--exclude', '.*', '2.2.1.8/', path]) + check_call(['rsync', '-rlp', '--exclude', '.*', 'v2_2_1_8/', path]) @target('2.8.1', 'wazo-digium-2.8.1') -def build_2_8_1(path): +def build_2_8_1(path: str) -> None: check_call(['rsync', '-rlp', '--exclude', '.*', 'common/', path]) - - check_call(['rsync', '-rlp', '--exclude', '.*', '2.8.1/', path]) + check_call(['rsync', '-rlp', '--exclude', '.*', 'v2_8_1/', path]) diff --git a/plugins/wazo-digium/common/common.py b/plugins/wazo_digium/common/common.py similarity index 100% rename from plugins/wazo-digium/common/common.py rename to plugins/wazo_digium/common/common.py diff --git a/plugins/wazo-digium/common/templates/base.tpl b/plugins/wazo_digium/common/templates/base.tpl similarity index 100% rename from plugins/wazo-digium/common/templates/base.tpl rename to plugins/wazo_digium/common/templates/base.tpl diff --git a/plugins/wazo-digium/common/templates/contact.tpl b/plugins/wazo_digium/common/templates/contact.tpl similarity index 100% rename from plugins/wazo-digium/common/templates/contact.tpl rename to plugins/wazo_digium/common/templates/contact.tpl diff --git a/plugins/wazo-digium/common/var/tftpboot/Digium/.gitignore b/plugins/wazo_digium/common/var/tftpboot/Digium/.gitignore similarity index 100% rename from plugins/wazo-digium/common/var/tftpboot/Digium/.gitignore rename to plugins/wazo_digium/common/var/tftpboot/Digium/.gitignore diff --git a/plugins/wazo-digium/1.4.0.0/entry.py b/plugins/wazo_digium/v1_4_0_0/entry.py similarity index 100% rename from plugins/wazo-digium/1.4.0.0/entry.py rename to plugins/wazo_digium/v1_4_0_0/entry.py diff --git a/plugins/wazo-digium/1.4.0.0/pkgs/pkgs.db b/plugins/wazo_digium/v1_4_0_0/pkgs/pkgs.db similarity index 100% rename from plugins/wazo-digium/1.4.0.0/pkgs/pkgs.db rename to plugins/wazo_digium/v1_4_0_0/pkgs/pkgs.db diff --git a/plugins/wazo-digium/1.4.0.0/plugin-info b/plugins/wazo_digium/v1_4_0_0/plugin-info similarity index 100% rename from plugins/wazo-digium/1.4.0.0/plugin-info rename to plugins/wazo_digium/v1_4_0_0/plugin-info diff --git a/plugins/wazo-digium/1.4.0.0/templates/D40.tpl b/plugins/wazo_digium/v1_4_0_0/templates/D40.tpl similarity index 100% rename from plugins/wazo-digium/1.4.0.0/templates/D40.tpl rename to plugins/wazo_digium/v1_4_0_0/templates/D40.tpl diff --git a/plugins/wazo-digium/1.4.0.0/templates/D50.tpl b/plugins/wazo_digium/v1_4_0_0/templates/D50.tpl similarity index 100% rename from plugins/wazo-digium/1.4.0.0/templates/D50.tpl rename to plugins/wazo_digium/v1_4_0_0/templates/D50.tpl diff --git a/plugins/wazo-digium/1.4.0.0/templates/D70.tpl b/plugins/wazo_digium/v1_4_0_0/templates/D70.tpl similarity index 100% rename from plugins/wazo-digium/1.4.0.0/templates/D70.tpl rename to plugins/wazo_digium/v1_4_0_0/templates/D70.tpl diff --git a/plugins/wazo-digium/1.4.0.0/templates/firmware.tpl b/plugins/wazo_digium/v1_4_0_0/templates/firmware.tpl similarity index 100% rename from plugins/wazo-digium/1.4.0.0/templates/firmware.tpl rename to plugins/wazo_digium/v1_4_0_0/templates/firmware.tpl diff --git a/plugins/wazo-digium/2.2.1.8/entry.py b/plugins/wazo_digium/v2_2_1_8/entry.py similarity index 100% rename from plugins/wazo-digium/2.2.1.8/entry.py rename to plugins/wazo_digium/v2_2_1_8/entry.py diff --git a/plugins/wazo-digium/2.2.1.8/pkgs/pkgs.db b/plugins/wazo_digium/v2_2_1_8/pkgs/pkgs.db similarity index 100% rename from plugins/wazo-digium/2.2.1.8/pkgs/pkgs.db rename to plugins/wazo_digium/v2_2_1_8/pkgs/pkgs.db diff --git a/plugins/wazo-digium/2.2.1.8/plugin-info b/plugins/wazo_digium/v2_2_1_8/plugin-info similarity index 100% rename from plugins/wazo-digium/2.2.1.8/plugin-info rename to plugins/wazo_digium/v2_2_1_8/plugin-info diff --git a/plugins/wazo-digium/2.2.1.8/templates/D40.tpl b/plugins/wazo_digium/v2_2_1_8/templates/D40.tpl similarity index 100% rename from plugins/wazo-digium/2.2.1.8/templates/D40.tpl rename to plugins/wazo_digium/v2_2_1_8/templates/D40.tpl diff --git a/plugins/wazo-digium/2.2.1.8/templates/D45.tpl b/plugins/wazo_digium/v2_2_1_8/templates/D45.tpl similarity index 100% rename from plugins/wazo-digium/2.2.1.8/templates/D45.tpl rename to plugins/wazo_digium/v2_2_1_8/templates/D45.tpl diff --git a/plugins/wazo-digium/2.2.1.8/templates/D50.tpl b/plugins/wazo_digium/v2_2_1_8/templates/D50.tpl similarity index 100% rename from plugins/wazo-digium/2.2.1.8/templates/D50.tpl rename to plugins/wazo_digium/v2_2_1_8/templates/D50.tpl diff --git a/plugins/wazo-digium/2.2.1.8/templates/D60.tpl b/plugins/wazo_digium/v2_2_1_8/templates/D60.tpl similarity index 100% rename from plugins/wazo-digium/2.2.1.8/templates/D60.tpl rename to plugins/wazo_digium/v2_2_1_8/templates/D60.tpl diff --git a/plugins/wazo-digium/2.2.1.8/templates/D62.tpl b/plugins/wazo_digium/v2_2_1_8/templates/D62.tpl similarity index 100% rename from plugins/wazo-digium/2.2.1.8/templates/D62.tpl rename to plugins/wazo_digium/v2_2_1_8/templates/D62.tpl diff --git a/plugins/wazo-digium/2.2.1.8/templates/D65.tpl b/plugins/wazo_digium/v2_2_1_8/templates/D65.tpl similarity index 100% rename from plugins/wazo-digium/2.2.1.8/templates/D65.tpl rename to plugins/wazo_digium/v2_2_1_8/templates/D65.tpl diff --git a/plugins/wazo-digium/2.2.1.8/templates/D70.tpl b/plugins/wazo_digium/v2_2_1_8/templates/D70.tpl similarity index 100% rename from plugins/wazo-digium/2.2.1.8/templates/D70.tpl rename to plugins/wazo_digium/v2_2_1_8/templates/D70.tpl diff --git a/plugins/wazo-digium/2.2.1.8/templates/firmware.tpl b/plugins/wazo_digium/v2_2_1_8/templates/firmware.tpl similarity index 100% rename from plugins/wazo-digium/2.2.1.8/templates/firmware.tpl rename to plugins/wazo_digium/v2_2_1_8/templates/firmware.tpl diff --git a/plugins/wazo-digium/2.8.1/entry.py b/plugins/wazo_digium/v2_8_1/entry.py similarity index 100% rename from plugins/wazo-digium/2.8.1/entry.py rename to plugins/wazo_digium/v2_8_1/entry.py diff --git a/plugins/wazo-digium/2.8.1/pkgs/pkgs.db b/plugins/wazo_digium/v2_8_1/pkgs/pkgs.db similarity index 100% rename from plugins/wazo-digium/2.8.1/pkgs/pkgs.db rename to plugins/wazo_digium/v2_8_1/pkgs/pkgs.db diff --git a/plugins/wazo-digium/2.8.1/plugin-info b/plugins/wazo_digium/v2_8_1/plugin-info similarity index 100% rename from plugins/wazo-digium/2.8.1/plugin-info rename to plugins/wazo_digium/v2_8_1/plugin-info diff --git a/plugins/wazo-digium/2.8.1/templates/D40.tpl b/plugins/wazo_digium/v2_8_1/templates/D40.tpl similarity index 100% rename from plugins/wazo-digium/2.8.1/templates/D40.tpl rename to plugins/wazo_digium/v2_8_1/templates/D40.tpl diff --git a/plugins/wazo-digium/2.8.1/templates/D45.tpl b/plugins/wazo_digium/v2_8_1/templates/D45.tpl similarity index 100% rename from plugins/wazo-digium/2.8.1/templates/D45.tpl rename to plugins/wazo_digium/v2_8_1/templates/D45.tpl diff --git a/plugins/wazo-digium/2.8.1/templates/D50.tpl b/plugins/wazo_digium/v2_8_1/templates/D50.tpl similarity index 100% rename from plugins/wazo-digium/2.8.1/templates/D50.tpl rename to plugins/wazo_digium/v2_8_1/templates/D50.tpl diff --git a/plugins/wazo-digium/2.8.1/templates/D60.tpl b/plugins/wazo_digium/v2_8_1/templates/D60.tpl similarity index 100% rename from plugins/wazo-digium/2.8.1/templates/D60.tpl rename to plugins/wazo_digium/v2_8_1/templates/D60.tpl diff --git a/plugins/wazo-digium/2.8.1/templates/D62.tpl b/plugins/wazo_digium/v2_8_1/templates/D62.tpl similarity index 100% rename from plugins/wazo-digium/2.8.1/templates/D62.tpl rename to plugins/wazo_digium/v2_8_1/templates/D62.tpl diff --git a/plugins/wazo-digium/2.8.1/templates/D65.tpl b/plugins/wazo_digium/v2_8_1/templates/D65.tpl similarity index 100% rename from plugins/wazo-digium/2.8.1/templates/D65.tpl rename to plugins/wazo_digium/v2_8_1/templates/D65.tpl diff --git a/plugins/wazo-digium/2.8.1/templates/D70.tpl b/plugins/wazo_digium/v2_8_1/templates/D70.tpl similarity index 100% rename from plugins/wazo-digium/2.8.1/templates/D70.tpl rename to plugins/wazo_digium/v2_8_1/templates/D70.tpl diff --git a/plugins/wazo-digium/2.8.1/templates/firmware.tpl b/plugins/wazo_digium/v2_8_1/templates/firmware.tpl similarity index 100% rename from plugins/wazo-digium/2.8.1/templates/firmware.tpl rename to plugins/wazo_digium/v2_8_1/templates/firmware.tpl diff --git a/plugins/wazo-yealink/v82/__init__.py b/plugins/wazo_fanvil/__init__.py similarity index 100% rename from plugins/wazo-yealink/v82/__init__.py rename to plugins/wazo_fanvil/__init__.py diff --git a/plugins/wazo_fanvil/build.py b/plugins/wazo_fanvil/build.py new file mode 100644 index 0000000000000000000000000000000000000000..8114ab007e6e671b1066befad32f62a83116166b --- /dev/null +++ b/plugins/wazo_fanvil/build.py @@ -0,0 +1,43 @@ +""" +Copyright 2013-2023 The Wazo Authors (see the AUTHORS file) +SPDX-License-Identifier: GPL-3.0-or-later + +Depends on the following external programs: + -rsync +""" +from __future__ import annotations + +from typing import TYPE_CHECKING, Callable +from subprocess import check_call + +if TYPE_CHECKING: + + def target( + target_id: str, plugin_id: str, std_dirs: bool = True + ) -> Callable[[str], None]: + """The `target` method is injected in `exec` call by the build script.""" + return lambda x: None + + +@target('2.3', 'wazo-fanvil-2.3') +def build_2_3(path: str) -> None: + check_call(['rsync', '-rlp', '--exclude', '.*', 'common/', path]) + check_call(['rsync', '-rlp', '--exclude', '.*', 'v2_3/', path]) + + +@target('serie-x', 'wazo-fanvil-serie-x') +def build_x(path: str) -> None: + check_call(['rsync', '-rlp', '--exclude', '.*', 'common/', path]) + check_call(['rsync', '-rlp', '--exclude', '.*', 'serie_x/', path]) + + +@target('serie-v', 'wazo-fanvil-serie-v') +def build_v(path: str) -> None: + check_call(['rsync', '-rlp', '--exclude', '.*', 'common/', path]) + check_call(['rsync', '-rlp', '--exclude', '.*', 'serie_v/', path]) + + +@target('serie-i', 'wazo-fanvil-serie-i') +def build_i(path: str) -> None: + check_call(['rsync', '-rlp', '--exclude', '.*', 'common/', path]) + check_call(['rsync', '-rlp', '--exclude', '.*', 'serie_i/', path]) diff --git a/plugins/wazo-yealink/v82/tests/__init__.py b/plugins/wazo_fanvil/common/__init__.py similarity index 100% rename from plugins/wazo-yealink/v82/tests/__init__.py rename to plugins/wazo_fanvil/common/__init__.py diff --git a/plugins/wazo-fanvil/common/common.py b/plugins/wazo_fanvil/common/common.py similarity index 64% rename from plugins/wazo-fanvil/common/common.py rename to plugins/wazo_fanvil/common/common.py index 7380e46f8fcf62c9f2d14dfea1644a32d6918654..428a77920f10c6cb230e1c5955b4cdd15bce5fe7 100644 --- a/plugins/wazo-fanvil/common/common.py +++ b/plugins/wazo_fanvil/common/common.py @@ -2,7 +2,9 @@ # SPDX-License-Identifier: GPL-3.0-or-later from __future__ import annotations +from typing import TYPE_CHECKING, Any import logging +import math import os.path import re @@ -21,6 +23,22 @@ from twisted.internet import defer logger = logging.getLogger('plugin.wazo-fanvil') +if TYPE_CHECKING: + from typing import TypedDict + + class FunctionKeyDict(TypedDict): + label: str + value: str + line: str + type: str + + class FKeyDict(TypedDict): + id: int + title: str + type: int + value: str + + class BaseFanvilHTTPDeviceInfoExtractor: _PATH_REGEX = re.compile(r'\b(?!0{12})([\da-f]{12})\.cfg$') _UA_REGEX = re.compile( @@ -136,6 +154,12 @@ class BaseFanvilPlugin(StandardPlugin): 'ar', ) + _COMMON_FILES: dict[str, tuple[str, str, str]] + _MODEL_FIRMWARE_MAPPING: dict[str, str] + _FUNCTION_KEYS_PER_PAGE: dict[str, int] + _LINE_KEYS_PER_PAGE: dict[str, int] + _TOP_FUNCTION_KEYS: dict[str, int] + def __init__(self, app, plugin_dir, gen_cfg, spec_cfg): super().__init__(app, plugin_dir, gen_cfg, spec_cfg) # update to use the non-standard tftpboot directory @@ -157,7 +181,7 @@ class BaseFanvilPlugin(StandardPlugin): formatted_mac = format_mac(device['mac'], separator='', uppercase=False) return f'{formatted_mac}.cfg' - def _check_config(self, raw_config): + def _check_config(self, raw_config: dict[str, Any]): if 'http_port' not in raw_config: raise RawConfigError('only support configuration via HTTP') @@ -165,11 +189,11 @@ class BaseFanvilPlugin(StandardPlugin): if 'mac' not in device: raise Exception('MAC address needed for device configuration') - def _add_wazo_phoned_user_service_url(self, raw_config, service): + def _add_wazo_phoned_user_service_url(self, raw_config: dict[str, Any], service): if hasattr(plugins, 'add_wazo_phoned_user_service_url'): plugins.add_wazo_phoned_user_service_url(raw_config, 'yealink', service) - def _add_server_url(self, raw_config): + def _add_server_url(self, raw_config: dict[str, Any]): if 'http_base_url' in raw_config: _, _, remaining_url = raw_config['http_base_url'].partition('://') raw_config['XX_server_url'] = raw_config['http_base_url'] @@ -179,7 +203,7 @@ class BaseFanvilPlugin(StandardPlugin): raw_config['XX_server_url_without_scheme'] = base_url raw_config['XX_server_url'] = f"http://{base_url}" - def configure(self, device, raw_config): + def configure(self, device, raw_config: dict[str, Any]) -> None: self._check_config(raw_config) self._check_device(device) self._check_lines_password(raw_config) @@ -199,10 +223,10 @@ class BaseFanvilPlugin(StandardPlugin): path = os.path.join(self._tftpboot_dir, filename) self._tpl_helper.dump(tpl, raw_config, path, self._ENCODING) - def deconfigure(self, device): + def deconfigure(self, device) -> None: self._remove_configuration_file(device) - def configure_common(self, raw_config): + def configure_common(self, raw_config: dict[str, Any]) -> None: self._add_server_url(raw_config) for filename, ( model_info, @@ -222,7 +246,7 @@ class BaseFanvilPlugin(StandardPlugin): except OSError as e: logger.info('error while removing configuration file: %s', e) - def synchronize(self, device, raw_config): + def synchronize(self, device, raw_config: dict[str, Any]): return synchronize.standard_sip_synchronize(device) def get_remote_state_trigger_filename(self, device): @@ -231,15 +255,16 @@ class BaseFanvilPlugin(StandardPlugin): return self._dev_specific_filename(device) - def _check_lines_password(self, raw_config): + def _check_lines_password(self, raw_config: dict[str, Any]): for line in raw_config['sip_lines'].values(): if line['password'] == 'autoprov': line['password'] = '' def _extract_dst_change(self, dst_change): - lines = {} - lines['month'] = dst_change['month'] - lines['hour'] = min(dst_change['time'].as_hours, 23) + lines = { + 'month': dst_change['month'], + 'hour': min(dst_change['time'].as_hours, 23), + } if dst_change['day'].startswith('D'): lines['dst_wday'] = dst_change['day'][1:] else: @@ -268,7 +293,7 @@ class BaseFanvilPlugin(StandardPlugin): tz_all['dst_end'] = self._extract_dst_change(tzinfo['dst']['end']) return tz_all - def _add_timezone(self, device, raw_config): + def _add_timezone(self, device, raw_config: dict[str, Any]): if 'timezone' in raw_config: try: tzinfo = tzinform.get_timezone_info(raw_config['timezone']) @@ -280,7 +305,7 @@ class BaseFanvilPlugin(StandardPlugin): def _is_new_model(self, device): return self._NEW_MODEL_REGEX.match(device['model']) is not None - def _add_locale(self, device, raw_config): + def _add_locale(self, device, raw_config: dict[str, Any]): locale = raw_config.get('locale') if not locale: return @@ -295,7 +320,7 @@ class BaseFanvilPlugin(StandardPlugin): if directory_key_text: raw_config['XX_directory'] = directory_key_text - def _update_lines(self, raw_config): + def _update_lines(self, raw_config: dict[str, Any]): default_dtmf_mode = raw_config.get('sip_dtmf_mode', 'SIP-INFO') for line in raw_config['sip_lines'].values(): line['XX_dtmf_mode'] = self._SIP_DTMF_MODE[ @@ -310,99 +335,147 @@ class BaseFanvilPlugin(StandardPlugin): if 'voicemail' not in line and 'exten_voicemail' in raw_config: line['voicemail'] = raw_config['exten_voicemail'] - def _add_sip_transport(self, raw_config): + def _add_sip_transport(self, raw_config: dict[str, Any]) -> None: raw_config['X_sip_transport_protocol'] = self._SIP_TRANSPORT[ raw_config.get('sip_transport', 'udp') ] - def _format_funckey_speeddial(self, funckey_dict): - return '{value}@{line}/f'.format( - value=funckey_dict['value'], line=funckey_dict['line'] - ) + def _format_funckey_speeddial(self, funckey_dict: FunctionKeyDict) -> str: + return f'{funckey_dict["value"]}@{funckey_dict["line"]}/f' - def _format_funckey_blf(self, funckey_dict, exten_pickup_call=None): + def _format_funckey_blf( + self, funckey_dict: FunctionKeyDict, exten_pickup_call=None + ) -> str: # Be warned that blf works only for DSS keys. + blf_entry = f'{funckey_dict["value"]}@{funckey_dict["line"]}/ba' if exten_pickup_call: - return '{value}@{line}/ba{exten_pickup}{value}'.format( - value=funckey_dict['value'], - line=funckey_dict['line'], - exten_pickup=exten_pickup_call, - ) + return f'{blf_entry}{exten_pickup_call}{funckey_dict["value"]}' + return blf_entry + + def _format_funckey_call_park(self, funckey_dict: FunctionKeyDict) -> str: + return f'{funckey_dict["value"]}@{funckey_dict["line"]}/c' + + @staticmethod + def _split_fkeys( + funckeys: dict[str, FunctionKeyDict], threshold: int + ) -> tuple[dict[int, FunctionKeyDict], dict[int, FunctionKeyDict]]: + fkeys_top = {} + fkeys_bottom = {} + + for funckey_no, funckey_dict in funckeys: + keynum = int(funckey_no) + if keynum <= threshold: + fkeys_top[keynum] = funckey_dict + else: + fkeys_bottom[keynum - threshold] = funckey_dict + return fkeys_top, fkeys_bottom + + def _format_fkey( + self, + funckey_number: int, + funckey: FunctionKeyDict, + fkey_offset: int, + pickup_exten: str | None, + ) -> FKeyDict: + fkey = {'id': funckey_number, 'title': funckey['label'], 'type': 2} + if funckey['type'] == 'speeddial': + fkey['type'] = 4 + fkey['value'] = self._format_funckey_speeddial(funckey) + elif funckey['type'] == 'blf': + fkey['value'] = self._format_funckey_blf(funckey, pickup_exten) + elif funckey['type'] == 'park': + fkey['value'] = self._format_funckey_call_park(funckey) else: - return '{value}@{line}/ba'.format( - value=funckey_dict['value'], line=funckey_dict['line'] + logger.info('Unsupported funckey type: %s', funckey['type']) + fkey['type'] = 2 + return fkey + + def _format_fkeys( + self, + fkeys: dict[int, FunctionKeyDict], + max_fkeys: int, + offset: int, + exten_pickup_call: str | None, + ) -> list[FKeyDict]: + formatted_fkeys = [] + for fkey_num in range(1, max_fkeys + 1): + fkey = fkeys.get(fkey_num) + if not fkey: + fkey = {'id': fkey_num, 'label': '', 'type': None} + formatted_fkeys.append( + self._format_fkey(fkey_num, fkey, offset, exten_pickup_call) ) + return formatted_fkeys - def _format_funckey_call_park(self, funckey_dict): - return '{value}@{line}/c'.format( - value=funckey_dict['value'], line=funckey_dict['line'] + def _add_fkeys(self, device, raw_config: dict[str, Any]): + exten_pickup_call: str | None = raw_config.get('exten_pickup_call') + offset = 0 if self._is_new_model(device) else 1 + raw_config['XX_offset'] = offset + clean_model_name = device['model'].split('-')[0] + top_key_threshold = self._TOP_FUNCTION_KEYS.get(clean_model_name, 0) + raw_config['XX_top_key_threshold'] = top_key_threshold + top_keys, bottom_keys = self._split_fkeys( + raw_config['funckeys'].items(), top_key_threshold ) - def _add_fkeys(self, device, raw_config): - lines = [] - exten_pickup_call = raw_config.get('exten_pickup_call') - offset = 0 if self._is_new_model(device) else 1 - max_funckey_position = 0 - for funckey_no, funckey_dict in raw_config['funckeys'].items(): - fkey_line = {} - keynum = int(funckey_no) - fkey_id = keynum + offset - fkey_line['id'] = fkey_id - fkey_line['title'] = funckey_dict['label'] - fkey_line['type'] = 1 - if keynum > max_funckey_position: - max_funckey_position = keynum - - funckey_type = funckey_dict['type'] - if funckey_type == 'speeddial': - fkey_line['value'] = self._format_funckey_speeddial(funckey_dict) - if funckey_dict['value'].startswith('*'): - fkey_line['type'] = 4 - elif funckey_type == 'blf': - if keynum <= 12: - fkey_line['value'] = self._format_funckey_blf( - funckey_dict, exten_pickup_call - ) - else: - logger.info('For Fanvil, blf is only available on DSS keys') - fkey_line['value'] = self._format_funckey_speeddial(funckey_dict) - elif funckey_type == 'park': - fkey_line['value'] = self._format_funckey_call_park(funckey_dict) - else: - logger.info('Unsupported funckey type: %s', funckey_type) - continue + raw_config['XX_top_keys'] = top_keys + raw_config['XX_bottom_keys'] = bottom_keys - lines.append(fkey_line) + top_keys_per_page = self._LINE_KEYS_PER_PAGE.get(clean_model_name, None) + keys_per_page = self._FUNCTION_KEYS_PER_PAGE.get(clean_model_name, None) - keys_per_page = self._FUNCTION_KEYS_PER_PAGE.get( - device['model'].split('-')[0], None + max_top_keys = max(top_keys) if top_keys else 0 + max_bottom_keys = max(bottom_keys) if bottom_keys else 0 + formatted_top_keys = self._format_fkeys( + top_keys, max_top_keys, offset, exten_pickup_call ) - if keys_per_page: - raw_config['XX_max_page'] = max_funckey_position // keys_per_page + 1 - raw_config['XX_paginated_fkeys'] = sorted( - [ - ( - (fkey['id'] - 1) // keys_per_page, - (fkey['id'] - 1) % keys_per_page, - fkey, - ) - for fkey in lines - ] + formatted_bottom_keys = self._format_fkeys( + bottom_keys, max_bottom_keys, offset, exten_pickup_call + ) + if top_keys_per_page: + max_top_page, paginated_top_fkeys = self._paginate( + formatted_top_keys, max_top_keys, top_keys_per_page ) + raw_config['XX_max_top_page'] = max_top_page + raw_config['XX_paginated_top_fkeys'] = paginated_top_fkeys else: - raw_config['XX_paginated_fkeys'] = [ - (0, fkey['id'] - 1, fkey) for fkey in lines + raw_config['XX_paginated_top_fkeys'] = [ + (offset, fkey['id'] + offset, fkey) for fkey in top_keys ] - raw_config['XX_fkeys'] = lines - def _add_phonebook_url(self, raw_config): + if keys_per_page: + max_bottom_page, paginated_bottom_fkeys = self._paginate( + formatted_bottom_keys, max_bottom_keys, keys_per_page + ) + raw_config['XX_max_page'] = max_bottom_page + raw_config['XX_paginated_fkeys'] = paginated_bottom_fkeys + raw_config['XX_fkeys'] = formatted_top_keys + formatted_bottom_keys + + @staticmethod + def _paginate( + fkeys: list[FKeyDict], max_position: int, results_per_page: int + ) -> tuple[int, list[tuple[int, int, FKeyDict]]]: + max_page = math.ceil(max_position / results_per_page) + paginated_fkeys = sorted( + [ + ( + ((fkey['id'] - 1) // results_per_page) + 1, + ((fkey['id'] - 1) % results_per_page) + 1, + fkey, + ) + for fkey in fkeys + ] + ) + return max_page, paginated_fkeys + + def _add_phonebook_url(self, raw_config: dict[str, Any]) -> None: if ( hasattr(plugins, 'add_xivo_phonebook_url') and raw_config.get('config_version', 0) >= 1 ): plugins.add_xivo_phonebook_url(raw_config, 'fanvil') - def _add_firmware(self, device, raw_config): + def _add_firmware(self, device, raw_config: dict[str, Any]) -> None: model = device.get('model') if model in self._MODEL_FIRMWARE_MAPPING: raw_config['XX_fw_filename'] = self._MODEL_FIRMWARE_MAPPING[model] diff --git a/plugins/wazo-fanvil/common/templates/V62.tpl b/plugins/wazo_fanvil/common/templates/V62.tpl similarity index 100% rename from plugins/wazo-fanvil/common/templates/V62.tpl rename to plugins/wazo_fanvil/common/templates/V62.tpl diff --git a/plugins/wazo-fanvil/common/templates/V64.tpl b/plugins/wazo_fanvil/common/templates/V64.tpl similarity index 100% rename from plugins/wazo-fanvil/common/templates/V64.tpl rename to plugins/wazo_fanvil/common/templates/V64.tpl diff --git a/plugins/wazo-fanvil/common/templates/V65.tpl b/plugins/wazo_fanvil/common/templates/V65.tpl similarity index 100% rename from plugins/wazo-fanvil/common/templates/V65.tpl rename to plugins/wazo_fanvil/common/templates/V65.tpl diff --git a/plugins/wazo-fanvil/common/templates/V67.tpl b/plugins/wazo_fanvil/common/templates/V67.tpl similarity index 100% rename from plugins/wazo-fanvil/common/templates/V67.tpl rename to plugins/wazo_fanvil/common/templates/V67.tpl diff --git a/plugins/wazo-fanvil/common/templates/X2.tpl b/plugins/wazo_fanvil/common/templates/X2.tpl similarity index 100% rename from plugins/wazo-fanvil/common/templates/X2.tpl rename to plugins/wazo_fanvil/common/templates/X2.tpl diff --git a/plugins/wazo-fanvil/common/templates/X210-Pro.tpl b/plugins/wazo_fanvil/common/templates/X210-Pro.tpl similarity index 100% rename from plugins/wazo-fanvil/common/templates/X210-Pro.tpl rename to plugins/wazo_fanvil/common/templates/X210-Pro.tpl diff --git a/plugins/wazo-fanvil/common/templates/X210.tpl b/plugins/wazo_fanvil/common/templates/X210.tpl similarity index 100% rename from plugins/wazo-fanvil/common/templates/X210.tpl rename to plugins/wazo_fanvil/common/templates/X210.tpl diff --git a/plugins/wazo-fanvil/common/templates/X210i-Pro.tpl b/plugins/wazo_fanvil/common/templates/X210i-Pro.tpl similarity index 100% rename from plugins/wazo-fanvil/common/templates/X210i-Pro.tpl rename to plugins/wazo_fanvil/common/templates/X210i-Pro.tpl diff --git a/plugins/wazo-fanvil/common/templates/X210i.tpl b/plugins/wazo_fanvil/common/templates/X210i.tpl similarity index 100% rename from plugins/wazo-fanvil/common/templates/X210i.tpl rename to plugins/wazo_fanvil/common/templates/X210i.tpl diff --git a/plugins/wazo-fanvil/common/templates/X3.tpl b/plugins/wazo_fanvil/common/templates/X3.tpl similarity index 100% rename from plugins/wazo-fanvil/common/templates/X3.tpl rename to plugins/wazo_fanvil/common/templates/X3.tpl diff --git a/plugins/wazo-fanvil/common/templates/X3S.tpl b/plugins/wazo_fanvil/common/templates/X3S.tpl similarity index 100% rename from plugins/wazo-fanvil/common/templates/X3S.tpl rename to plugins/wazo_fanvil/common/templates/X3S.tpl diff --git a/plugins/wazo-fanvil/common/templates/X3SG.tpl b/plugins/wazo_fanvil/common/templates/X3SG.tpl similarity index 100% rename from plugins/wazo-fanvil/common/templates/X3SG.tpl rename to plugins/wazo_fanvil/common/templates/X3SG.tpl diff --git a/plugins/wazo-fanvil/common/templates/X4.tpl b/plugins/wazo_fanvil/common/templates/X4.tpl similarity index 100% rename from plugins/wazo-fanvil/common/templates/X4.tpl rename to plugins/wazo_fanvil/common/templates/X4.tpl diff --git a/plugins/wazo-fanvil/common/templates/X4U-Pro.tpl b/plugins/wazo_fanvil/common/templates/X4U-Pro.tpl similarity index 100% rename from plugins/wazo-fanvil/common/templates/X4U-Pro.tpl rename to plugins/wazo_fanvil/common/templates/X4U-Pro.tpl diff --git a/plugins/wazo-fanvil/common/templates/X4U.tpl b/plugins/wazo_fanvil/common/templates/X4U.tpl similarity index 100% rename from plugins/wazo-fanvil/common/templates/X4U.tpl rename to plugins/wazo_fanvil/common/templates/X4U.tpl diff --git a/plugins/wazo-fanvil/common/templates/X5.tpl b/plugins/wazo_fanvil/common/templates/X5.tpl similarity index 100% rename from plugins/wazo-fanvil/common/templates/X5.tpl rename to plugins/wazo_fanvil/common/templates/X5.tpl diff --git a/plugins/wazo-fanvil/common/templates/X5S.tpl b/plugins/wazo_fanvil/common/templates/X5S.tpl similarity index 100% rename from plugins/wazo-fanvil/common/templates/X5S.tpl rename to plugins/wazo_fanvil/common/templates/X5S.tpl diff --git a/plugins/wazo-fanvil/common/templates/X5U-Pro.tpl b/plugins/wazo_fanvil/common/templates/X5U-Pro.tpl similarity index 100% rename from plugins/wazo-fanvil/common/templates/X5U-Pro.tpl rename to plugins/wazo_fanvil/common/templates/X5U-Pro.tpl diff --git a/plugins/wazo-fanvil/common/templates/X5U.tpl b/plugins/wazo_fanvil/common/templates/X5U.tpl similarity index 100% rename from plugins/wazo-fanvil/common/templates/X5U.tpl rename to plugins/wazo_fanvil/common/templates/X5U.tpl diff --git a/plugins/wazo-fanvil/common/templates/X6.tpl b/plugins/wazo_fanvil/common/templates/X6.tpl similarity index 100% rename from plugins/wazo-fanvil/common/templates/X6.tpl rename to plugins/wazo_fanvil/common/templates/X6.tpl diff --git a/plugins/wazo-fanvil/common/templates/X6U-Pro.tpl b/plugins/wazo_fanvil/common/templates/X6U-Pro.tpl similarity index 100% rename from plugins/wazo-fanvil/common/templates/X6U-Pro.tpl rename to plugins/wazo_fanvil/common/templates/X6U-Pro.tpl diff --git a/plugins/wazo-fanvil/common/templates/X6U.tpl b/plugins/wazo_fanvil/common/templates/X6U.tpl similarity index 100% rename from plugins/wazo-fanvil/common/templates/X6U.tpl rename to plugins/wazo_fanvil/common/templates/X6U.tpl diff --git a/plugins/wazo-fanvil/common/templates/X6V2.tpl b/plugins/wazo_fanvil/common/templates/X6V2.tpl similarity index 100% rename from plugins/wazo-fanvil/common/templates/X6V2.tpl rename to plugins/wazo_fanvil/common/templates/X6V2.tpl diff --git a/plugins/wazo-fanvil/common/templates/X7-Pro.tpl b/plugins/wazo_fanvil/common/templates/X7-Pro.tpl similarity index 100% rename from plugins/wazo-fanvil/common/templates/X7-Pro.tpl rename to plugins/wazo_fanvil/common/templates/X7-Pro.tpl diff --git a/plugins/wazo-fanvil/common/templates/X7.tpl b/plugins/wazo_fanvil/common/templates/X7.tpl similarity index 100% rename from plugins/wazo-fanvil/common/templates/X7.tpl rename to plugins/wazo_fanvil/common/templates/X7.tpl diff --git a/plugins/wazo-fanvil/common/templates/X7C-Pro.tpl b/plugins/wazo_fanvil/common/templates/X7C-Pro.tpl similarity index 100% rename from plugins/wazo-fanvil/common/templates/X7C-Pro.tpl rename to plugins/wazo_fanvil/common/templates/X7C-Pro.tpl diff --git a/plugins/wazo-fanvil/common/templates/X7C.tpl b/plugins/wazo_fanvil/common/templates/X7C.tpl similarity index 100% rename from plugins/wazo-fanvil/common/templates/X7C.tpl rename to plugins/wazo_fanvil/common/templates/X7C.tpl diff --git a/plugins/wazo-fanvil/common/templates/base-V-series.tpl b/plugins/wazo_fanvil/common/templates/base-V-series.tpl similarity index 100% rename from plugins/wazo-fanvil/common/templates/base-V-series.tpl rename to plugins/wazo_fanvil/common/templates/base-V-series.tpl diff --git a/plugins/wazo-fanvil/common/templates/base-V67.tpl b/plugins/wazo_fanvil/common/templates/base-V67.tpl similarity index 100% rename from plugins/wazo-fanvil/common/templates/base-V67.tpl rename to plugins/wazo_fanvil/common/templates/base-V67.tpl diff --git a/plugins/wazo-fanvil/common/templates/base-i-series.tpl b/plugins/wazo_fanvil/common/templates/base-i-series.tpl similarity index 100% rename from plugins/wazo-fanvil/common/templates/base-i-series.tpl rename to plugins/wazo_fanvil/common/templates/base-i-series.tpl diff --git a/plugins/wazo-fanvil/common/templates/base-new.tpl b/plugins/wazo_fanvil/common/templates/base-new.tpl similarity index 79% rename from plugins/wazo-fanvil/common/templates/base-new.tpl rename to plugins/wazo_fanvil/common/templates/base-new.tpl index a047adc18b1f464d93ecc3eb6860080e847e97f3..b73b33d7666f7a31566cdf202542c8fe4a780bba 100644 --- a/plugins/wazo-fanvil/common/templates/base-new.tpl +++ b/plugins/wazo_fanvil/common/templates/base-new.tpl @@ -33,10 +33,11 @@ {{ admin_password|d('123') }} - {{ XX_locale }} - {% for line_no, line in sip_lines.items() %} + {{ XX_locale }} + {% if sip_lines -%} + {% set line_no, line = sip_lines.items()|first -%} {{ line['display_name']|e }} {{ line['number'] }} - {% endfor %} + {% endif %} {% if ntp_enabled -%} @@ -51,7 +52,7 @@ {{ XX_timezone['time_zone_name'] }} {% if XX_timezone['enable_dst'] -%} 2 - 2 + 2 {{ XX_timezone['dst_min_offset'] }} {% macro dst_change(suffix, value) -%} {{ value['month'] }} @@ -190,46 +191,55 @@ + + + + {%- if XX_paginated_top_fkeys %} + - {%- if sip_lines %} - {% for line_no in sip_lines -%} - - 2 - SIP{{ line_no }} - - - {%- endfor %} - {%- else %} - - 2 - SIP1 - - - {%- endif %} + {%- for page, index, key in XX_paginated_top_fkeys %} + {%- if loop.index0 != 0 and page != loop.previtem[0] %} - {% if XX_paginated_fkeys -%} - {{ XX_max_page }} - {% for page, index, fkey in XX_paginated_fkeys -%} - {% if loop.index0 == 0 or page != loop.previtem[0] -%} - {% if loop.index0 != 0 -%} - - {%- endif %} - + {%- endif %} - - {{ fkey['type'] }} - {{ fkey['value'] }} - {{ fkey['title'] }} + + {% if (page * index)|string in sip_lines %} + 2 + SIP{{ index }} + + {% else %} + {{ key['type'] }} + {{ key['value'] }} + {{ key['title'] }} + {% endif %} - {%- endfor %} - - {% endif -%} - {% if XX_xivo_phonebook_url -%} - - 21 - {{ XX_xivo_phonebook_url }} - {{ XX_directory|d('Directory') }} - - {%- endif %} + {%- endfor %} + + {%- endif -%} + {% if XX_paginated_fkeys -%} + + {{ XX_max_page }} + {% for page, index, fkey in XX_paginated_fkeys -%} + {% if loop.index0 == 0 or page != loop.previtem[0] -%} + {% if loop.index0 != 0 -%} + + {%- endif %} + + {%- endif %} + + {{ fkey['type'] }} + {{ fkey['value'] }} + {{ fkey['title'] }} + + {%- endfor %} + + {% endif -%} + {% if XX_xivo_phonebook_url -%} + + 21 + {{ XX_xivo_phonebook_url }} + {{ XX_directory|d('Directory') }} + + {%- endif %} diff --git a/plugins/wazo-fanvil/common/templates/base.tpl b/plugins/wazo_fanvil/common/templates/base.tpl similarity index 100% rename from plugins/wazo-fanvil/common/templates/base.tpl rename to plugins/wazo_fanvil/common/templates/base.tpl diff --git a/plugins/wazo-fanvil/common/templates/common/model-i10.tpl b/plugins/wazo_fanvil/common/templates/common/model-i10.tpl similarity index 100% rename from plugins/wazo-fanvil/common/templates/common/model-i10.tpl rename to plugins/wazo_fanvil/common/templates/common/model-i10.tpl diff --git a/plugins/wazo-fanvil/common/templates/common/model-i1x.tpl b/plugins/wazo_fanvil/common/templates/common/model-i1x.tpl similarity index 100% rename from plugins/wazo-fanvil/common/templates/common/model-i1x.tpl rename to plugins/wazo_fanvil/common/templates/common/model-i1x.tpl diff --git a/plugins/wazo-fanvil/common/templates/common/model-i5x.tpl b/plugins/wazo_fanvil/common/templates/common/model-i5x.tpl similarity index 100% rename from plugins/wazo-fanvil/common/templates/common/model-i5x.tpl rename to plugins/wazo_fanvil/common/templates/common/model-i5x.tpl diff --git a/plugins/wazo-fanvil/common/templates/common/model-i6x.tpl b/plugins/wazo_fanvil/common/templates/common/model-i6x.tpl similarity index 100% rename from plugins/wazo-fanvil/common/templates/common/model-i6x.tpl rename to plugins/wazo_fanvil/common/templates/common/model-i6x.tpl diff --git a/plugins/wazo-fanvil/common/templates/common/model-v.tpl b/plugins/wazo_fanvil/common/templates/common/model-v.tpl similarity index 100% rename from plugins/wazo-fanvil/common/templates/common/model-v.tpl rename to plugins/wazo_fanvil/common/templates/common/model-v.tpl diff --git a/plugins/wazo-fanvil/common/templates/common/model-v67.tpl b/plugins/wazo_fanvil/common/templates/common/model-v67.tpl similarity index 100% rename from plugins/wazo-fanvil/common/templates/common/model-v67.tpl rename to plugins/wazo_fanvil/common/templates/common/model-v67.tpl diff --git a/plugins/wazo-fanvil/common/templates/common/model-v6x.tpl b/plugins/wazo_fanvil/common/templates/common/model-v6x.tpl similarity index 100% rename from plugins/wazo-fanvil/common/templates/common/model-v6x.tpl rename to plugins/wazo_fanvil/common/templates/common/model-v6x.tpl diff --git a/plugins/wazo-fanvil/common/templates/common/model.tpl b/plugins/wazo_fanvil/common/templates/common/model.tpl similarity index 100% rename from plugins/wazo-fanvil/common/templates/common/model.tpl rename to plugins/wazo_fanvil/common/templates/common/model.tpl diff --git a/plugins/wazo-fanvil/common/templates/f0C00580000.cfg b/plugins/wazo_fanvil/common/templates/f0C00580000.cfg similarity index 100% rename from plugins/wazo-fanvil/common/templates/f0C00580000.cfg rename to plugins/wazo_fanvil/common/templates/f0C00580000.cfg diff --git a/plugins/wazo-fanvil/common/templates/f0C00620000.cfg b/plugins/wazo_fanvil/common/templates/f0C00620000.cfg similarity index 100% rename from plugins/wazo-fanvil/common/templates/f0C00620000.cfg rename to plugins/wazo_fanvil/common/templates/f0C00620000.cfg diff --git a/plugins/wazo-fanvil/common/templates/i10S.tpl b/plugins/wazo_fanvil/common/templates/i10S.tpl similarity index 100% rename from plugins/wazo-fanvil/common/templates/i10S.tpl rename to plugins/wazo_fanvil/common/templates/i10S.tpl diff --git a/plugins/wazo-fanvil/common/templates/i10SD.tpl b/plugins/wazo_fanvil/common/templates/i10SD.tpl similarity index 100% rename from plugins/wazo-fanvil/common/templates/i10SD.tpl rename to plugins/wazo_fanvil/common/templates/i10SD.tpl diff --git a/plugins/wazo-fanvil/common/templates/i10SV.tpl b/plugins/wazo_fanvil/common/templates/i10SV.tpl similarity index 100% rename from plugins/wazo-fanvil/common/templates/i10SV.tpl rename to plugins/wazo_fanvil/common/templates/i10SV.tpl diff --git a/plugins/wazo-fanvil/common/templates/i16S.tpl b/plugins/wazo_fanvil/common/templates/i16S.tpl similarity index 100% rename from plugins/wazo-fanvil/common/templates/i16S.tpl rename to plugins/wazo_fanvil/common/templates/i16S.tpl diff --git a/plugins/wazo-fanvil/common/templates/i16SV.tpl b/plugins/wazo_fanvil/common/templates/i16SV.tpl similarity index 100% rename from plugins/wazo-fanvil/common/templates/i16SV.tpl rename to plugins/wazo_fanvil/common/templates/i16SV.tpl diff --git a/plugins/wazo-fanvil/common/templates/i51W.tpl b/plugins/wazo_fanvil/common/templates/i51W.tpl similarity index 100% rename from plugins/wazo-fanvil/common/templates/i51W.tpl rename to plugins/wazo_fanvil/common/templates/i51W.tpl diff --git a/plugins/wazo-fanvil/common/templates/i52W.tpl b/plugins/wazo_fanvil/common/templates/i52W.tpl similarity index 100% rename from plugins/wazo-fanvil/common/templates/i52W.tpl rename to plugins/wazo_fanvil/common/templates/i52W.tpl diff --git a/plugins/wazo-fanvil/common/templates/i53W.tpl b/plugins/wazo_fanvil/common/templates/i53W.tpl similarity index 100% rename from plugins/wazo-fanvil/common/templates/i53W.tpl rename to plugins/wazo_fanvil/common/templates/i53W.tpl diff --git a/plugins/wazo-fanvil/common/templates/i61.tpl b/plugins/wazo_fanvil/common/templates/i61.tpl similarity index 100% rename from plugins/wazo-fanvil/common/templates/i61.tpl rename to plugins/wazo_fanvil/common/templates/i61.tpl diff --git a/plugins/wazo-fanvil/common/templates/i62.tpl b/plugins/wazo_fanvil/common/templates/i62.tpl similarity index 100% rename from plugins/wazo-fanvil/common/templates/i62.tpl rename to plugins/wazo_fanvil/common/templates/i62.tpl diff --git a/plugins/wazo-fanvil/common/templates/i63.tpl b/plugins/wazo_fanvil/common/templates/i63.tpl similarity index 100% rename from plugins/wazo-fanvil/common/templates/i63.tpl rename to plugins/wazo_fanvil/common/templates/i63.tpl diff --git a/plugins/wazo-fanvil/common/templates/i64.tpl b/plugins/wazo_fanvil/common/templates/i64.tpl similarity index 100% rename from plugins/wazo-fanvil/common/templates/i64.tpl rename to plugins/wazo_fanvil/common/templates/i64.tpl diff --git a/plugins/wazo-yealink/v83/__init__.py b/plugins/wazo_fanvil/common/tests/__init__.py similarity index 100% rename from plugins/wazo-yealink/v83/__init__.py rename to plugins/wazo_fanvil/common/tests/__init__.py diff --git a/plugins/wazo_fanvil/common/tests/test_common.py b/plugins/wazo_fanvil/common/tests/test_common.py new file mode 100644 index 0000000000000000000000000000000000000000..d5122c44a3ce62e07e13a2a311b03d0461879700 --- /dev/null +++ b/plugins/wazo_fanvil/common/tests/test_common.py @@ -0,0 +1,38 @@ +# Copyright 2023 The Wazo Authors (see the AUTHORS file) +# SPDX-License-Identifier: GPL-3.0-or-later +from unittest.mock import sentinel + +from ..common import BaseFanvilPlugin + + +class TestPlugin: + def test_split(self): + fkeys = [ + ('1', sentinel.first_key), + ('2', sentinel.second_key), + ('3', sentinel.third_key), + ('4', sentinel.fourth_key), + ('7', sentinel.seventh_key), + ] + results_top, results_bottom = BaseFanvilPlugin._split_fkeys(fkeys, 3) + assert results_top[1] == sentinel.first_key + assert results_top[2] == sentinel.second_key + assert results_top[3] == sentinel.third_key + assert results_bottom[1] == sentinel.fourth_key + assert results_bottom[4] == sentinel.seventh_key + + def test_paginate(self): + fkeys = [ + {'id': 1, 'value': sentinel.first_key}, + {'id': 2, 'value': sentinel.second_key}, + {'id': 3, 'value': sentinel.third_key}, + {'id': 4, 'value': sentinel.fourth_key}, + {'id': 7, 'value': sentinel.seventh_key}, + ] + max_page, results = BaseFanvilPlugin._paginate(fkeys, 7, 3) + assert max_page == 3 + assert results[0] == (1, 1, fkeys[0]) + assert results[1] == (1, 2, fkeys[1]) + assert results[2] == (1, 3, fkeys[2]) + assert results[3] == (2, 1, fkeys[3]) + assert results[4] == (3, 1, fkeys[4]) diff --git a/plugins/wazo-fanvil/common/var/tftpboot/Fanvil/.gitignore b/plugins/wazo_fanvil/common/var/tftpboot/Fanvil/.gitignore similarity index 100% rename from plugins/wazo-fanvil/common/var/tftpboot/Fanvil/.gitignore rename to plugins/wazo_fanvil/common/var/tftpboot/Fanvil/.gitignore diff --git a/plugins/wazo-fanvil/serie-i/entry.py b/plugins/wazo_fanvil/serie_i/entry.py similarity index 100% rename from plugins/wazo-fanvil/serie-i/entry.py rename to plugins/wazo_fanvil/serie_i/entry.py diff --git a/plugins/wazo-fanvil/serie-i/pkgs/pkgs.db b/plugins/wazo_fanvil/serie_i/pkgs/pkgs.db similarity index 100% rename from plugins/wazo-fanvil/serie-i/pkgs/pkgs.db rename to plugins/wazo_fanvil/serie_i/pkgs/pkgs.db diff --git a/plugins/wazo-fanvil/serie-i/plugin-info b/plugins/wazo_fanvil/serie_i/plugin-info similarity index 100% rename from plugins/wazo-fanvil/serie-i/plugin-info rename to plugins/wazo_fanvil/serie_i/plugin-info diff --git a/plugins/wazo-fanvil/serie-v/entry.py b/plugins/wazo_fanvil/serie_v/entry.py similarity index 100% rename from plugins/wazo-fanvil/serie-v/entry.py rename to plugins/wazo_fanvil/serie_v/entry.py diff --git a/plugins/wazo-fanvil/serie-v/pkgs/pkgs.db b/plugins/wazo_fanvil/serie_v/pkgs/pkgs.db similarity index 100% rename from plugins/wazo-fanvil/serie-v/pkgs/pkgs.db rename to plugins/wazo_fanvil/serie_v/pkgs/pkgs.db diff --git a/plugins/wazo-fanvil/serie-v/plugin-info b/plugins/wazo_fanvil/serie_v/plugin-info similarity index 100% rename from plugins/wazo-fanvil/serie-v/plugin-info rename to plugins/wazo_fanvil/serie_v/plugin-info diff --git a/plugins/wazo-fanvil/serie-x/entry.py b/plugins/wazo_fanvil/serie_x/entry.py similarity index 91% rename from plugins/wazo-fanvil/serie-x/entry.py rename to plugins/wazo_fanvil/serie_x/entry.py index 2bbee3f756feb87aced47aeb306dd531a1e3890e..f49d322505bee19e44b94f5c018ec84721b782f6 100644 --- a/plugins/wazo-fanvil/serie-x/entry.py +++ b/plugins/wazo_fanvil/serie_x/entry.py @@ -1,7 +1,6 @@ -# Copyright 2010-2022 The Wazo Authors (see the AUTHORS file) +# Copyright 2010-2023 The Wazo Authors (see the AUTHORS file) # SPDX-License-Identifier: GPL-3.0-or-later - common = {} execfile_('common.py', common) @@ -84,6 +83,22 @@ FUNCTION_KEYS_PER_PAGE = { 'X6U': 12, } +LINE_KEYS_PER_PAGE = { + 'X210': 10, + 'X210i': 10, + 'X4U': 3, + 'X5U': 4, + 'X6U': 5, +} + +TOP_FUNCTION_KEYS = { + 'X210': 10, + 'X210i': 10, + 'X4U': 3, + 'X5U': 4, + 'X6U': 5, +} + class FanvilPlugin(common['BaseFanvilPlugin']): IS_PLUGIN = True @@ -91,6 +106,8 @@ class FanvilPlugin(common['BaseFanvilPlugin']): _COMMON_FILES = COMMON_FILES _MODEL_FIRMWARE_MAPPING = MODEL_FIRMWARE_MAPPING _FUNCTION_KEYS_PER_PAGE = FUNCTION_KEYS_PER_PAGE + _LINE_KEYS_PER_PAGE = LINE_KEYS_PER_PAGE + _TOP_FUNCTION_KEYS = TOP_FUNCTION_KEYS _LOCALE = { 'de_DE': '16', 'es_ES': '10', diff --git a/plugins/wazo-fanvil/serie-x/pkgs/pkgs.db b/plugins/wazo_fanvil/serie_x/pkgs/pkgs.db similarity index 100% rename from plugins/wazo-fanvil/serie-x/pkgs/pkgs.db rename to plugins/wazo_fanvil/serie_x/pkgs/pkgs.db diff --git a/plugins/wazo-fanvil/serie-x/plugin-info b/plugins/wazo_fanvil/serie_x/plugin-info similarity index 100% rename from plugins/wazo-fanvil/serie-x/plugin-info rename to plugins/wazo_fanvil/serie_x/plugin-info diff --git a/plugins/wazo-fanvil/2.3/entry.py b/plugins/wazo_fanvil/v2_3/entry.py similarity index 67% rename from plugins/wazo-fanvil/2.3/entry.py rename to plugins/wazo_fanvil/v2_3/entry.py index 0c55e3b5b3249043003f1594fd2a0db6669291f9..baef450722f799bdcb3c48e892cde7c01dafa6c7 100644 --- a/plugins/wazo-fanvil/2.3/entry.py +++ b/plugins/wazo_fanvil/v2_3/entry.py @@ -1,17 +1,5 @@ -# Copyright 2013-2022 The Wazo Authors (see the AUTHORS file) -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see +# Copyright 2013-2023 The Wazo Authors (see the AUTHORS file) +# SPDX-License-Identifier: GPL-3.0-or-later common = {} execfile_('common.py', common) @@ -30,6 +18,10 @@ class FanvilPlugin(common['BaseFanvilPlugin']): IS_PLUGIN = True _COMMON_FILES = COMMON_FILES + _MODEL_FIRMWARE_MAPPING = None + _FUNCTION_KEYS_PER_PAGE = None + _LINE_KEYS_PER_PAGE = None + _TOP_FUNCTION_KEYS = None _LOCALE = { 'de_DE': 'de', 'es_ES': 'es', diff --git a/plugins/wazo-fanvil/2.3/pkgs/pkgs.db b/plugins/wazo_fanvil/v2_3/pkgs/pkgs.db similarity index 100% rename from plugins/wazo-fanvil/2.3/pkgs/pkgs.db rename to plugins/wazo_fanvil/v2_3/pkgs/pkgs.db diff --git a/plugins/wazo-fanvil/2.3/plugin-info b/plugins/wazo_fanvil/v2_3/plugin-info similarity index 100% rename from plugins/wazo-fanvil/2.3/plugin-info rename to plugins/wazo_fanvil/v2_3/plugin-info diff --git a/plugins/wazo-gigaset/C470/entry.py b/plugins/wazo_gigaset/C470/entry.py similarity index 100% rename from plugins/wazo-gigaset/C470/entry.py rename to plugins/wazo_gigaset/C470/entry.py diff --git a/plugins/wazo-gigaset/C470/plugin-info b/plugins/wazo_gigaset/C470/plugin-info similarity index 100% rename from plugins/wazo-gigaset/C470/plugin-info rename to plugins/wazo_gigaset/C470/plugin-info diff --git a/plugins/wazo-gigaset/C470/templates/base.tpl b/plugins/wazo_gigaset/C470/templates/base.tpl similarity index 100% rename from plugins/wazo-gigaset/C470/templates/base.tpl rename to plugins/wazo_gigaset/C470/templates/base.tpl diff --git a/plugins/wazo-gigaset/C590/entry.py b/plugins/wazo_gigaset/C590/entry.py similarity index 100% rename from plugins/wazo-gigaset/C590/entry.py rename to plugins/wazo_gigaset/C590/entry.py diff --git a/plugins/wazo-gigaset/C590/installation.md b/plugins/wazo_gigaset/C590/installation.md similarity index 100% rename from plugins/wazo-gigaset/C590/installation.md rename to plugins/wazo_gigaset/C590/installation.md diff --git a/plugins/wazo-gigaset/C590/plugin-info b/plugins/wazo_gigaset/C590/plugin-info similarity index 100% rename from plugins/wazo-gigaset/C590/plugin-info rename to plugins/wazo_gigaset/C590/plugin-info diff --git a/plugins/wazo-gigaset/C590/templates/base.tpl b/plugins/wazo_gigaset/C590/templates/base.tpl similarity index 100% rename from plugins/wazo-gigaset/C590/templates/base.tpl rename to plugins/wazo_gigaset/C590/templates/base.tpl diff --git a/plugins/wazo-gigaset/N510/entry.py b/plugins/wazo_gigaset/N510/entry.py similarity index 100% rename from plugins/wazo-gigaset/N510/entry.py rename to plugins/wazo_gigaset/N510/entry.py diff --git a/plugins/wazo-gigaset/N510/pkgs/pkgs.db b/plugins/wazo_gigaset/N510/pkgs/pkgs.db similarity index 100% rename from plugins/wazo-gigaset/N510/pkgs/pkgs.db rename to plugins/wazo_gigaset/N510/pkgs/pkgs.db diff --git a/plugins/wazo-gigaset/N510/plugin-info b/plugins/wazo_gigaset/N510/plugin-info similarity index 95% rename from plugins/wazo-gigaset/N510/plugin-info rename to plugins/wazo_gigaset/N510/plugin-info index f6141d0984cd97420f5203c1743f4ecfde625a56..eca12ee5b86a3831bec6ceeebaca62e533ffd1ca 100644 --- a/plugins/wazo-gigaset/N510/plugin-info +++ b/plugins/wazo_gigaset/N510/plugin-info @@ -1,5 +1,5 @@ { - "version": "0.1.10", + "version": "0.1.12", "description": "Plugin for Gigaset N510 IP", "description_fr": "Greffon pour Gigaset N510 IP", "capabilities": { diff --git a/plugins/wazo-gigaset/N510/templates/base.tpl b/plugins/wazo_gigaset/N510/templates/base.tpl similarity index 97% rename from plugins/wazo-gigaset/N510/templates/base.tpl rename to plugins/wazo_gigaset/N510/templates/base.tpl index 2440db6664a0a8dd07c7acf5c5da67781d6ad55e..7b8c33f57343e867967307bcb9607caacc3574f2 100644 --- a/plugins/wazo-gigaset/N510/templates/base.tpl +++ b/plugins/wazo_gigaset/N510/templates/base.tpl @@ -31,8 +31,8 @@ {%- set line_suffix = '_' + line_no %} {%- endif %} - - + + @@ -44,8 +44,8 @@ - - + + diff --git a/plugins/wazo-gigaset/N720/entry.py b/plugins/wazo_gigaset/N720/entry.py similarity index 100% rename from plugins/wazo-gigaset/N720/entry.py rename to plugins/wazo_gigaset/N720/entry.py diff --git a/plugins/wazo-gigaset/N720/pkgs/pkgs.db b/plugins/wazo_gigaset/N720/pkgs/pkgs.db similarity index 100% rename from plugins/wazo-gigaset/N720/pkgs/pkgs.db rename to plugins/wazo_gigaset/N720/pkgs/pkgs.db diff --git a/plugins/wazo-gigaset/N720/plugin-info b/plugins/wazo_gigaset/N720/plugin-info similarity index 100% rename from plugins/wazo-gigaset/N720/plugin-info rename to plugins/wazo_gigaset/N720/plugin-info diff --git a/plugins/wazo-gigaset/N720/templates/base.tpl b/plugins/wazo_gigaset/N720/templates/base.tpl similarity index 100% rename from plugins/wazo-gigaset/N720/templates/base.tpl rename to plugins/wazo_gigaset/N720/templates/base.tpl diff --git a/plugins/wazo-gigaset/N870-83.v2.39.0/common.py b/plugins/wazo_gigaset/N870_83_v2_39_0/common.py similarity index 100% rename from plugins/wazo-gigaset/N870-83.v2.39.0/common.py rename to plugins/wazo_gigaset/N870_83_v2_39_0/common.py diff --git a/plugins/wazo-gigaset/N870-83.v2.39.0/entry.py b/plugins/wazo_gigaset/N870_83_v2_39_0/entry.py similarity index 100% rename from plugins/wazo-gigaset/N870-83.v2.39.0/entry.py rename to plugins/wazo_gigaset/N870_83_v2_39_0/entry.py diff --git a/plugins/wazo-gigaset/N870-83.v2.39.0/install.md b/plugins/wazo_gigaset/N870_83_v2_39_0/install.md similarity index 100% rename from plugins/wazo-gigaset/N870-83.v2.39.0/install.md rename to plugins/wazo_gigaset/N870_83_v2_39_0/install.md diff --git a/plugins/wazo-gigaset/N870-83.v2.39.0/limitations.md b/plugins/wazo_gigaset/N870_83_v2_39_0/limitations.md similarity index 100% rename from plugins/wazo-gigaset/N870-83.v2.39.0/limitations.md rename to plugins/wazo_gigaset/N870_83_v2_39_0/limitations.md diff --git a/plugins/wazo-gigaset/N870-83.v2.39.0/pkgs/pkgs.db b/plugins/wazo_gigaset/N870_83_v2_39_0/pkgs/pkgs.db similarity index 100% rename from plugins/wazo-gigaset/N870-83.v2.39.0/pkgs/pkgs.db rename to plugins/wazo_gigaset/N870_83_v2_39_0/pkgs/pkgs.db diff --git a/plugins/wazo-gigaset/N870-83.v2.39.0/plugin-info b/plugins/wazo_gigaset/N870_83_v2_39_0/plugin-info similarity index 100% rename from plugins/wazo-gigaset/N870-83.v2.39.0/plugin-info rename to plugins/wazo_gigaset/N870_83_v2_39_0/plugin-info diff --git a/plugins/wazo-gigaset/N870-83.v2.39.0/templates/base.tpl b/plugins/wazo_gigaset/N870_83_v2_39_0/templates/base.tpl similarity index 100% rename from plugins/wazo-gigaset/N870-83.v2.39.0/templates/base.tpl rename to plugins/wazo_gigaset/N870_83_v2_39_0/templates/base.tpl diff --git a/plugins/wazo-gigaset/N870-83.v2.48.0/common.py b/plugins/wazo_gigaset/N870_83_v2_48_0/common.py similarity index 100% rename from plugins/wazo-gigaset/N870-83.v2.48.0/common.py rename to plugins/wazo_gigaset/N870_83_v2_48_0/common.py diff --git a/plugins/wazo-gigaset/N870-83.v2.48.0/entry.py b/plugins/wazo_gigaset/N870_83_v2_48_0/entry.py similarity index 100% rename from plugins/wazo-gigaset/N870-83.v2.48.0/entry.py rename to plugins/wazo_gigaset/N870_83_v2_48_0/entry.py diff --git a/plugins/wazo-gigaset/N870-83.v2.48.0/install.md b/plugins/wazo_gigaset/N870_83_v2_48_0/install.md similarity index 100% rename from plugins/wazo-gigaset/N870-83.v2.48.0/install.md rename to plugins/wazo_gigaset/N870_83_v2_48_0/install.md diff --git a/plugins/wazo-gigaset/N870-83.v2.48.0/limitations.md b/plugins/wazo_gigaset/N870_83_v2_48_0/limitations.md similarity index 100% rename from plugins/wazo-gigaset/N870-83.v2.48.0/limitations.md rename to plugins/wazo_gigaset/N870_83_v2_48_0/limitations.md diff --git a/plugins/wazo-gigaset/N870-83.v2.48.0/pkgs/pkgs.db b/plugins/wazo_gigaset/N870_83_v2_48_0/pkgs/pkgs.db similarity index 100% rename from plugins/wazo-gigaset/N870-83.v2.48.0/pkgs/pkgs.db rename to plugins/wazo_gigaset/N870_83_v2_48_0/pkgs/pkgs.db diff --git a/plugins/wazo-gigaset/N870-83.v2.48.0/plugin-info b/plugins/wazo_gigaset/N870_83_v2_48_0/plugin-info similarity index 100% rename from plugins/wazo-gigaset/N870-83.v2.48.0/plugin-info rename to plugins/wazo_gigaset/N870_83_v2_48_0/plugin-info diff --git a/plugins/wazo-gigaset/N870-83.v2.48.0/templates/base.tpl b/plugins/wazo_gigaset/N870_83_v2_48_0/templates/base.tpl similarity index 100% rename from plugins/wazo-gigaset/N870-83.v2.48.0/templates/base.tpl rename to plugins/wazo_gigaset/N870_83_v2_48_0/templates/base.tpl diff --git a/plugins/wazo-gigaset/Nx70-83.v2.49.1/common.py b/plugins/wazo_gigaset/Nx70_83_v2_49_1/common.py similarity index 100% rename from plugins/wazo-gigaset/Nx70-83.v2.49.1/common.py rename to plugins/wazo_gigaset/Nx70_83_v2_49_1/common.py diff --git a/plugins/wazo-gigaset/Nx70-83.v2.49.1/entry.py b/plugins/wazo_gigaset/Nx70_83_v2_49_1/entry.py similarity index 100% rename from plugins/wazo-gigaset/Nx70-83.v2.49.1/entry.py rename to plugins/wazo_gigaset/Nx70_83_v2_49_1/entry.py diff --git a/plugins/wazo-gigaset/Nx70-83.v2.49.1/install.md b/plugins/wazo_gigaset/Nx70_83_v2_49_1/install.md similarity index 100% rename from plugins/wazo-gigaset/Nx70-83.v2.49.1/install.md rename to plugins/wazo_gigaset/Nx70_83_v2_49_1/install.md diff --git a/plugins/wazo-gigaset/Nx70-83.v2.49.1/limitations.md b/plugins/wazo_gigaset/Nx70_83_v2_49_1/limitations.md similarity index 100% rename from plugins/wazo-gigaset/Nx70-83.v2.49.1/limitations.md rename to plugins/wazo_gigaset/Nx70_83_v2_49_1/limitations.md diff --git a/plugins/wazo-gigaset/Nx70-83.v2.49.1/pkgs/pkgs.db b/plugins/wazo_gigaset/Nx70_83_v2_49_1/pkgs/pkgs.db similarity index 100% rename from plugins/wazo-gigaset/Nx70-83.v2.49.1/pkgs/pkgs.db rename to plugins/wazo_gigaset/Nx70_83_v2_49_1/pkgs/pkgs.db diff --git a/plugins/wazo-gigaset/Nx70-83.v2.49.1/plugin-info b/plugins/wazo_gigaset/Nx70_83_v2_49_1/plugin-info similarity index 100% rename from plugins/wazo-gigaset/Nx70-83.v2.49.1/plugin-info rename to plugins/wazo_gigaset/Nx70_83_v2_49_1/plugin-info diff --git a/plugins/wazo-gigaset/Nx70-83.v2.49.1/templates/base.tpl b/plugins/wazo_gigaset/Nx70_83_v2_49_1/templates/base.tpl similarity index 100% rename from plugins/wazo-gigaset/Nx70-83.v2.49.1/templates/base.tpl rename to plugins/wazo_gigaset/Nx70_83_v2_49_1/templates/base.tpl diff --git a/plugins/wazo_gigaset/build.py b/plugins/wazo_gigaset/build.py new file mode 100644 index 0000000000000000000000000000000000000000..680ced5b506295c9244a8cbeb0c67138b066b633 --- /dev/null +++ b/plugins/wazo_gigaset/build.py @@ -0,0 +1,56 @@ +# Copyright 2013-2023 The Wazo Authors (see the AUTHORS file) +# SPDX-License-Identifier: GPL-3.0-or-later + +# Depends on the following external programs: +# -rsync +from __future__ import annotations + +from typing import TYPE_CHECKING, Callable +from subprocess import check_call + +if TYPE_CHECKING: + + def target( + target_id: str, plugin_id: str, std_dirs: bool = True + ) -> Callable[[str], None]: + """The `target` method is injected in `exec` call by the build script.""" + return lambda x: None + + +@target('N510', 'wazo-gigaset-N510') +def build_N510(path: str) -> None: + check_call(['rsync', '-rlp', '--exclude', '.*', 'common/', path]) + check_call(['rsync', '-rlp', '--exclude', '.*', 'N510/', path]) + + +@target('N720', 'wazo-gigaset-N720') +def build_N720(path: str) -> None: + check_call(['rsync', '-rlp', '--exclude', '.*', 'common/', path]) + check_call(['rsync', '-rlp', '--exclude', '.*', 'N720/', path]) + + +@target('N870-83.v2.39.0', 'wazo-gigaset-N870-83.v2.39.0') +def build_N870_83_v2_39_0(path: str) -> None: + check_call(['rsync', '-rlp', '--exclude', '.*', 'N870_83_v2_39_0/', path]) + + +@target('N870-83.v2.48.0', 'wazo-gigaset-N870-83.v2.48.0') +def build_N870_83_v2_48_0(path: str) -> None: + check_call(['rsync', '-rlp', '--exclude', '.*', 'N870_83_v2_48_0/', path]) + + +@target('Nx70-83.v2.49.1', 'wazo-gigaset-Nx70-83.v2.49.1') +def build_Nx70_83_v2_49_1(path: str) -> None: + check_call(['rsync', '-rlp', '--exclude', '.*', 'Nx70_83_v2_49_1/', path]) + + +@target('C470', 'wazo-gigaset-C470') +def build_C470(path: str) -> None: + check_call(['rsync', '-rlp', '--exclude', '.*', 'common_c/', path]) + check_call(['rsync', '-rlp', '--exclude', '.*', 'C470/', path]) + + +@target('C590', 'wazo-gigaset-C590') +def build_C590(path: str) -> None: + check_call(['rsync', '-rlp', '--exclude', '.*', 'common_c/', path]) + check_call(['rsync', '-rlp', '--exclude', '.*', 'C590/', path]) diff --git a/plugins/wazo-gigaset/common/common.py b/plugins/wazo_gigaset/common/common.py similarity index 100% rename from plugins/wazo-gigaset/common/common.py rename to plugins/wazo_gigaset/common/common.py diff --git a/plugins/wazo-gigaset/common/var/tftpboot/42/2/master.bin b/plugins/wazo_gigaset/common/var/tftpboot/42/2/master.bin similarity index 100% rename from plugins/wazo-gigaset/common/var/tftpboot/42/2/master.bin rename to plugins/wazo_gigaset/common/var/tftpboot/42/2/master.bin diff --git a/plugins/wazo-gigaset/common/var/tftpboot/70/1/baselines.bin b/plugins/wazo_gigaset/common/var/tftpboot/70/1/baselines.bin similarity index 100% rename from plugins/wazo-gigaset/common/var/tftpboot/70/1/baselines.bin rename to plugins/wazo_gigaset/common/var/tftpboot/70/1/baselines.bin diff --git a/plugins/wazo-gigaset/common/var/tftpboot/70/1/master.bin b/plugins/wazo_gigaset/common/var/tftpboot/70/1/master.bin similarity index 100% rename from plugins/wazo-gigaset/common/var/tftpboot/70/1/master.bin rename to plugins/wazo_gigaset/common/var/tftpboot/70/1/master.bin diff --git a/plugins/wazo-gigaset/common/var/tftpboot/70/222/baselines.bin b/plugins/wazo_gigaset/common/var/tftpboot/70/222/baselines.bin similarity index 100% rename from plugins/wazo-gigaset/common/var/tftpboot/70/222/baselines.bin rename to plugins/wazo_gigaset/common/var/tftpboot/70/222/baselines.bin diff --git a/plugins/wazo-gigaset/common/var/tftpboot/70/222/master.bin b/plugins/wazo_gigaset/common/var/tftpboot/70/222/master.bin similarity index 100% rename from plugins/wazo-gigaset/common/var/tftpboot/70/222/master.bin rename to plugins/wazo_gigaset/common/var/tftpboot/70/222/master.bin diff --git a/plugins/wazo-gigaset/common/var/tftpboot/sifs/sifsroot.bin b/plugins/wazo_gigaset/common/var/tftpboot/sifs/sifsroot.bin similarity index 100% rename from plugins/wazo-gigaset/common/var/tftpboot/sifs/sifsroot.bin rename to plugins/wazo_gigaset/common/var/tftpboot/sifs/sifsroot.bin diff --git a/plugins/wazo-gigaset/common/var/tftpboot/sifs/sih_4xx.bin b/plugins/wazo_gigaset/common/var/tftpboot/sifs/sih_4xx.bin similarity index 100% rename from plugins/wazo-gigaset/common/var/tftpboot/sifs/sih_4xx.bin rename to plugins/wazo_gigaset/common/var/tftpboot/sifs/sih_4xx.bin diff --git a/plugins/wazo-gigaset/common/var/tftpboot/sifs/sit_44x.bin b/plugins/wazo_gigaset/common/var/tftpboot/sifs/sit_44x.bin similarity index 100% rename from plugins/wazo-gigaset/common/var/tftpboot/sifs/sit_44x.bin rename to plugins/wazo_gigaset/common/var/tftpboot/sifs/sit_44x.bin diff --git a/plugins/wazo-gigaset/common/var/tftpboot/sifs/siu_444.bin b/plugins/wazo_gigaset/common/var/tftpboot/sifs/siu_444.bin similarity index 100% rename from plugins/wazo-gigaset/common/var/tftpboot/sifs/siu_444.bin rename to plugins/wazo_gigaset/common/var/tftpboot/sifs/siu_444.bin diff --git a/plugins/wazo-gigaset/common-c/common.py b/plugins/wazo_gigaset/common_c/common.py similarity index 100% rename from plugins/wazo-gigaset/common-c/common.py rename to plugins/wazo_gigaset/common_c/common.py diff --git a/plugins/wazo-grandstream/build.py b/plugins/wazo_grandstream/build.py similarity index 65% rename from plugins/wazo-grandstream/build.py rename to plugins/wazo_grandstream/build.py index fc8295f74a4af0e3fdc48064d94b5fb50afce229..2d4ea2857c2cafffd115c5199762ef9ac6baa262 100644 --- a/plugins/wazo-grandstream/build.py +++ b/plugins/wazo_grandstream/build.py @@ -1,16 +1,26 @@ """ -Copyright 2013-2022 The Wazo Authors (see the AUTHORS file) +Copyright 2013-2023 The Wazo Authors (see the AUTHORS file) SPDX-License-Identifier: GPL-3.0-or-later Depends on the following external programs: -rsync """ +from __future__ import annotations +from typing import TYPE_CHECKING, Callable from subprocess import check_call +if TYPE_CHECKING: + + def target( + target_id: str, plugin_id: str, std_dirs: bool = True + ) -> Callable[[str], None]: + """The `target` method is injected in `exec` call by the build script.""" + return lambda x: None + @target('1.0.27.2', 'wazo-grandstream-1.0.27.2') -def build_1_0_27_2(path): +def build_1_0_27_2(path: str) -> None: check_call( [ 'rsync', @@ -23,12 +33,11 @@ def build_1_0_27_2(path): path, ] ) - - check_call(['rsync', '-rlp', '--exclude', '.*', '1.0.27.2/', path]) + check_call(['rsync', '-rlp', '--exclude', '.*', 'v1_0_27_2/', path]) @target('1.0.3.27', 'wazo-grandstream-1.0.3.27') -def build_1_0_3_27(path): +def build_1_0_3_27(path: str) -> None: check_call( [ 'rsync', @@ -41,12 +50,11 @@ def build_1_0_3_27(path): path, ] ) - - check_call(['rsync', '-rlp', '--exclude', '.*', '1.0.3.27/', path]) + check_call(['rsync', '-rlp', '--exclude', '.*', 'v1_0_3_27/', path]) @target('1.0.3.2x-android', 'wazo-grandstream-1.0.3.2x-android') -def build_1_0_3_2x_android(path): +def build_1_0_3_2x_android(path: str) -> None: check_call( [ 'rsync', @@ -59,12 +67,11 @@ def build_1_0_3_2x_android(path): path, ] ) - - check_call(['rsync', '-rlp', '--exclude', '.*', '1.0.3.2x-android/', path]) + check_call(['rsync', '-rlp', '--exclude', '.*', 'v1_0_3_2x_android/', path]) @target('1.0.5.48', 'wazo-grandstream-1.0.5.48') -def build_1_0_5_48(path): +def build_1_0_5_48(path: str) -> None: check_call( [ 'rsync', @@ -77,12 +84,11 @@ def build_1_0_5_48(path): path, ] ) - - check_call(['rsync', '-rlp', '--exclude', '.*', '1.0.5.48/', path]) + check_call(['rsync', '-rlp', '--exclude', '.*', 'v1_0_5_48/', path]) @target('1.0.7.13', 'wazo-grandstream-1.0.7.13') -def build_1_0_7_13(path): +def build_1_0_7_13(path: str) -> None: check_call( [ 'rsync', @@ -95,12 +101,11 @@ def build_1_0_7_13(path): path, ] ) - - check_call(['rsync', '-rlp', '--exclude', '.*', '1.0.7.13/', path]) + check_call(['rsync', '-rlp', '--exclude', '.*', 'v1_0_7_13/', path]) @target('1.0.8.6', 'wazo-grandstream-1.0.8.6') -def build_1_0_8_6(path): +def build_1_0_8_6(path: str) -> None: check_call( [ 'rsync', @@ -113,12 +118,11 @@ def build_1_0_8_6(path): path, ] ) - - check_call(['rsync', '-rlp', '--exclude', '.*', '1.0.8.6/', path]) + check_call(['rsync', '-rlp', '--exclude', '.*', 'v1_0_8_6/', path]) @target('1.0.8.9', 'wazo-grandstream-1.0.8.9') -def build_1_0_8_9(path): +def build_1_0_8_9(path: str) -> None: check_call( [ 'rsync', @@ -131,12 +135,11 @@ def build_1_0_8_9(path): path, ] ) - - check_call(['rsync', '-rlp', '--exclude', '.*', '1.0.8.9/', path]) + check_call(['rsync', '-rlp', '--exclude', '.*', 'v1_0_8_9/', path]) @target('1.2.5.3', 'wazo-grandstream-1.2.5.3') -def build_1_2_5_3(path): +def build_1_2_5_3(path: str) -> None: check_call( [ 'rsync', @@ -149,5 +152,4 @@ def build_1_2_5_3(path): path, ] ) - - check_call(['rsync', '-rlp', '--exclude', '.*', '1.2.5.3/', path]) + check_call(['rsync', '-rlp', '--exclude', '.*', 'v1_2_5_3/', path]) diff --git a/plugins/wazo-grandstream/common/common.py b/plugins/wazo_grandstream/common/common.py similarity index 100% rename from plugins/wazo-grandstream/common/common.py rename to plugins/wazo_grandstream/common/common.py diff --git a/plugins/wazo-grandstream/common/templates/GRP2612.tpl b/plugins/wazo_grandstream/common/templates/GRP2612.tpl similarity index 100% rename from plugins/wazo-grandstream/common/templates/GRP2612.tpl rename to plugins/wazo_grandstream/common/templates/GRP2612.tpl diff --git a/plugins/wazo-grandstream/common/templates/GRP2613.tpl b/plugins/wazo_grandstream/common/templates/GRP2613.tpl similarity index 100% rename from plugins/wazo-grandstream/common/templates/GRP2613.tpl rename to plugins/wazo_grandstream/common/templates/GRP2613.tpl diff --git a/plugins/wazo-grandstream/common/templates/GRP2614.tpl b/plugins/wazo_grandstream/common/templates/GRP2614.tpl similarity index 100% rename from plugins/wazo-grandstream/common/templates/GRP2614.tpl rename to plugins/wazo_grandstream/common/templates/GRP2614.tpl diff --git a/plugins/wazo-grandstream/common/templates/GRP2615.tpl b/plugins/wazo_grandstream/common/templates/GRP2615.tpl similarity index 100% rename from plugins/wazo-grandstream/common/templates/GRP2615.tpl rename to plugins/wazo_grandstream/common/templates/GRP2615.tpl diff --git a/plugins/wazo-grandstream/common/templates/GRP2616.tpl b/plugins/wazo_grandstream/common/templates/GRP2616.tpl similarity index 100% rename from plugins/wazo-grandstream/common/templates/GRP2616.tpl rename to plugins/wazo_grandstream/common/templates/GRP2616.tpl diff --git a/plugins/wazo-grandstream/common/templates/GXP1160.tpl b/plugins/wazo_grandstream/common/templates/GXP1160.tpl similarity index 100% rename from plugins/wazo-grandstream/common/templates/GXP1160.tpl rename to plugins/wazo_grandstream/common/templates/GXP1160.tpl diff --git a/plugins/wazo-grandstream/common/templates/GXP1405.tpl b/plugins/wazo_grandstream/common/templates/GXP1405.tpl similarity index 100% rename from plugins/wazo-grandstream/common/templates/GXP1405.tpl rename to plugins/wazo_grandstream/common/templates/GXP1405.tpl diff --git a/plugins/wazo-grandstream/common/templates/GXP1610.tpl b/plugins/wazo_grandstream/common/templates/GXP1610.tpl similarity index 100% rename from plugins/wazo-grandstream/common/templates/GXP1610.tpl rename to plugins/wazo_grandstream/common/templates/GXP1610.tpl diff --git a/plugins/wazo-grandstream/common/templates/GXP1615.tpl b/plugins/wazo_grandstream/common/templates/GXP1615.tpl similarity index 100% rename from plugins/wazo-grandstream/common/templates/GXP1615.tpl rename to plugins/wazo_grandstream/common/templates/GXP1615.tpl diff --git a/plugins/wazo-grandstream/common/templates/GXP1620.tpl b/plugins/wazo_grandstream/common/templates/GXP1620.tpl similarity index 100% rename from plugins/wazo-grandstream/common/templates/GXP1620.tpl rename to plugins/wazo_grandstream/common/templates/GXP1620.tpl diff --git a/plugins/wazo-grandstream/common/templates/GXP1625.tpl b/plugins/wazo_grandstream/common/templates/GXP1625.tpl similarity index 100% rename from plugins/wazo-grandstream/common/templates/GXP1625.tpl rename to plugins/wazo_grandstream/common/templates/GXP1625.tpl diff --git a/plugins/wazo-grandstream/common/templates/GXP1628.tpl b/plugins/wazo_grandstream/common/templates/GXP1628.tpl similarity index 100% rename from plugins/wazo-grandstream/common/templates/GXP1628.tpl rename to plugins/wazo_grandstream/common/templates/GXP1628.tpl diff --git a/plugins/wazo-grandstream/common/templates/GXP1630.tpl b/plugins/wazo_grandstream/common/templates/GXP1630.tpl similarity index 100% rename from plugins/wazo-grandstream/common/templates/GXP1630.tpl rename to plugins/wazo_grandstream/common/templates/GXP1630.tpl diff --git a/plugins/wazo-grandstream/common/templates/GXP2000.tpl b/plugins/wazo_grandstream/common/templates/GXP2000.tpl similarity index 100% rename from plugins/wazo-grandstream/common/templates/GXP2000.tpl rename to plugins/wazo_grandstream/common/templates/GXP2000.tpl diff --git a/plugins/wazo-grandstream/common/templates/GXP2100.tpl b/plugins/wazo_grandstream/common/templates/GXP2100.tpl similarity index 100% rename from plugins/wazo-grandstream/common/templates/GXP2100.tpl rename to plugins/wazo_grandstream/common/templates/GXP2100.tpl diff --git a/plugins/wazo-grandstream/common/templates/GXV3350.tpl b/plugins/wazo_grandstream/common/templates/GXV3350.tpl similarity index 100% rename from plugins/wazo-grandstream/common/templates/GXV3350.tpl rename to plugins/wazo_grandstream/common/templates/GXV3350.tpl diff --git a/plugins/wazo-grandstream/common/templates/GXV3370.tpl b/plugins/wazo_grandstream/common/templates/GXV3370.tpl similarity index 100% rename from plugins/wazo-grandstream/common/templates/GXV3370.tpl rename to plugins/wazo_grandstream/common/templates/GXV3370.tpl diff --git a/plugins/wazo-grandstream/common/templates/GXV3380.tpl b/plugins/wazo_grandstream/common/templates/GXV3380.tpl similarity index 100% rename from plugins/wazo-grandstream/common/templates/GXV3380.tpl rename to plugins/wazo_grandstream/common/templates/GXV3380.tpl diff --git a/plugins/wazo-grandstream/common/templates/base.tpl b/plugins/wazo_grandstream/common/templates/base.tpl similarity index 100% rename from plugins/wazo-grandstream/common/templates/base.tpl rename to plugins/wazo_grandstream/common/templates/base.tpl diff --git a/plugins/wazo-grandstream/common/templates/base_v2.tpl b/plugins/wazo_grandstream/common/templates/base_v2.tpl similarity index 100% rename from plugins/wazo-grandstream/common/templates/base_v2.tpl rename to plugins/wazo_grandstream/common/templates/base_v2.tpl diff --git a/plugins/wazo-grandstream/common/var/tftpboot/Grandstream/.gitignore b/plugins/wazo_grandstream/common/var/tftpboot/Grandstream/.gitignore similarity index 100% rename from plugins/wazo-grandstream/common/var/tftpboot/Grandstream/.gitignore rename to plugins/wazo_grandstream/common/var/tftpboot/Grandstream/.gitignore diff --git a/plugins/wazo-grandstream/common_ata/common.py b/plugins/wazo_grandstream/common_ata/common.py similarity index 100% rename from plugins/wazo-grandstream/common_ata/common.py rename to plugins/wazo_grandstream/common_ata/common.py diff --git a/plugins/wazo-grandstream/common_ata/templates/HT801.tpl b/plugins/wazo_grandstream/common_ata/templates/HT801.tpl similarity index 100% rename from plugins/wazo-grandstream/common_ata/templates/HT801.tpl rename to plugins/wazo_grandstream/common_ata/templates/HT801.tpl diff --git a/plugins/wazo-grandstream/common_ata/templates/HT802.tpl b/plugins/wazo_grandstream/common_ata/templates/HT802.tpl similarity index 100% rename from plugins/wazo-grandstream/common_ata/templates/HT802.tpl rename to plugins/wazo_grandstream/common_ata/templates/HT802.tpl diff --git a/plugins/wazo-grandstream/common_ata/templates/base.tpl b/plugins/wazo_grandstream/common_ata/templates/base.tpl similarity index 100% rename from plugins/wazo-grandstream/common_ata/templates/base.tpl rename to plugins/wazo_grandstream/common_ata/templates/base.tpl diff --git a/plugins/wazo-grandstream/1.0.27.2/entry.py b/plugins/wazo_grandstream/v1_0_27_2/entry.py similarity index 100% rename from plugins/wazo-grandstream/1.0.27.2/entry.py rename to plugins/wazo_grandstream/v1_0_27_2/entry.py diff --git a/plugins/wazo-grandstream/1.0.27.2/pkgs/pkgs.db b/plugins/wazo_grandstream/v1_0_27_2/pkgs/pkgs.db similarity index 100% rename from plugins/wazo-grandstream/1.0.27.2/pkgs/pkgs.db rename to plugins/wazo_grandstream/v1_0_27_2/pkgs/pkgs.db diff --git a/plugins/wazo-grandstream/1.0.27.2/plugin-info b/plugins/wazo_grandstream/v1_0_27_2/plugin-info similarity index 100% rename from plugins/wazo-grandstream/1.0.27.2/plugin-info rename to plugins/wazo_grandstream/v1_0_27_2/plugin-info diff --git a/plugins/wazo-grandstream/1.0.3.27/entry.py b/plugins/wazo_grandstream/v1_0_3_27/entry.py similarity index 100% rename from plugins/wazo-grandstream/1.0.3.27/entry.py rename to plugins/wazo_grandstream/v1_0_3_27/entry.py diff --git a/plugins/wazo-grandstream/1.0.3.27/pkgs/pkgs.db b/plugins/wazo_grandstream/v1_0_3_27/pkgs/pkgs.db similarity index 100% rename from plugins/wazo-grandstream/1.0.3.27/pkgs/pkgs.db rename to plugins/wazo_grandstream/v1_0_3_27/pkgs/pkgs.db diff --git a/plugins/wazo-grandstream/1.0.3.27/plugin-info b/plugins/wazo_grandstream/v1_0_3_27/plugin-info similarity index 100% rename from plugins/wazo-grandstream/1.0.3.27/plugin-info rename to plugins/wazo_grandstream/v1_0_3_27/plugin-info diff --git a/plugins/wazo-grandstream/1.0.3.2x-android/entry.py b/plugins/wazo_grandstream/v1_0_3_2x_android/entry.py similarity index 100% rename from plugins/wazo-grandstream/1.0.3.2x-android/entry.py rename to plugins/wazo_grandstream/v1_0_3_2x_android/entry.py diff --git a/plugins/wazo-grandstream/1.0.3.2x-android/limitations.md b/plugins/wazo_grandstream/v1_0_3_2x_android/limitations.md similarity index 100% rename from plugins/wazo-grandstream/1.0.3.2x-android/limitations.md rename to plugins/wazo_grandstream/v1_0_3_2x_android/limitations.md diff --git a/plugins/wazo-grandstream/1.0.3.2x-android/pkgs/pkgs.db b/plugins/wazo_grandstream/v1_0_3_2x_android/pkgs/pkgs.db similarity index 100% rename from plugins/wazo-grandstream/1.0.3.2x-android/pkgs/pkgs.db rename to plugins/wazo_grandstream/v1_0_3_2x_android/pkgs/pkgs.db diff --git a/plugins/wazo-grandstream/1.0.3.2x-android/plugin-info b/plugins/wazo_grandstream/v1_0_3_2x_android/plugin-info similarity index 100% rename from plugins/wazo-grandstream/1.0.3.2x-android/plugin-info rename to plugins/wazo_grandstream/v1_0_3_2x_android/plugin-info diff --git a/plugins/wazo-grandstream/1.0.5.48/entry.py b/plugins/wazo_grandstream/v1_0_5_48/entry.py similarity index 100% rename from plugins/wazo-grandstream/1.0.5.48/entry.py rename to plugins/wazo_grandstream/v1_0_5_48/entry.py diff --git a/plugins/wazo-grandstream/1.0.5.48/limitations.md b/plugins/wazo_grandstream/v1_0_5_48/limitations.md similarity index 100% rename from plugins/wazo-grandstream/1.0.5.48/limitations.md rename to plugins/wazo_grandstream/v1_0_5_48/limitations.md diff --git a/plugins/wazo-grandstream/1.0.5.48/pkgs/pkgs.db b/plugins/wazo_grandstream/v1_0_5_48/pkgs/pkgs.db similarity index 100% rename from plugins/wazo-grandstream/1.0.5.48/pkgs/pkgs.db rename to plugins/wazo_grandstream/v1_0_5_48/pkgs/pkgs.db diff --git a/plugins/wazo-grandstream/1.0.5.48/plugin-info b/plugins/wazo_grandstream/v1_0_5_48/plugin-info similarity index 100% rename from plugins/wazo-grandstream/1.0.5.48/plugin-info rename to plugins/wazo_grandstream/v1_0_5_48/plugin-info diff --git a/plugins/wazo-grandstream/1.0.7.13/entry.py b/plugins/wazo_grandstream/v1_0_7_13/entry.py similarity index 100% rename from plugins/wazo-grandstream/1.0.7.13/entry.py rename to plugins/wazo_grandstream/v1_0_7_13/entry.py diff --git a/plugins/wazo-grandstream/1.0.7.13/install.md b/plugins/wazo_grandstream/v1_0_7_13/install.md similarity index 100% rename from plugins/wazo-grandstream/1.0.7.13/install.md rename to plugins/wazo_grandstream/v1_0_7_13/install.md diff --git a/plugins/wazo-grandstream/1.0.7.13/limitations.md b/plugins/wazo_grandstream/v1_0_7_13/limitations.md similarity index 100% rename from plugins/wazo-grandstream/1.0.7.13/limitations.md rename to plugins/wazo_grandstream/v1_0_7_13/limitations.md diff --git a/plugins/wazo-grandstream/1.0.7.13/pkgs/pkgs.db b/plugins/wazo_grandstream/v1_0_7_13/pkgs/pkgs.db similarity index 100% rename from plugins/wazo-grandstream/1.0.7.13/pkgs/pkgs.db rename to plugins/wazo_grandstream/v1_0_7_13/pkgs/pkgs.db diff --git a/plugins/wazo-grandstream/1.0.7.13/plugin-info b/plugins/wazo_grandstream/v1_0_7_13/plugin-info similarity index 100% rename from plugins/wazo-grandstream/1.0.7.13/plugin-info rename to plugins/wazo_grandstream/v1_0_7_13/plugin-info diff --git a/plugins/wazo-grandstream/1.0.8.6/entry.py b/plugins/wazo_grandstream/v1_0_8_6/entry.py similarity index 100% rename from plugins/wazo-grandstream/1.0.8.6/entry.py rename to plugins/wazo_grandstream/v1_0_8_6/entry.py diff --git a/plugins/wazo-grandstream/1.0.8.6/pkgs/pkgs.db b/plugins/wazo_grandstream/v1_0_8_6/pkgs/pkgs.db similarity index 100% rename from plugins/wazo-grandstream/1.0.8.6/pkgs/pkgs.db rename to plugins/wazo_grandstream/v1_0_8_6/pkgs/pkgs.db diff --git a/plugins/wazo-grandstream/1.0.8.6/plugin-info b/plugins/wazo_grandstream/v1_0_8_6/plugin-info similarity index 100% rename from plugins/wazo-grandstream/1.0.8.6/plugin-info rename to plugins/wazo_grandstream/v1_0_8_6/plugin-info diff --git a/plugins/wazo-grandstream/1.0.8.9/entry.py b/plugins/wazo_grandstream/v1_0_8_9/entry.py similarity index 100% rename from plugins/wazo-grandstream/1.0.8.9/entry.py rename to plugins/wazo_grandstream/v1_0_8_9/entry.py diff --git a/plugins/wazo-grandstream/1.0.8.9/pkgs/pkgs.db b/plugins/wazo_grandstream/v1_0_8_9/pkgs/pkgs.db similarity index 100% rename from plugins/wazo-grandstream/1.0.8.9/pkgs/pkgs.db rename to plugins/wazo_grandstream/v1_0_8_9/pkgs/pkgs.db diff --git a/plugins/wazo-grandstream/1.0.8.9/plugin-info b/plugins/wazo_grandstream/v1_0_8_9/plugin-info similarity index 100% rename from plugins/wazo-grandstream/1.0.8.9/plugin-info rename to plugins/wazo_grandstream/v1_0_8_9/plugin-info diff --git a/plugins/wazo-grandstream/1.2.5.3/entry.py b/plugins/wazo_grandstream/v1_2_5_3/entry.py similarity index 100% rename from plugins/wazo-grandstream/1.2.5.3/entry.py rename to plugins/wazo_grandstream/v1_2_5_3/entry.py diff --git a/plugins/wazo-grandstream/1.2.5.3/pkgs/pkgs.db b/plugins/wazo_grandstream/v1_2_5_3/pkgs/pkgs.db similarity index 100% rename from plugins/wazo-grandstream/1.2.5.3/pkgs/pkgs.db rename to plugins/wazo_grandstream/v1_2_5_3/pkgs/pkgs.db diff --git a/plugins/wazo-grandstream/1.2.5.3/plugin-info b/plugins/wazo_grandstream/v1_2_5_3/plugin-info similarity index 100% rename from plugins/wazo-grandstream/1.2.5.3/plugin-info rename to plugins/wazo_grandstream/v1_2_5_3/plugin-info diff --git a/plugins/wazo_htek/build.py b/plugins/wazo_htek/build.py new file mode 100644 index 0000000000000000000000000000000000000000..1cb39d5fe4ab9015929fca7f6e2f493fc9ce654c --- /dev/null +++ b/plugins/wazo_htek/build.py @@ -0,0 +1,31 @@ +""" +Copyright 2017-2023 The Wazo Authors (see the AUTHORS file) +SPDX-License-Identifier: GPL-3.0-or-later + +Depends on the following external programs: + -rsync +""" +from __future__ import annotations + +from typing import TYPE_CHECKING, Callable +from subprocess import check_call + +if TYPE_CHECKING: + + def target( + target_id: str, plugin_id: str, std_dirs: bool = True + ) -> Callable[[str], None]: + """The `target` method is injected in `exec` call by the build script.""" + return lambda x: None + + +@target('2.0.4.4.58', 'wazo-htek-2.0.4.4.58') +def build_2_0_4_4_58(path: str) -> None: + check_call(['rsync', '-rlp', '--exclude', '.*', 'common/', path]) + check_call(['rsync', '-rlp', '--exclude', '.*', 'v2_0_4_4_58/', path]) + + +@target('2.0.4.6.41', 'wazo-htek-2.0.4.6.41') +def build_2_0_4_6_41(path: str) -> None: + check_call(['rsync', '-rlp', '--exclude', '.*', 'common/', path]) + check_call(['rsync', '-rlp', '--exclude', '.*', 'v2_0_4_6_41/', path]) diff --git a/plugins/wazo-htek/common/common.py b/plugins/wazo_htek/common/common.py similarity index 100% rename from plugins/wazo-htek/common/common.py rename to plugins/wazo_htek/common/common.py diff --git a/plugins/wazo-htek/2.0.4.4.58/entry.py b/plugins/wazo_htek/v2_0_4_4_58/entry.py similarity index 100% rename from plugins/wazo-htek/2.0.4.4.58/entry.py rename to plugins/wazo_htek/v2_0_4_4_58/entry.py diff --git a/plugins/wazo-htek/2.0.4.4.58/install.md b/plugins/wazo_htek/v2_0_4_4_58/install.md similarity index 100% rename from plugins/wazo-htek/2.0.4.4.58/install.md rename to plugins/wazo_htek/v2_0_4_4_58/install.md diff --git a/plugins/wazo-htek/2.0.4.4.58/pkgs/pkgs.db b/plugins/wazo_htek/v2_0_4_4_58/pkgs/pkgs.db similarity index 100% rename from plugins/wazo-htek/2.0.4.4.58/pkgs/pkgs.db rename to plugins/wazo_htek/v2_0_4_4_58/pkgs/pkgs.db diff --git a/plugins/wazo-htek/2.0.4.4.58/plugin-info b/plugins/wazo_htek/v2_0_4_4_58/plugin-info similarity index 100% rename from plugins/wazo-htek/2.0.4.4.58/plugin-info rename to plugins/wazo_htek/v2_0_4_4_58/plugin-info diff --git a/plugins/wazo-htek/2.0.4.4.58/templates/UC902.tpl b/plugins/wazo_htek/v2_0_4_4_58/templates/UC902.tpl similarity index 100% rename from plugins/wazo-htek/2.0.4.4.58/templates/UC902.tpl rename to plugins/wazo_htek/v2_0_4_4_58/templates/UC902.tpl diff --git a/plugins/wazo-htek/2.0.4.4.58/templates/UC903.tpl b/plugins/wazo_htek/v2_0_4_4_58/templates/UC903.tpl similarity index 100% rename from plugins/wazo-htek/2.0.4.4.58/templates/UC903.tpl rename to plugins/wazo_htek/v2_0_4_4_58/templates/UC903.tpl diff --git a/plugins/wazo-htek/2.0.4.4.58/templates/UC912.tpl b/plugins/wazo_htek/v2_0_4_4_58/templates/UC912.tpl similarity index 100% rename from plugins/wazo-htek/2.0.4.4.58/templates/UC912.tpl rename to plugins/wazo_htek/v2_0_4_4_58/templates/UC912.tpl diff --git a/plugins/wazo-htek/2.0.4.4.58/templates/UC912E.tpl b/plugins/wazo_htek/v2_0_4_4_58/templates/UC912E.tpl similarity index 100% rename from plugins/wazo-htek/2.0.4.4.58/templates/UC912E.tpl rename to plugins/wazo_htek/v2_0_4_4_58/templates/UC912E.tpl diff --git a/plugins/wazo-htek/2.0.4.4.58/templates/UC912G.tpl b/plugins/wazo_htek/v2_0_4_4_58/templates/UC912G.tpl similarity index 100% rename from plugins/wazo-htek/2.0.4.4.58/templates/UC912G.tpl rename to plugins/wazo_htek/v2_0_4_4_58/templates/UC912G.tpl diff --git a/plugins/wazo-htek/2.0.4.4.58/templates/UC923.tpl b/plugins/wazo_htek/v2_0_4_4_58/templates/UC923.tpl similarity index 100% rename from plugins/wazo-htek/2.0.4.4.58/templates/UC923.tpl rename to plugins/wazo_htek/v2_0_4_4_58/templates/UC923.tpl diff --git a/plugins/wazo-htek/2.0.4.4.58/templates/UC924.tpl b/plugins/wazo_htek/v2_0_4_4_58/templates/UC924.tpl similarity index 100% rename from plugins/wazo-htek/2.0.4.4.58/templates/UC924.tpl rename to plugins/wazo_htek/v2_0_4_4_58/templates/UC924.tpl diff --git a/plugins/wazo-htek/2.0.4.4.58/templates/UC924E.tpl b/plugins/wazo_htek/v2_0_4_4_58/templates/UC924E.tpl similarity index 100% rename from plugins/wazo-htek/2.0.4.4.58/templates/UC924E.tpl rename to plugins/wazo_htek/v2_0_4_4_58/templates/UC924E.tpl diff --git a/plugins/wazo-htek/2.0.4.4.58/templates/UC926.tpl b/plugins/wazo_htek/v2_0_4_4_58/templates/UC926.tpl similarity index 100% rename from plugins/wazo-htek/2.0.4.4.58/templates/UC926.tpl rename to plugins/wazo_htek/v2_0_4_4_58/templates/UC926.tpl diff --git a/plugins/wazo-htek/2.0.4.4.58/templates/UC926E.tpl b/plugins/wazo_htek/v2_0_4_4_58/templates/UC926E.tpl similarity index 100% rename from plugins/wazo-htek/2.0.4.4.58/templates/UC926E.tpl rename to plugins/wazo_htek/v2_0_4_4_58/templates/UC926E.tpl diff --git a/plugins/wazo-htek/2.0.4.4.58/templates/base.tpl b/plugins/wazo_htek/v2_0_4_4_58/templates/base.tpl similarity index 100% rename from plugins/wazo-htek/2.0.4.4.58/templates/base.tpl rename to plugins/wazo_htek/v2_0_4_4_58/templates/base.tpl diff --git a/plugins/wazo-htek/2.0.4.4.58/templates/common/model.tpl b/plugins/wazo_htek/v2_0_4_4_58/templates/common/model.tpl similarity index 100% rename from plugins/wazo-htek/2.0.4.4.58/templates/common/model.tpl rename to plugins/wazo_htek/v2_0_4_4_58/templates/common/model.tpl diff --git a/plugins/wazo-htek/2.0.4.6.41/entry.py b/plugins/wazo_htek/v2_0_4_6_41/entry.py similarity index 100% rename from plugins/wazo-htek/2.0.4.6.41/entry.py rename to plugins/wazo_htek/v2_0_4_6_41/entry.py diff --git a/plugins/wazo-htek/2.0.4.6.41/install.md b/plugins/wazo_htek/v2_0_4_6_41/install.md similarity index 100% rename from plugins/wazo-htek/2.0.4.6.41/install.md rename to plugins/wazo_htek/v2_0_4_6_41/install.md diff --git a/plugins/wazo-htek/2.0.4.6.41/pkgs/pkgs.db b/plugins/wazo_htek/v2_0_4_6_41/pkgs/pkgs.db similarity index 100% rename from plugins/wazo-htek/2.0.4.6.41/pkgs/pkgs.db rename to plugins/wazo_htek/v2_0_4_6_41/pkgs/pkgs.db diff --git a/plugins/wazo-htek/2.0.4.6.41/plugin-info b/plugins/wazo_htek/v2_0_4_6_41/plugin-info similarity index 100% rename from plugins/wazo-htek/2.0.4.6.41/plugin-info rename to plugins/wazo_htek/v2_0_4_6_41/plugin-info diff --git a/plugins/wazo-htek/2.0.4.6.41/templates/UC902.tpl b/plugins/wazo_htek/v2_0_4_6_41/templates/UC902.tpl similarity index 100% rename from plugins/wazo-htek/2.0.4.6.41/templates/UC902.tpl rename to plugins/wazo_htek/v2_0_4_6_41/templates/UC902.tpl diff --git a/plugins/wazo-htek/2.0.4.6.41/templates/UC903.tpl b/plugins/wazo_htek/v2_0_4_6_41/templates/UC903.tpl similarity index 100% rename from plugins/wazo-htek/2.0.4.6.41/templates/UC903.tpl rename to plugins/wazo_htek/v2_0_4_6_41/templates/UC903.tpl diff --git a/plugins/wazo-htek/2.0.4.6.41/templates/UC912.tpl b/plugins/wazo_htek/v2_0_4_6_41/templates/UC912.tpl similarity index 100% rename from plugins/wazo-htek/2.0.4.6.41/templates/UC912.tpl rename to plugins/wazo_htek/v2_0_4_6_41/templates/UC912.tpl diff --git a/plugins/wazo-htek/2.0.4.6.41/templates/UC912G.tpl b/plugins/wazo_htek/v2_0_4_6_41/templates/UC912G.tpl similarity index 100% rename from plugins/wazo-htek/2.0.4.6.41/templates/UC912G.tpl rename to plugins/wazo_htek/v2_0_4_6_41/templates/UC912G.tpl diff --git a/plugins/wazo-htek/2.0.4.6.41/templates/UC923.tpl b/plugins/wazo_htek/v2_0_4_6_41/templates/UC923.tpl similarity index 100% rename from plugins/wazo-htek/2.0.4.6.41/templates/UC923.tpl rename to plugins/wazo_htek/v2_0_4_6_41/templates/UC923.tpl diff --git a/plugins/wazo-htek/2.0.4.6.41/templates/UC924.tpl b/plugins/wazo_htek/v2_0_4_6_41/templates/UC924.tpl similarity index 100% rename from plugins/wazo-htek/2.0.4.6.41/templates/UC924.tpl rename to plugins/wazo_htek/v2_0_4_6_41/templates/UC924.tpl diff --git a/plugins/wazo-htek/2.0.4.6.41/templates/UC926.tpl b/plugins/wazo_htek/v2_0_4_6_41/templates/UC926.tpl similarity index 100% rename from plugins/wazo-htek/2.0.4.6.41/templates/UC926.tpl rename to plugins/wazo_htek/v2_0_4_6_41/templates/UC926.tpl diff --git a/plugins/wazo-htek/2.0.4.6.41/templates/base.tpl b/plugins/wazo_htek/v2_0_4_6_41/templates/base.tpl similarity index 100% rename from plugins/wazo-htek/2.0.4.6.41/templates/base.tpl rename to plugins/wazo_htek/v2_0_4_6_41/templates/base.tpl diff --git a/plugins/wazo-htek/2.0.4.6.41/templates/common/model.tpl b/plugins/wazo_htek/v2_0_4_6_41/templates/common/model.tpl similarity index 100% rename from plugins/wazo-htek/2.0.4.6.41/templates/common/model.tpl rename to plugins/wazo_htek/v2_0_4_6_41/templates/common/model.tpl diff --git a/plugins/wazo-jitsi/build.py b/plugins/wazo_jitsi/build.py similarity index 61% rename from plugins/wazo-jitsi/build.py rename to plugins/wazo_jitsi/build.py index 9fbf5b7b16a7bc30a9a97538a1b79ef658bf43d9..34f61207242ca5d7a48fb76a22cbe5b48c8117ac 100644 --- a/plugins/wazo-jitsi/build.py +++ b/plugins/wazo_jitsi/build.py @@ -1,4 +1,4 @@ -# Copyright (C) 2013-2022 The Wazo Authors (see the AUTHORS file) +# Copyright 2013-2023 The Wazo Authors (see the AUTHORS file) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -15,10 +15,20 @@ # Depends on the following external programs: # -rsync +from __future__ import annotations +from typing import TYPE_CHECKING, Callable from subprocess import check_call +if TYPE_CHECKING: + + def target( + target_id: str, plugin_id: str, std_dirs: bool = True + ) -> Callable[[str], None]: + """The `target` method is injected in `exec` call by the build script.""" + return lambda x: None + @target('1', 'wazo-jitsi-1') -def build_1(path): - check_call(['rsync', '-rlp', '--exclude', '.*', '1/', path]) +def build_1(path: str) -> None: + check_call(['rsync', '-rlp', '--exclude', '.*', 'v1/', path]) diff --git a/plugins/wazo-jitsi/1/entry.py b/plugins/wazo_jitsi/v1/entry.py similarity index 100% rename from plugins/wazo-jitsi/1/entry.py rename to plugins/wazo_jitsi/v1/entry.py diff --git a/plugins/wazo-jitsi/1/installation.md b/plugins/wazo_jitsi/v1/installation.md similarity index 100% rename from plugins/wazo-jitsi/1/installation.md rename to plugins/wazo_jitsi/v1/installation.md diff --git a/plugins/wazo-jitsi/1/plugin-info b/plugins/wazo_jitsi/v1/plugin-info similarity index 100% rename from plugins/wazo-jitsi/1/plugin-info rename to plugins/wazo_jitsi/v1/plugin-info diff --git a/plugins/wazo-jitsi/1/templates/Jitsi.tpl b/plugins/wazo_jitsi/v1/templates/Jitsi.tpl similarity index 100% rename from plugins/wazo-jitsi/1/templates/Jitsi.tpl rename to plugins/wazo_jitsi/v1/templates/Jitsi.tpl diff --git a/plugins/wazo-jitsi/1/templates/base.tpl b/plugins/wazo_jitsi/v1/templates/base.tpl similarity index 100% rename from plugins/wazo-jitsi/1/templates/base.tpl rename to plugins/wazo_jitsi/v1/templates/base.tpl diff --git a/plugins/wazo-panasonic/build.py b/plugins/wazo_panasonic/build.py similarity index 66% rename from plugins/wazo-panasonic/build.py rename to plugins/wazo_panasonic/build.py index 1a98d53f4b84c37149c83eb8e4bc4d5d2dc5a525..b437425de1258c7f7502cda95c3ea5163a6b03e4 100644 --- a/plugins/wazo-panasonic/build.py +++ b/plugins/wazo_panasonic/build.py @@ -1,4 +1,4 @@ -# Copyright (C) 2013-2022 The Wazo Authors (see the AUTHORS file) +# Copyright 2013-2023 The Wazo Authors (see the AUTHORS file) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -15,12 +15,22 @@ # Depends on the following external programs: # -rsync +from __future__ import annotations +from typing import TYPE_CHECKING, Callable from subprocess import check_call +if TYPE_CHECKING: + + def target( + target_id: str, plugin_id: str, std_dirs: bool = True + ) -> Callable[[str], None]: + """The `target` method is injected in `exec` call by the build script.""" + return lambda x: None + @target('01.133', 'wazo-panasonic-01.133') -def build_01_133(path): +def build_01_133(path: str) -> None: check_call( [ 'rsync', @@ -33,5 +43,4 @@ def build_01_133(path): path, ] ) - - check_call(['rsync', '-rlp', '--exclude', '.*', '01.133/', path]) + check_call(['rsync', '-rlp', '--exclude', '.*', 'v01_133/', path]) diff --git a/plugins/wazo-panasonic/common/common.py b/plugins/wazo_panasonic/common/common.py similarity index 100% rename from plugins/wazo-panasonic/common/common.py rename to plugins/wazo_panasonic/common/common.py diff --git a/plugins/wazo-panasonic/common/templates/KX-UT113.cfg b/plugins/wazo_panasonic/common/templates/KX-UT113.cfg similarity index 100% rename from plugins/wazo-panasonic/common/templates/KX-UT113.cfg rename to plugins/wazo_panasonic/common/templates/KX-UT113.cfg diff --git a/plugins/wazo-panasonic/common/templates/KX-UT123.cfg b/plugins/wazo_panasonic/common/templates/KX-UT123.cfg similarity index 100% rename from plugins/wazo-panasonic/common/templates/KX-UT123.cfg rename to plugins/wazo_panasonic/common/templates/KX-UT123.cfg diff --git a/plugins/wazo-panasonic/common/templates/KX-UT133.cfg b/plugins/wazo_panasonic/common/templates/KX-UT133.cfg similarity index 100% rename from plugins/wazo-panasonic/common/templates/KX-UT133.cfg rename to plugins/wazo_panasonic/common/templates/KX-UT133.cfg diff --git a/plugins/wazo-panasonic/common/templates/KX-UT136.cfg b/plugins/wazo_panasonic/common/templates/KX-UT136.cfg similarity index 100% rename from plugins/wazo-panasonic/common/templates/KX-UT136.cfg rename to plugins/wazo_panasonic/common/templates/KX-UT136.cfg diff --git a/plugins/wazo-panasonic/common/templates/base.tpl b/plugins/wazo_panasonic/common/templates/base.tpl similarity index 100% rename from plugins/wazo-panasonic/common/templates/base.tpl rename to plugins/wazo_panasonic/common/templates/base.tpl diff --git a/plugins/wazo-panasonic/common/templates/common/KX-UT113.tpl b/plugins/wazo_panasonic/common/templates/common/KX-UT113.tpl similarity index 100% rename from plugins/wazo-panasonic/common/templates/common/KX-UT113.tpl rename to plugins/wazo_panasonic/common/templates/common/KX-UT113.tpl diff --git a/plugins/wazo-panasonic/common/templates/common/KX-UT123.tpl b/plugins/wazo_panasonic/common/templates/common/KX-UT123.tpl similarity index 100% rename from plugins/wazo-panasonic/common/templates/common/KX-UT123.tpl rename to plugins/wazo_panasonic/common/templates/common/KX-UT123.tpl diff --git a/plugins/wazo-panasonic/common/templates/common/KX-UT133.tpl b/plugins/wazo_panasonic/common/templates/common/KX-UT133.tpl similarity index 100% rename from plugins/wazo-panasonic/common/templates/common/KX-UT133.tpl rename to plugins/wazo_panasonic/common/templates/common/KX-UT133.tpl diff --git a/plugins/wazo-panasonic/common/templates/common/KX-UT136.tpl b/plugins/wazo_panasonic/common/templates/common/KX-UT136.tpl similarity index 100% rename from plugins/wazo-panasonic/common/templates/common/KX-UT136.tpl rename to plugins/wazo_panasonic/common/templates/common/KX-UT136.tpl diff --git a/plugins/wazo-panasonic/01.133/entry.py b/plugins/wazo_panasonic/v01_133/entry.py similarity index 100% rename from plugins/wazo-panasonic/01.133/entry.py rename to plugins/wazo_panasonic/v01_133/entry.py diff --git a/plugins/wazo-panasonic/01.133/pkgs/pkgs.db b/plugins/wazo_panasonic/v01_133/pkgs/pkgs.db similarity index 100% rename from plugins/wazo-panasonic/01.133/pkgs/pkgs.db rename to plugins/wazo_panasonic/v01_133/pkgs/pkgs.db diff --git a/plugins/wazo-panasonic/01.133/plugin-info b/plugins/wazo_panasonic/v01_133/plugin-info similarity index 100% rename from plugins/wazo-panasonic/01.133/plugin-info rename to plugins/wazo_panasonic/v01_133/plugin-info diff --git a/plugins/wazo_patton/build.py b/plugins/wazo_patton/build.py new file mode 100644 index 0000000000000000000000000000000000000000..abfaba8c0aeff6be042d7825ce241bedc9026c28 --- /dev/null +++ b/plugins/wazo_patton/build.py @@ -0,0 +1,31 @@ +""" +Copyright 2016-2023 The Wazo Authors (see the AUTHORS file) +SPDX-License-Identifier: GPL-3.0-or-later + +Depends on the following external programs: + -rsync +""" +from __future__ import annotations + +from typing import TYPE_CHECKING, Callable +from subprocess import check_call + +if TYPE_CHECKING: + + def target( + target_id: str, plugin_id: str, std_dirs: bool = True + ) -> Callable[[str], None]: + """The `target` method is injected in `exec` call by the build script.""" + return lambda x: None + + +@target('6.11', 'wazo-patton-6.11') +def build_6_11(path: str) -> None: + check_call(['rsync', '-rlp', '--exclude', '.*', 'common/', path]) + check_call(['rsync', '-rlp', '--exclude', '.*', 'v6_11/', path]) + + +@target('6.9', 'wazo-patton-6.9') +def build_6_9(path: str) -> None: + check_call(['rsync', '-rlp', '--exclude', '.*', 'common/', path]) + check_call(['rsync', '-rlp', '--exclude', '.*', 'v6_9/', path]) diff --git a/plugins/wazo-patton/common/common.py b/plugins/wazo_patton/common/common.py similarity index 100% rename from plugins/wazo-patton/common/common.py rename to plugins/wazo_patton/common/common.py diff --git a/plugins/wazo-patton/common/templates/SN4112.tpl b/plugins/wazo_patton/common/templates/SN4112.tpl similarity index 100% rename from plugins/wazo-patton/common/templates/SN4112.tpl rename to plugins/wazo_patton/common/templates/SN4112.tpl diff --git a/plugins/wazo-patton/common/templates/SN4114.tpl b/plugins/wazo_patton/common/templates/SN4114.tpl similarity index 100% rename from plugins/wazo-patton/common/templates/SN4114.tpl rename to plugins/wazo_patton/common/templates/SN4114.tpl diff --git a/plugins/wazo-patton/common/templates/SN4116.tpl b/plugins/wazo_patton/common/templates/SN4116.tpl similarity index 100% rename from plugins/wazo-patton/common/templates/SN4116.tpl rename to plugins/wazo_patton/common/templates/SN4116.tpl diff --git a/plugins/wazo-patton/common/templates/SN4118.tpl b/plugins/wazo_patton/common/templates/SN4118.tpl similarity index 100% rename from plugins/wazo-patton/common/templates/SN4118.tpl rename to plugins/wazo_patton/common/templates/SN4118.tpl diff --git a/plugins/wazo-patton/common/templates/SN4316.tpl b/plugins/wazo_patton/common/templates/SN4316.tpl similarity index 100% rename from plugins/wazo-patton/common/templates/SN4316.tpl rename to plugins/wazo_patton/common/templates/SN4316.tpl diff --git a/plugins/wazo-patton/common/templates/SN4324.tpl b/plugins/wazo_patton/common/templates/SN4324.tpl similarity index 100% rename from plugins/wazo-patton/common/templates/SN4324.tpl rename to plugins/wazo_patton/common/templates/SN4324.tpl diff --git a/plugins/wazo-patton/common/templates/SN4332.tpl b/plugins/wazo_patton/common/templates/SN4332.tpl similarity index 100% rename from plugins/wazo-patton/common/templates/SN4332.tpl rename to plugins/wazo_patton/common/templates/SN4332.tpl diff --git a/plugins/wazo-patton/common/templates/base.tpl b/plugins/wazo_patton/common/templates/base.tpl similarity index 100% rename from plugins/wazo-patton/common/templates/base.tpl rename to plugins/wazo_patton/common/templates/base.tpl diff --git a/plugins/wazo-patton/common/templates/region_FR.tpl b/plugins/wazo_patton/common/templates/region_FR.tpl similarity index 100% rename from plugins/wazo-patton/common/templates/region_FR.tpl rename to plugins/wazo_patton/common/templates/region_FR.tpl diff --git a/plugins/wazo-patton/6.11/entry.py b/plugins/wazo_patton/v6_11/entry.py similarity index 100% rename from plugins/wazo-patton/6.11/entry.py rename to plugins/wazo_patton/v6_11/entry.py diff --git a/plugins/wazo-patton/6.11/pkgs/pkgs.db b/plugins/wazo_patton/v6_11/pkgs/pkgs.db similarity index 100% rename from plugins/wazo-patton/6.11/pkgs/pkgs.db rename to plugins/wazo_patton/v6_11/pkgs/pkgs.db diff --git a/plugins/wazo-patton/6.11/plugin-info b/plugins/wazo_patton/v6_11/plugin-info similarity index 100% rename from plugins/wazo-patton/6.11/plugin-info rename to plugins/wazo_patton/v6_11/plugin-info diff --git a/plugins/wazo-patton/6.9/entry.py b/plugins/wazo_patton/v6_9/entry.py similarity index 100% rename from plugins/wazo-patton/6.9/entry.py rename to plugins/wazo_patton/v6_9/entry.py diff --git a/plugins/wazo-patton/6.9/pkgs/pkgs.db b/plugins/wazo_patton/v6_9/pkgs/pkgs.db similarity index 100% rename from plugins/wazo-patton/6.9/pkgs/pkgs.db rename to plugins/wazo_patton/v6_9/pkgs/pkgs.db diff --git a/plugins/wazo-patton/6.9/plugin-info b/plugins/wazo_patton/v6_9/plugin-info similarity index 100% rename from plugins/wazo-patton/6.9/plugin-info rename to plugins/wazo_patton/v6_9/plugin-info diff --git a/plugins/wazo-polycom/build.py b/plugins/wazo_polycom/build.py similarity index 87% rename from plugins/wazo-polycom/build.py rename to plugins/wazo_polycom/build.py index df498a2a60e3da5d1023e476b2fdba6ba07d106b..8d85ff58d769c1c19dcb80188c8a76991bbdd807 100644 --- a/plugins/wazo-polycom/build.py +++ b/plugins/wazo_polycom/build.py @@ -1,4 +1,4 @@ -# Copyright 2014-2022 The Wazo Authors (see the AUTHORS file) +# Copyright 2014-2023 The Wazo Authors (see the AUTHORS file) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -15,12 +15,22 @@ # Depends on the following external programs: # -rsync +from __future__ import annotations +from typing import TYPE_CHECKING, Callable from subprocess import check_call +if TYPE_CHECKING: + + def target( + target_id: str, plugin_id: str, std_dirs: bool = True + ) -> Callable[[str], None]: + """The `target` method is injected in `exec` call by the build script.""" + return lambda x: None + @target('4.0.11', 'wazo-polycom-4.0.11') -def build_4_0_11(path): +def build_4_0_11(path: str) -> None: check_call( [ 'rsync', @@ -57,12 +67,11 @@ def build_4_0_11(path): path, ] ) - - check_call(['rsync', '-rlp', '--exclude', '.*', '4.0.11/', path]) + check_call(['rsync', '-rlp', '--exclude', '.*', 'v4_0_11/', path]) @target('5.4.3', 'wazo-polycom-5.4.3') -def build_5_4_3(path): +def build_5_4_3(path: str) -> None: check_call( [ 'rsync', @@ -95,12 +104,11 @@ def build_5_4_3(path): path, ] ) - - check_call(['rsync', '-rlp', '--exclude', '.*', '5.4.3/', path]) + check_call(['rsync', '-rlp', '--exclude', '.*', 'v5_4_3/', path]) @target('5.5.1', 'wazo-polycom-5.5.1') -def build_5_5_1(path): +def build_5_5_1(path: str) -> None: check_call( [ 'rsync', @@ -133,12 +141,11 @@ def build_5_5_1(path): path, ] ) - - check_call(['rsync', '-rlp', '--exclude', '.*', '5.5.1/', path]) + check_call(['rsync', '-rlp', '--exclude', '.*', 'v5_5_1/', path]) @target('5.8.2', 'wazo-polycom-5.8.2') -def build_5_8_2(path): +def build_5_8_2(path: str) -> None: check_call( [ 'rsync', @@ -191,12 +198,11 @@ def build_5_8_2(path): path, ] ) - - check_call(['rsync', '-rlp', '--exclude', '.*', '5.8.2/', path]) + check_call(['rsync', '-rlp', '--exclude', '.*', 'v5_8_2/', path]) @target('5.9.2', 'wazo-polycom-5.9.2') -def build_5_9_2(path): +def build_5_9_2(path: str) -> None: check_call( [ 'rsync', @@ -249,12 +255,11 @@ def build_5_9_2(path): path, ] ) - - check_call(['rsync', '-rlp', '--exclude', '.*', '5.9.2/', path]) + check_call(['rsync', '-rlp', '--exclude', '.*', 'v5_9_2/', path]) @target('3.2.4B', 'wazo-polycom-3.2.4B') -def build_3_2_4B(path): +def build_3_2_4B(path: str) -> None: check_call( [ 'rsync', @@ -293,16 +298,15 @@ def build_3_2_4B(path): '/templates/SSIP7000.tpl', '--exclude', '/templates/*', - 'common-v3/', + 'common_v3/', path, ] ) - - check_call(['rsync', '-rlp', '--exclude', '.*', '3.2.4B/', path]) + check_call(['rsync', '-rlp', '--exclude', '.*', 'v3_2_4B/', path]) @target('3.1.6', 'wazo-polycom-3.1.6') -def build_3_1_6(path): +def build_3_1_6(path: str) -> None: check_call( [ 'rsync', @@ -323,9 +327,8 @@ def build_3_1_6(path): '/templates/SSIP4000.tpl', '--exclude', '/templates/*', - 'common-v3/', + 'common_v3/', path, ] ) - - check_call(['rsync', '-rlp', '--exclude', '.*', '3.1.6/', path]) + check_call(['rsync', '-rlp', '--exclude', '.*', 'v3_1_6/', path]) diff --git a/plugins/wazo-polycom/common/common.py b/plugins/wazo_polycom/common/common.py similarity index 100% rename from plugins/wazo-polycom/common/common.py rename to plugins/wazo_polycom/common/common.py diff --git a/plugins/wazo-polycom/common-v3/templates/SPIP321.tpl b/plugins/wazo_polycom/common/templates/SPIP321.tpl similarity index 100% rename from plugins/wazo-polycom/common-v3/templates/SPIP321.tpl rename to plugins/wazo_polycom/common/templates/SPIP321.tpl diff --git a/plugins/wazo-polycom/common-v3/templates/SPIP331.tpl b/plugins/wazo_polycom/common/templates/SPIP331.tpl similarity index 100% rename from plugins/wazo-polycom/common-v3/templates/SPIP331.tpl rename to plugins/wazo_polycom/common/templates/SPIP331.tpl diff --git a/plugins/wazo-polycom/common-v3/templates/SPIP335.tpl b/plugins/wazo_polycom/common/templates/SPIP335.tpl similarity index 100% rename from plugins/wazo-polycom/common-v3/templates/SPIP335.tpl rename to plugins/wazo_polycom/common/templates/SPIP335.tpl diff --git a/plugins/wazo-polycom/common-v3/templates/SPIP450.tpl b/plugins/wazo_polycom/common/templates/SPIP450.tpl similarity index 100% rename from plugins/wazo-polycom/common-v3/templates/SPIP450.tpl rename to plugins/wazo_polycom/common/templates/SPIP450.tpl diff --git a/plugins/wazo-polycom/common-v3/templates/SPIP550.tpl b/plugins/wazo_polycom/common/templates/SPIP550.tpl similarity index 100% rename from plugins/wazo-polycom/common-v3/templates/SPIP550.tpl rename to plugins/wazo_polycom/common/templates/SPIP550.tpl diff --git a/plugins/wazo-polycom/common-v3/templates/SPIP560.tpl b/plugins/wazo_polycom/common/templates/SPIP560.tpl similarity index 100% rename from plugins/wazo-polycom/common-v3/templates/SPIP560.tpl rename to plugins/wazo_polycom/common/templates/SPIP560.tpl diff --git a/plugins/wazo-polycom/common-v3/templates/SPIP650.tpl b/plugins/wazo_polycom/common/templates/SPIP650.tpl similarity index 100% rename from plugins/wazo-polycom/common-v3/templates/SPIP650.tpl rename to plugins/wazo_polycom/common/templates/SPIP650.tpl diff --git a/plugins/wazo-polycom/common-v3/templates/SPIP670.tpl b/plugins/wazo_polycom/common/templates/SPIP670.tpl similarity index 100% rename from plugins/wazo-polycom/common-v3/templates/SPIP670.tpl rename to plugins/wazo_polycom/common/templates/SPIP670.tpl diff --git a/plugins/wazo-polycom/common-v3/templates/SSIP5000.tpl b/plugins/wazo_polycom/common/templates/SSIP5000.tpl similarity index 100% rename from plugins/wazo-polycom/common-v3/templates/SSIP5000.tpl rename to plugins/wazo_polycom/common/templates/SSIP5000.tpl diff --git a/plugins/wazo-polycom/common-v3/templates/SSIP6000.tpl b/plugins/wazo_polycom/common/templates/SSIP6000.tpl similarity index 100% rename from plugins/wazo-polycom/common-v3/templates/SSIP6000.tpl rename to plugins/wazo_polycom/common/templates/SSIP6000.tpl diff --git a/plugins/wazo-polycom/common-v3/templates/SSIP7000.tpl b/plugins/wazo_polycom/common/templates/SSIP7000.tpl similarity index 100% rename from plugins/wazo-polycom/common-v3/templates/SSIP7000.tpl rename to plugins/wazo_polycom/common/templates/SSIP7000.tpl diff --git a/plugins/wazo-polycom/common/templates/VVX101.tpl b/plugins/wazo_polycom/common/templates/VVX101.tpl similarity index 100% rename from plugins/wazo-polycom/common/templates/VVX101.tpl rename to plugins/wazo_polycom/common/templates/VVX101.tpl diff --git a/plugins/wazo-polycom/common/templates/VVX150.tpl b/plugins/wazo_polycom/common/templates/VVX150.tpl similarity index 100% rename from plugins/wazo-polycom/common/templates/VVX150.tpl rename to plugins/wazo_polycom/common/templates/VVX150.tpl diff --git a/plugins/wazo-polycom/common/templates/VVX1500.tpl b/plugins/wazo_polycom/common/templates/VVX1500.tpl similarity index 100% rename from plugins/wazo-polycom/common/templates/VVX1500.tpl rename to plugins/wazo_polycom/common/templates/VVX1500.tpl diff --git a/plugins/wazo-polycom/common/templates/VVX200.tpl b/plugins/wazo_polycom/common/templates/VVX200.tpl similarity index 100% rename from plugins/wazo-polycom/common/templates/VVX200.tpl rename to plugins/wazo_polycom/common/templates/VVX200.tpl diff --git a/plugins/wazo-polycom/common/templates/VVX201.tpl b/plugins/wazo_polycom/common/templates/VVX201.tpl similarity index 100% rename from plugins/wazo-polycom/common/templates/VVX201.tpl rename to plugins/wazo_polycom/common/templates/VVX201.tpl diff --git a/plugins/wazo-polycom/common/templates/VVX250.tpl b/plugins/wazo_polycom/common/templates/VVX250.tpl similarity index 100% rename from plugins/wazo-polycom/common/templates/VVX250.tpl rename to plugins/wazo_polycom/common/templates/VVX250.tpl diff --git a/plugins/wazo-polycom/common/templates/VVX300.tpl b/plugins/wazo_polycom/common/templates/VVX300.tpl similarity index 100% rename from plugins/wazo-polycom/common/templates/VVX300.tpl rename to plugins/wazo_polycom/common/templates/VVX300.tpl diff --git a/plugins/wazo-polycom/common/templates/VVX301.tpl b/plugins/wazo_polycom/common/templates/VVX301.tpl similarity index 100% rename from plugins/wazo-polycom/common/templates/VVX301.tpl rename to plugins/wazo_polycom/common/templates/VVX301.tpl diff --git a/plugins/wazo-polycom/common/templates/VVX310.tpl b/plugins/wazo_polycom/common/templates/VVX310.tpl similarity index 100% rename from plugins/wazo-polycom/common/templates/VVX310.tpl rename to plugins/wazo_polycom/common/templates/VVX310.tpl diff --git a/plugins/wazo-polycom/common/templates/VVX311.tpl b/plugins/wazo_polycom/common/templates/VVX311.tpl similarity index 100% rename from plugins/wazo-polycom/common/templates/VVX311.tpl rename to plugins/wazo_polycom/common/templates/VVX311.tpl diff --git a/plugins/wazo-polycom/common/templates/VVX350.tpl b/plugins/wazo_polycom/common/templates/VVX350.tpl similarity index 100% rename from plugins/wazo-polycom/common/templates/VVX350.tpl rename to plugins/wazo_polycom/common/templates/VVX350.tpl diff --git a/plugins/wazo-polycom/common/templates/VVX400.tpl b/plugins/wazo_polycom/common/templates/VVX400.tpl similarity index 100% rename from plugins/wazo-polycom/common/templates/VVX400.tpl rename to plugins/wazo_polycom/common/templates/VVX400.tpl diff --git a/plugins/wazo-polycom/common/templates/VVX401.tpl b/plugins/wazo_polycom/common/templates/VVX401.tpl similarity index 100% rename from plugins/wazo-polycom/common/templates/VVX401.tpl rename to plugins/wazo_polycom/common/templates/VVX401.tpl diff --git a/plugins/wazo-polycom/common/templates/VVX410.tpl b/plugins/wazo_polycom/common/templates/VVX410.tpl similarity index 100% rename from plugins/wazo-polycom/common/templates/VVX410.tpl rename to plugins/wazo_polycom/common/templates/VVX410.tpl diff --git a/plugins/wazo-polycom/common/templates/VVX411.tpl b/plugins/wazo_polycom/common/templates/VVX411.tpl similarity index 100% rename from plugins/wazo-polycom/common/templates/VVX411.tpl rename to plugins/wazo_polycom/common/templates/VVX411.tpl diff --git a/plugins/wazo-polycom/common/templates/VVX450.tpl b/plugins/wazo_polycom/common/templates/VVX450.tpl similarity index 100% rename from plugins/wazo-polycom/common/templates/VVX450.tpl rename to plugins/wazo_polycom/common/templates/VVX450.tpl diff --git a/plugins/wazo-polycom/common/templates/VVX500.tpl b/plugins/wazo_polycom/common/templates/VVX500.tpl similarity index 100% rename from plugins/wazo-polycom/common/templates/VVX500.tpl rename to plugins/wazo_polycom/common/templates/VVX500.tpl diff --git a/plugins/wazo-polycom/common/templates/VVX501.tpl b/plugins/wazo_polycom/common/templates/VVX501.tpl similarity index 100% rename from plugins/wazo-polycom/common/templates/VVX501.tpl rename to plugins/wazo_polycom/common/templates/VVX501.tpl diff --git a/plugins/wazo-polycom/common/templates/VVX600.tpl b/plugins/wazo_polycom/common/templates/VVX600.tpl similarity index 100% rename from plugins/wazo-polycom/common/templates/VVX600.tpl rename to plugins/wazo_polycom/common/templates/VVX600.tpl diff --git a/plugins/wazo-polycom/common/templates/VVX601.tpl b/plugins/wazo_polycom/common/templates/VVX601.tpl similarity index 100% rename from plugins/wazo-polycom/common/templates/VVX601.tpl rename to plugins/wazo_polycom/common/templates/VVX601.tpl diff --git a/plugins/wazo-polycom/common/templates/base.tpl b/plugins/wazo_polycom/common/templates/base.tpl similarity index 100% rename from plugins/wazo-polycom/common/templates/base.tpl rename to plugins/wazo_polycom/common/templates/base.tpl diff --git a/plugins/wazo-polycom/common-v3/common.py b/plugins/wazo_polycom/common_v3/common.py similarity index 100% rename from plugins/wazo-polycom/common-v3/common.py rename to plugins/wazo_polycom/common_v3/common.py diff --git a/plugins/wazo-polycom/common-v3/templates/SPIP301.tpl b/plugins/wazo_polycom/common_v3/templates/SPIP301.tpl similarity index 100% rename from plugins/wazo-polycom/common-v3/templates/SPIP301.tpl rename to plugins/wazo_polycom/common_v3/templates/SPIP301.tpl diff --git a/plugins/wazo-polycom/common-v3/templates/SPIP320.tpl b/plugins/wazo_polycom/common_v3/templates/SPIP320.tpl similarity index 100% rename from plugins/wazo-polycom/common-v3/templates/SPIP320.tpl rename to plugins/wazo_polycom/common_v3/templates/SPIP320.tpl diff --git a/plugins/wazo-polycom/common/templates/SPIP321.tpl b/plugins/wazo_polycom/common_v3/templates/SPIP321.tpl similarity index 100% rename from plugins/wazo-polycom/common/templates/SPIP321.tpl rename to plugins/wazo_polycom/common_v3/templates/SPIP321.tpl diff --git a/plugins/wazo-polycom/common-v3/templates/SPIP330.tpl b/plugins/wazo_polycom/common_v3/templates/SPIP330.tpl similarity index 100% rename from plugins/wazo-polycom/common-v3/templates/SPIP330.tpl rename to plugins/wazo_polycom/common_v3/templates/SPIP330.tpl diff --git a/plugins/wazo-polycom/common/templates/SPIP331.tpl b/plugins/wazo_polycom/common_v3/templates/SPIP331.tpl similarity index 100% rename from plugins/wazo-polycom/common/templates/SPIP331.tpl rename to plugins/wazo_polycom/common_v3/templates/SPIP331.tpl diff --git a/plugins/wazo-polycom/common/templates/SPIP335.tpl b/plugins/wazo_polycom/common_v3/templates/SPIP335.tpl similarity index 100% rename from plugins/wazo-polycom/common/templates/SPIP335.tpl rename to plugins/wazo_polycom/common_v3/templates/SPIP335.tpl diff --git a/plugins/wazo-polycom/common-v3/templates/SPIP430.tpl b/plugins/wazo_polycom/common_v3/templates/SPIP430.tpl similarity index 100% rename from plugins/wazo-polycom/common-v3/templates/SPIP430.tpl rename to plugins/wazo_polycom/common_v3/templates/SPIP430.tpl diff --git a/plugins/wazo-polycom/common/templates/SPIP450.tpl b/plugins/wazo_polycom/common_v3/templates/SPIP450.tpl similarity index 100% rename from plugins/wazo-polycom/common/templates/SPIP450.tpl rename to plugins/wazo_polycom/common_v3/templates/SPIP450.tpl diff --git a/plugins/wazo-polycom/common-v3/templates/SPIP501.tpl b/plugins/wazo_polycom/common_v3/templates/SPIP501.tpl similarity index 100% rename from plugins/wazo-polycom/common-v3/templates/SPIP501.tpl rename to plugins/wazo_polycom/common_v3/templates/SPIP501.tpl diff --git a/plugins/wazo-polycom/common/templates/SPIP550.tpl b/plugins/wazo_polycom/common_v3/templates/SPIP550.tpl similarity index 100% rename from plugins/wazo-polycom/common/templates/SPIP550.tpl rename to plugins/wazo_polycom/common_v3/templates/SPIP550.tpl diff --git a/plugins/wazo-polycom/common/templates/SPIP560.tpl b/plugins/wazo_polycom/common_v3/templates/SPIP560.tpl similarity index 100% rename from plugins/wazo-polycom/common/templates/SPIP560.tpl rename to plugins/wazo_polycom/common_v3/templates/SPIP560.tpl diff --git a/plugins/wazo-polycom/common-v3/templates/SPIP600.tpl b/plugins/wazo_polycom/common_v3/templates/SPIP600.tpl similarity index 100% rename from plugins/wazo-polycom/common-v3/templates/SPIP600.tpl rename to plugins/wazo_polycom/common_v3/templates/SPIP600.tpl diff --git a/plugins/wazo-polycom/common-v3/templates/SPIP601.tpl b/plugins/wazo_polycom/common_v3/templates/SPIP601.tpl similarity index 100% rename from plugins/wazo-polycom/common-v3/templates/SPIP601.tpl rename to plugins/wazo_polycom/common_v3/templates/SPIP601.tpl diff --git a/plugins/wazo-polycom/common/templates/SPIP650.tpl b/plugins/wazo_polycom/common_v3/templates/SPIP650.tpl similarity index 100% rename from plugins/wazo-polycom/common/templates/SPIP650.tpl rename to plugins/wazo_polycom/common_v3/templates/SPIP650.tpl diff --git a/plugins/wazo-polycom/common/templates/SPIP670.tpl b/plugins/wazo_polycom/common_v3/templates/SPIP670.tpl similarity index 100% rename from plugins/wazo-polycom/common/templates/SPIP670.tpl rename to plugins/wazo_polycom/common_v3/templates/SPIP670.tpl diff --git a/plugins/wazo-polycom/common-v3/templates/SSIP4000.tpl b/plugins/wazo_polycom/common_v3/templates/SSIP4000.tpl similarity index 100% rename from plugins/wazo-polycom/common-v3/templates/SSIP4000.tpl rename to plugins/wazo_polycom/common_v3/templates/SSIP4000.tpl diff --git a/plugins/wazo-polycom/common/templates/SSIP5000.tpl b/plugins/wazo_polycom/common_v3/templates/SSIP5000.tpl similarity index 100% rename from plugins/wazo-polycom/common/templates/SSIP5000.tpl rename to plugins/wazo_polycom/common_v3/templates/SSIP5000.tpl diff --git a/plugins/wazo-polycom/common/templates/SSIP6000.tpl b/plugins/wazo_polycom/common_v3/templates/SSIP6000.tpl similarity index 100% rename from plugins/wazo-polycom/common/templates/SSIP6000.tpl rename to plugins/wazo_polycom/common_v3/templates/SSIP6000.tpl diff --git a/plugins/wazo-polycom/common/templates/SSIP7000.tpl b/plugins/wazo_polycom/common_v3/templates/SSIP7000.tpl similarity index 100% rename from plugins/wazo-polycom/common/templates/SSIP7000.tpl rename to plugins/wazo_polycom/common_v3/templates/SSIP7000.tpl diff --git a/plugins/wazo-polycom/common-v3/templates/VVX1500.tpl b/plugins/wazo_polycom/common_v3/templates/VVX1500.tpl similarity index 100% rename from plugins/wazo-polycom/common-v3/templates/VVX1500.tpl rename to plugins/wazo_polycom/common_v3/templates/VVX1500.tpl diff --git a/plugins/wazo-polycom/common-v3/templates/base.tpl b/plugins/wazo_polycom/common_v3/templates/base.tpl similarity index 100% rename from plugins/wazo-polycom/common-v3/templates/base.tpl rename to plugins/wazo_polycom/common_v3/templates/base.tpl diff --git a/plugins/wazo-polycom/common-v3/var/tftpboot/common.cfg b/plugins/wazo_polycom/common_v3/var/tftpboot/common.cfg similarity index 100% rename from plugins/wazo-polycom/common-v3/var/tftpboot/common.cfg rename to plugins/wazo_polycom/common_v3/var/tftpboot/common.cfg diff --git a/plugins/wazo-polycom/3.1.6/entry.py b/plugins/wazo_polycom/v3_1_6/entry.py similarity index 100% rename from plugins/wazo-polycom/3.1.6/entry.py rename to plugins/wazo_polycom/v3_1_6/entry.py diff --git a/plugins/wazo-polycom/3.1.6/install.md b/plugins/wazo_polycom/v3_1_6/install.md similarity index 100% rename from plugins/wazo-polycom/3.1.6/install.md rename to plugins/wazo_polycom/v3_1_6/install.md diff --git a/plugins/wazo-polycom/3.1.6/pkgs/pkgs.db b/plugins/wazo_polycom/v3_1_6/pkgs/pkgs.db similarity index 100% rename from plugins/wazo-polycom/3.1.6/pkgs/pkgs.db rename to plugins/wazo_polycom/v3_1_6/pkgs/pkgs.db diff --git a/plugins/wazo-polycom/3.1.6/plugin-info b/plugins/wazo_polycom/v3_1_6/plugin-info similarity index 100% rename from plugins/wazo-polycom/3.1.6/plugin-info rename to plugins/wazo_polycom/v3_1_6/plugin-info diff --git a/plugins/wazo-polycom/3.1.6/var/tftpboot/000000000000.cfg b/plugins/wazo_polycom/v3_1_6/var/tftpboot/000000000000.cfg similarity index 100% rename from plugins/wazo-polycom/3.1.6/var/tftpboot/000000000000.cfg rename to plugins/wazo_polycom/v3_1_6/var/tftpboot/000000000000.cfg diff --git a/plugins/wazo-polycom/3.1.6/var/tftpboot/phone1.cfg b/plugins/wazo_polycom/v3_1_6/var/tftpboot/phone1.cfg similarity index 100% rename from plugins/wazo-polycom/3.1.6/var/tftpboot/phone1.cfg rename to plugins/wazo_polycom/v3_1_6/var/tftpboot/phone1.cfg diff --git a/plugins/wazo-polycom/3.1.6/var/tftpboot/sip.cfg b/plugins/wazo_polycom/v3_1_6/var/tftpboot/sip.cfg similarity index 100% rename from plugins/wazo-polycom/3.1.6/var/tftpboot/sip.cfg rename to plugins/wazo_polycom/v3_1_6/var/tftpboot/sip.cfg diff --git a/plugins/wazo-polycom/3.2.4B/entry.py b/plugins/wazo_polycom/v3_2_4B/entry.py similarity index 100% rename from plugins/wazo-polycom/3.2.4B/entry.py rename to plugins/wazo_polycom/v3_2_4B/entry.py diff --git a/plugins/wazo-polycom/3.2.4B/install.md b/plugins/wazo_polycom/v3_2_4B/install.md similarity index 100% rename from plugins/wazo-polycom/3.2.4B/install.md rename to plugins/wazo_polycom/v3_2_4B/install.md diff --git a/plugins/wazo-polycom/3.2.4B/pkgs/pkgs.db b/plugins/wazo_polycom/v3_2_4B/pkgs/pkgs.db similarity index 100% rename from plugins/wazo-polycom/3.2.4B/pkgs/pkgs.db rename to plugins/wazo_polycom/v3_2_4B/pkgs/pkgs.db diff --git a/plugins/wazo-polycom/3.2.4B/plugin-info b/plugins/wazo_polycom/v3_2_4B/plugin-info similarity index 100% rename from plugins/wazo-polycom/3.2.4B/plugin-info rename to plugins/wazo_polycom/v3_2_4B/plugin-info diff --git a/plugins/wazo-polycom/3.2.4B/var/tftpboot/000000000000.cfg b/plugins/wazo_polycom/v3_2_4B/var/tftpboot/000000000000.cfg similarity index 100% rename from plugins/wazo-polycom/3.2.4B/var/tftpboot/000000000000.cfg rename to plugins/wazo_polycom/v3_2_4B/var/tftpboot/000000000000.cfg diff --git a/plugins/wazo-polycom/3.2.4B/var/tftpboot/phone1.cfg b/plugins/wazo_polycom/v3_2_4B/var/tftpboot/phone1.cfg similarity index 100% rename from plugins/wazo-polycom/3.2.4B/var/tftpboot/phone1.cfg rename to plugins/wazo_polycom/v3_2_4B/var/tftpboot/phone1.cfg diff --git a/plugins/wazo-polycom/3.2.4B/var/tftpboot/sip.cfg b/plugins/wazo_polycom/v3_2_4B/var/tftpboot/sip.cfg similarity index 100% rename from plugins/wazo-polycom/3.2.4B/var/tftpboot/sip.cfg rename to plugins/wazo_polycom/v3_2_4B/var/tftpboot/sip.cfg diff --git a/plugins/wazo-polycom/4.0.11/entry.py b/plugins/wazo_polycom/v4_0_11/entry.py similarity index 100% rename from plugins/wazo-polycom/4.0.11/entry.py rename to plugins/wazo_polycom/v4_0_11/entry.py diff --git a/plugins/wazo-polycom/4.0.11/pkgs/pkgs.db b/plugins/wazo_polycom/v4_0_11/pkgs/pkgs.db similarity index 100% rename from plugins/wazo-polycom/4.0.11/pkgs/pkgs.db rename to plugins/wazo_polycom/v4_0_11/pkgs/pkgs.db diff --git a/plugins/wazo-polycom/4.0.11/plugin-info b/plugins/wazo_polycom/v4_0_11/plugin-info similarity index 100% rename from plugins/wazo-polycom/4.0.11/plugin-info rename to plugins/wazo_polycom/v4_0_11/plugin-info diff --git a/plugins/wazo-polycom/4.0.11/var/tftpboot/000000000000.cfg b/plugins/wazo_polycom/v4_0_11/var/tftpboot/000000000000.cfg similarity index 100% rename from plugins/wazo-polycom/4.0.11/var/tftpboot/000000000000.cfg rename to plugins/wazo_polycom/v4_0_11/var/tftpboot/000000000000.cfg diff --git a/plugins/wazo-polycom/4.0.11/var/tftpboot/common.cfg b/plugins/wazo_polycom/v4_0_11/var/tftpboot/common.cfg similarity index 100% rename from plugins/wazo-polycom/4.0.11/var/tftpboot/common.cfg rename to plugins/wazo_polycom/v4_0_11/var/tftpboot/common.cfg diff --git a/plugins/wazo-polycom/5.4.3/entry.py b/plugins/wazo_polycom/v5_4_3/entry.py similarity index 100% rename from plugins/wazo-polycom/5.4.3/entry.py rename to plugins/wazo_polycom/v5_4_3/entry.py diff --git a/plugins/wazo-polycom/5.4.3/pkgs/pkgs.db b/plugins/wazo_polycom/v5_4_3/pkgs/pkgs.db similarity index 100% rename from plugins/wazo-polycom/5.4.3/pkgs/pkgs.db rename to plugins/wazo_polycom/v5_4_3/pkgs/pkgs.db diff --git a/plugins/wazo-polycom/5.4.3/plugin-info b/plugins/wazo_polycom/v5_4_3/plugin-info similarity index 100% rename from plugins/wazo-polycom/5.4.3/plugin-info rename to plugins/wazo_polycom/v5_4_3/plugin-info diff --git a/plugins/wazo-polycom/5.4.3/var/tftpboot/000000000000.cfg b/plugins/wazo_polycom/v5_4_3/var/tftpboot/000000000000.cfg similarity index 100% rename from plugins/wazo-polycom/5.4.3/var/tftpboot/000000000000.cfg rename to plugins/wazo_polycom/v5_4_3/var/tftpboot/000000000000.cfg diff --git a/plugins/wazo-polycom/5.4.3/var/tftpboot/common.cfg b/plugins/wazo_polycom/v5_4_3/var/tftpboot/common.cfg similarity index 100% rename from plugins/wazo-polycom/5.4.3/var/tftpboot/common.cfg rename to plugins/wazo_polycom/v5_4_3/var/tftpboot/common.cfg diff --git a/plugins/wazo-polycom/5.5.1/entry.py b/plugins/wazo_polycom/v5_5_1/entry.py similarity index 100% rename from plugins/wazo-polycom/5.5.1/entry.py rename to plugins/wazo_polycom/v5_5_1/entry.py diff --git a/plugins/wazo-polycom/5.5.1/pkgs/pkgs.db b/plugins/wazo_polycom/v5_5_1/pkgs/pkgs.db similarity index 100% rename from plugins/wazo-polycom/5.5.1/pkgs/pkgs.db rename to plugins/wazo_polycom/v5_5_1/pkgs/pkgs.db diff --git a/plugins/wazo-polycom/5.5.1/plugin-info b/plugins/wazo_polycom/v5_5_1/plugin-info similarity index 100% rename from plugins/wazo-polycom/5.5.1/plugin-info rename to plugins/wazo_polycom/v5_5_1/plugin-info diff --git a/plugins/wazo-polycom/5.5.1/var/tftpboot/000000000000.cfg b/plugins/wazo_polycom/v5_5_1/var/tftpboot/000000000000.cfg similarity index 100% rename from plugins/wazo-polycom/5.5.1/var/tftpboot/000000000000.cfg rename to plugins/wazo_polycom/v5_5_1/var/tftpboot/000000000000.cfg diff --git a/plugins/wazo-polycom/5.5.1/var/tftpboot/common.cfg b/plugins/wazo_polycom/v5_5_1/var/tftpboot/common.cfg similarity index 100% rename from plugins/wazo-polycom/5.5.1/var/tftpboot/common.cfg rename to plugins/wazo_polycom/v5_5_1/var/tftpboot/common.cfg diff --git a/plugins/wazo-polycom/5.8.2/entry.py b/plugins/wazo_polycom/v5_8_2/entry.py similarity index 100% rename from plugins/wazo-polycom/5.8.2/entry.py rename to plugins/wazo_polycom/v5_8_2/entry.py diff --git a/plugins/wazo-polycom/5.8.2/pkgs/pkgs.db b/plugins/wazo_polycom/v5_8_2/pkgs/pkgs.db similarity index 100% rename from plugins/wazo-polycom/5.8.2/pkgs/pkgs.db rename to plugins/wazo_polycom/v5_8_2/pkgs/pkgs.db diff --git a/plugins/wazo-polycom/5.8.2/plugin-info b/plugins/wazo_polycom/v5_8_2/plugin-info similarity index 100% rename from plugins/wazo-polycom/5.8.2/plugin-info rename to plugins/wazo_polycom/v5_8_2/plugin-info diff --git a/plugins/wazo-polycom/5.8.2/var/tftpboot/000000000000.cfg b/plugins/wazo_polycom/v5_8_2/var/tftpboot/000000000000.cfg similarity index 100% rename from plugins/wazo-polycom/5.8.2/var/tftpboot/000000000000.cfg rename to plugins/wazo_polycom/v5_8_2/var/tftpboot/000000000000.cfg diff --git a/plugins/wazo-polycom/5.8.2/var/tftpboot/common.cfg b/plugins/wazo_polycom/v5_8_2/var/tftpboot/common.cfg similarity index 100% rename from plugins/wazo-polycom/5.8.2/var/tftpboot/common.cfg rename to plugins/wazo_polycom/v5_8_2/var/tftpboot/common.cfg diff --git a/plugins/wazo-polycom/5.9.2/entry.py b/plugins/wazo_polycom/v5_9_2/entry.py similarity index 100% rename from plugins/wazo-polycom/5.9.2/entry.py rename to plugins/wazo_polycom/v5_9_2/entry.py diff --git a/plugins/wazo-polycom/5.9.2/pkgs/pkgs.db b/plugins/wazo_polycom/v5_9_2/pkgs/pkgs.db similarity index 100% rename from plugins/wazo-polycom/5.9.2/pkgs/pkgs.db rename to plugins/wazo_polycom/v5_9_2/pkgs/pkgs.db diff --git a/plugins/wazo-polycom/5.9.2/plugin-info b/plugins/wazo_polycom/v5_9_2/plugin-info similarity index 100% rename from plugins/wazo-polycom/5.9.2/plugin-info rename to plugins/wazo_polycom/v5_9_2/plugin-info diff --git a/plugins/wazo-polycom/5.9.2/var/tftpboot/000000000000.cfg b/plugins/wazo_polycom/v5_9_2/var/tftpboot/000000000000.cfg similarity index 100% rename from plugins/wazo-polycom/5.9.2/var/tftpboot/000000000000.cfg rename to plugins/wazo_polycom/v5_9_2/var/tftpboot/000000000000.cfg diff --git a/plugins/wazo-polycom/5.9.2/var/tftpboot/common.cfg b/plugins/wazo_polycom/v5_9_2/var/tftpboot/common.cfg similarity index 100% rename from plugins/wazo-polycom/5.9.2/var/tftpboot/common.cfg rename to plugins/wazo_polycom/v5_9_2/var/tftpboot/common.cfg diff --git a/plugins/wazo-snom/build.py b/plugins/wazo_snom/build.py similarity index 78% rename from plugins/wazo-snom/build.py rename to plugins/wazo_snom/build.py index 705a8ff6063f8c2a0d1d2df12b2e82e61009d817..daa45bd55cc04205d8de34ce0d4e95d39bdd26bb 100644 --- a/plugins/wazo-snom/build.py +++ b/plugins/wazo_snom/build.py @@ -1,18 +1,28 @@ """ -Copyright 2014-2022 The Wazo Authors (see the AUTHORS file) +Copyright 2014-2023 The Wazo Authors (see the AUTHORS file) SPDX-License-Identifier: GPL-3.0-or-later Depends on the following external programs: - rsync - sed """ +from __future__ import annotations -import os.path +from typing import TYPE_CHECKING, Callable from subprocess import check_call +from pathlib import Path + +if TYPE_CHECKING: + + def target( + target_id: str, plugin_id: str, std_dirs: bool = True + ) -> Callable[[str], None]: + """The `target` method is injected in `exec` call by the build script.""" + return lambda x: None @target('8.7.5.35', 'wazo-snom-8.7.5.35') -def build_8_7_5_35(path): +def build_8_7_5_35(path: str) -> None: MODELS = [ ('300', 'f'), ('320', 'f'), @@ -29,18 +39,17 @@ def build_8_7_5_35(path): ('MP', 'r'), ('PA1', 'f'), ] - check_call( ['rsync', '-rlp', '--exclude', '.*', '--exclude', '*.btpl', 'common/', path] ) + template_dir = Path(path) / 'templates' / 'common' for model, fw_suffix in MODELS: # generate snom-firmware.xml.tpl from snom-model-firmware.xml.tpl.btpl - model_tpl = os.path.join( - path, 'templates', 'common', f'snom{model}-firmware.xml.tpl' - ) + model_tpl = template_dir / f'snom{model}-firmware.xml.tpl' + sed_script = f's/#FW_FILENAME#/snom{model}-8.7.5.35-SIP-{fw_suffix}.bin/' - with open(model_tpl, 'wb') as f: + with model_tpl.open(mode='wb') as f: check_call( [ 'sed', @@ -51,28 +60,27 @@ def build_8_7_5_35(path): ) # generate snom.htm.tpl from snom-model.htm.tpl.mtpl - model_tpl = os.path.join(path, 'templates', 'common', f'snom{model}.htm.tpl') + model_tpl = template_dir / f'snom{model}.htm.tpl' sed_script = f's/#MODEL#/{model}/' - with open(model_tpl, 'wb') as f: + with model_tpl.open(mode='wb') as f: check_call( ['sed', sed_script, 'common/templates/common/snom-model.htm.tpl.btpl'], stdout=f, ) # generate snom.xml.tpl from snom-model.xml.mtpl - model_tpl = os.path.join(path, 'templates', 'common', f'snom{model}.xml.tpl') + model_tpl = template_dir / f'snom{model}.xml.tpl' sed_script = f's/#MODEL#/{model}/' - with open(model_tpl, 'wb') as f: + with model_tpl.open(mode='wb') as f: check_call( ['sed', sed_script, 'common/templates/common/snom-model.xml.tpl.btpl'], stdout=f, ) - - check_call(['rsync', '-rlp', '--exclude', '.*', '8.7.5.35/', path]) + check_call(['rsync', '-rlp', '--exclude', '.*', 'v8_7_5_35/', path]) @target('8.9.3.40', 'wazo-snom-8.9.3.40') -def build_8_9_3_40(path): +def build_8_9_3_40(path: str) -> None: MODELS = [('D745', 'r')] check_call( @@ -93,14 +101,13 @@ def build_8_9_3_40(path): path, ] ) + template_dir = Path(path) / 'templates' / 'common' for model, fw_suffix in MODELS: # generate snom-firmware.xml.tpl from snom-model-firmware.xml.tpl.btpl - model_tpl = os.path.join( - path, 'templates', 'common', f'snom{model}-firmware.xml.tpl' - ) + model_tpl = template_dir / f'snom{model}-firmware.xml.tpl' sed_script = f's/#FW_FILENAME#/snom{model}-8.9.3.40-SIP-{fw_suffix}.bin/' - with open(model_tpl, 'wb') as f: + with model_tpl.open(mode='wb') as f: check_call( [ 'sed', @@ -111,28 +118,28 @@ def build_8_9_3_40(path): ) # generate snom.htm.tpl from snom-model.htm.tpl.mtpl - model_tpl = os.path.join(path, 'templates', 'common', f'snom{model}.htm.tpl') + model_tpl = template_dir / f'snom{model}.htm.tpl' sed_script = f's/#MODEL#/{model}/' - with open(model_tpl, 'wb') as f: + with model_tpl.open(mode='wb') as f: check_call( ['sed', sed_script, 'common/templates/common/snom-model.htm.tpl.btpl'], stdout=f, ) # generate snom.xml.tpl from snom-model.xml.mtpl - model_tpl = os.path.join(path, 'templates', 'common', f'snom{model}.xml.tpl') + model_tpl = template_dir / f'snom{model}.xml.tpl' sed_script = f's/#MODEL#/{model}/' - with open(model_tpl, 'wb') as f: + with model_tpl.open(mode='wb') as f: check_call( ['sed', sed_script, 'common/templates/common/snom-model.xml.tpl.btpl'], stdout=f, ) - check_call(['rsync', '-rlp', '--exclude', '.*', '8.9.3.40/', path]) + check_call(['rsync', '-rlp', '--exclude', '.*', 'v8_9_3_40/', path]) @target('8.9.3.60', 'wazo-snom-8.9.3.60') -def build_8_9_3_60(path): +def build_8_9_3_60(path: str) -> None: MODELS = [ ('D305', 'r'), ('D315', 'r'), @@ -158,14 +165,13 @@ def build_8_9_3_60(path): path, ] ) + template_dir = Path(path) / 'templates' / 'common' for model, fw_suffix in MODELS: # generate snom-firmware.xml.tpl from snom-model-firmware.xml.tpl.btpl - model_tpl = os.path.join( - path, 'templates', 'common', f'snom{model}-firmware.xml.tpl' - ) + model_tpl = template_dir / f'snom{model}-firmware.xml.tpl' sed_script = f's/#FW_FILENAME#/snom{model}-8.9.3.60-SIP-{fw_suffix}.bin/' - with open(model_tpl, 'wb') as f: + with model_tpl.open(mode='wb') as f: check_call( [ 'sed', @@ -176,24 +182,24 @@ def build_8_9_3_60(path): ) # generate snom.htm.tpl from snom-model.htm.tpl.mtpl - model_tpl = os.path.join(path, 'templates', 'common', f'snom{model}.htm.tpl') + model_tpl = template_dir / f'snom{model}.htm.tpl' sed_script = f's/#MODEL#/{model}/' - with open(model_tpl, 'wb') as f: + with model_tpl.open(mode='wb') as f: check_call( ['sed', sed_script, 'common/templates/common/snom-model.htm.tpl.btpl'], stdout=f, ) # generate snom.xml.tpl from snom-model.xml.mtpl - model_tpl = os.path.join(path, 'templates', 'common', f'snom{model}.xml.tpl') + model_tpl = template_dir / f'snom{model}.xml.tpl' sed_script = f's/#MODEL#/{model}/' - with open(model_tpl, 'wb') as f: + with model_tpl.open(mode='wb') as f: check_call( ['sed', sed_script, 'common/templates/common/snom-model.xml.tpl.btpl'], stdout=f, ) - check_call(['rsync', '-rlp', '--exclude', '.*', '8.9.3.60/', path]) + check_call(['rsync', '-rlp', '--exclude', '.*', 'v8_9_3_60/', path]) @target('8.9.3.80', 'wazo-snom-8.9.3.80') @@ -230,14 +236,13 @@ def build_8_9_3_80(path): path, ] ) + template_dir = Path(path) / 'templates' / 'common' for model, fw_suffix in MODELS: # generate snom-firmware.xml.tpl from snom-model-firmware.xml.tpl.btpl - model_tpl = os.path.join( - path, 'templates', 'common', f'snom{model}-firmware.xml.tpl' - ) + model_tpl = template_dir / f'snom{model}-firmware.xml.tpl' sed_script = f's/#FW_FILENAME#/snom{model}-8.9.3.80-SIP-{fw_suffix}.bin/' - with open(model_tpl, 'wb') as f: + with model_tpl.open(mode='wb') as f: check_call( [ 'sed', @@ -248,24 +253,24 @@ def build_8_9_3_80(path): ) # generate snom.htm.tpl from snom-model.htm.tpl.mtpl - model_tpl = os.path.join(path, 'templates', 'common', f'snom{model}.htm.tpl') + model_tpl = template_dir / f'snom{model}.htm.tpl' sed_script = f's/#MODEL#/{model}/' - with open(model_tpl, 'wb') as f: + with model_tpl.open(mode='wb') as f: check_call( ['sed', sed_script, 'common/templates/common/snom-model.htm.tpl.btpl'], stdout=f, ) # generate snom.xml.tpl from snom-model.xml.mtpl - model_tpl = os.path.join(path, 'templates', 'common', f'snom{model}.xml.tpl') + model_tpl = template_dir / f'snom{model}.xml.tpl' sed_script = f's/#MODEL#/{model}/' - with open(model_tpl, 'wb') as f: + with model_tpl.open(mode='wb') as f: check_call( ['sed', sed_script, 'common/templates/common/snom-model.xml.tpl.btpl'], stdout=f, ) - check_call(['rsync', '-rlp', '--exclude', '.*', '8.9.3.80/', path]) + check_call(['rsync', '-rlp', '--exclude', '.*', 'v8_9_3_80/', path]) @target('10.1.20.0', 'wazo-snom-10.1.20.0') @@ -291,14 +296,13 @@ def build_10_1_20_0(path): path, ] ) + template_dir = Path(path) / 'templates' / 'common' for model, fw_suffix in MODELS: # generate snom-firmware.xml.tpl from snom-model-firmware.xml.tpl.btpl - model_tpl = os.path.join( - path, 'templates', 'common', f'snom{model}-firmware.xml.tpl' - ) + model_tpl = template_dir / f'snom{model}-firmware.xml.tpl' sed_script = f's/#FW_FILENAME#/snom{model}-10.1.20.0-SIP-{fw_suffix}.bin/' - with open(model_tpl, 'wb') as f: + with model_tpl.open(mode='wb') as f: check_call( [ 'sed', @@ -309,24 +313,24 @@ def build_10_1_20_0(path): ) # generate snom.htm.tpl from snom-model.htm.tpl.mtpl - model_tpl = os.path.join(path, 'templates', 'common', f'snom{model}.htm.tpl') + model_tpl = template_dir / f'snom{model}.htm.tpl' sed_script = f's/#MODEL#/{model}/' - with open(model_tpl, 'wb') as f: + with model_tpl.open(mode='wb') as f: check_call( ['sed', sed_script, 'common/templates/common/snom-model.htm.tpl.btpl'], stdout=f, ) # generate snom.xml.tpl from snom-model.xml.mtpl - model_tpl = os.path.join(path, 'templates', 'common', f'snom{model}.xml.tpl') + model_tpl = template_dir / f'snom{model}.xml.tpl' sed_script = f's/#MODEL#/{model}/' - with open(model_tpl, 'wb') as f: + with model_tpl.open(mode='wb') as f: check_call( ['sed', sed_script, 'common/templates/common/snom-model.xml.tpl.btpl'], stdout=f, ) - check_call(['rsync', '-rlp', '--exclude', '.*', '10.1.20.0/', path]) + check_call(['rsync', '-rlp', '--exclude', '.*', 'v10_1_20_0/', path]) @target('10.1.26.1', 'wazo-snom-10.1.26.1') @@ -352,14 +356,13 @@ def build_10_1_26_1(path): path, ] ) + template_dir = Path(path) / 'templates' / 'common' for model, fw_suffix in MODELS: # generate snom-firmware.xml.tpl from snom-model-firmware.xml.tpl.btpl - model_tpl = os.path.join( - path, 'templates', 'common', f'snom{model}-firmware.xml.tpl' - ) + model_tpl = template_dir / f'snom{model}-firmware.xml.tpl' sed_script = f's/#FW_FILENAME#/snom{model}-10.1.26.1-SIP-{fw_suffix}.bin/' - with open(model_tpl, 'wb') as f: + with model_tpl.open(mode='wb') as f: check_call( [ 'sed', @@ -370,24 +373,24 @@ def build_10_1_26_1(path): ) # generate snom.htm.tpl from snom-model.htm.tpl.mtpl - model_tpl = os.path.join(path, 'templates', 'common', f'snom{model}.htm.tpl') + model_tpl = template_dir / f'snom{model}.htm.tpl' sed_script = f's/#MODEL#/{model}/' - with open(model_tpl, 'wb') as f: + with model_tpl.open(mode='wb') as f: check_call( ['sed', sed_script, 'common/templates/common/snom-model.htm.tpl.btpl'], stdout=f, ) # generate snom.xml.tpl from snom-model.xml.mtpl - model_tpl = os.path.join(path, 'templates', 'common', f'snom{model}.xml.tpl') + model_tpl = template_dir / f'snom{model}.xml.tpl' sed_script = f's/#MODEL#/{model}/' - with open(model_tpl, 'wb') as f: + with model_tpl.open(mode='wb') as f: check_call( ['sed', sed_script, 'common/templates/common/snom-model.xml.tpl.btpl'], stdout=f, ) - check_call(['rsync', '-rlp', '--exclude', '.*', '10.1.26.1/', path]) + check_call(['rsync', '-rlp', '--exclude', '.*', 'v10_1_26_1/', path]) @target('10.1.39.11', 'wazo-snom-10.1.39.11') @@ -424,14 +427,13 @@ def build_10_1_39_11(path): path, ] ) + template_dir = Path(path) / 'templates' / 'common' for model, fw_suffix in MODELS: # generate snom-firmware.xml.tpl from snom-model-firmware.xml.tpl.btpl - model_tpl = os.path.join( - path, 'templates', 'common', f'snom{model}-firmware.xml.tpl' - ) + model_tpl = template_dir / f'snom{model}-firmware.xml.tpl' sed_script = f's/#FW_FILENAME#/snom{model}-10.1.39.11-SIP-{fw_suffix}.bin/' - with open(model_tpl, 'wb') as f: + with model_tpl.open(mode='wb') as f: check_call( [ 'sed', @@ -442,24 +444,24 @@ def build_10_1_39_11(path): ) # generate snom.htm.tpl from snom-model.htm.tpl.mtpl - model_tpl = os.path.join(path, 'templates', 'common', f'snom{model}.htm.tpl') + model_tpl = template_dir / f'snom{model}.htm.tpl' sed_script = f's/#MODEL#/{model}/' - with open(model_tpl, 'wb') as f: + with model_tpl.open(mode='wb') as f: check_call( ['sed', sed_script, 'common/templates/common/snom-model.htm.tpl.btpl'], stdout=f, ) # generate snom.xml.tpl from snom-model.xml.mtpl - model_tpl = os.path.join(path, 'templates', 'common', f'snom{model}.xml.tpl') + model_tpl = template_dir / f'snom{model}.xml.tpl' sed_script = f's/#MODEL#/{model}/' - with open(model_tpl, 'wb') as f: + with model_tpl.open(mode='wb') as f: check_call( ['sed', sed_script, 'common/templates/common/snom-model.xml.tpl.btpl'], stdout=f, ) - check_call(['rsync', '-rlp', '--exclude', '.*', '10.1.39.11/', path]) + check_call(['rsync', '-rlp', '--exclude', '.*', 'v10_1_39_11/', path]) @target('10.1.46.16', 'wazo-snom-10.1.46.16') @@ -504,14 +506,15 @@ def build_10_1_46_16(path): path, ] ) + template_dir = Path(path) / 'templates' / 'common' for model, fw_suffix in MODELS: # generate snom-firmware.xml.tpl from snom-model-firmware.xml.tpl.btpl - model_tpl = os.path.join( - path, 'templates', 'common', f'snom{model}-firmware.xml.tpl' + model_tpl = ( + Path(path) / 'templates' / 'common' / f'snom{model}-firmware.xml.tpl' ) sed_script = f's/#FW_FILENAME#/snom{model}-10.1.46.16-SIP-{fw_suffix}.bin/' - with open(model_tpl, 'wb') as f: + with model_tpl.open(mode='wb') as f: check_call( [ 'sed', @@ -522,24 +525,24 @@ def build_10_1_46_16(path): ) # generate snom.htm.tpl from snom-model.htm.tpl.mtpl - model_tpl = os.path.join(path, 'templates', 'common', f'snom{model}.htm.tpl') + model_tpl = template_dir / f'snom{model}.htm.tpl' sed_script = f's/#MODEL#/{model}/' - with open(model_tpl, 'wb') as f: + with model_tpl.open(mode='wb') as f: check_call( ['sed', sed_script, 'common/templates/common/snom-model.htm.tpl.btpl'], stdout=f, ) # generate snom.xml.tpl from snom-model.xml.mtpl - model_tpl = os.path.join(path, 'templates', 'common', f'snom{model}.xml.tpl') + model_tpl = template_dir / f'snom{model}.xml.tpl' sed_script = f's/#MODEL#/{model}/' - with open(model_tpl, 'wb') as f: + with model_tpl.open(mode='wb') as f: check_call( ['sed', sed_script, 'common/templates/common/snom-model.xml.tpl.btpl'], stdout=f, ) - check_call(['rsync', '-rlp', '--exclude', '.*', '10.1.46.16/', path]) + check_call(['rsync', '-rlp', '--exclude', '.*', 'v10_1_46_16/', path]) @target('10.1.49.11', 'wazo-snom-10.1.49.11') @@ -584,14 +587,13 @@ def build_10_1_49_11(path): path, ] ) + template_dir = Path(path) / 'templates' / 'common' for model, fw_suffix in MODELS: # generate snom-firmware.xml.tpl from snom-model-firmware.xml.tpl.btpl - model_tpl = os.path.join( - path, 'templates', 'common', f'snom{model}-firmware.xml.tpl' - ) + model_tpl = template_dir / f'snom{model}-firmware.xml.tpl' sed_script = f's/#FW_FILENAME#/snom{model}-10.1.46.16-SIP-{fw_suffix}.bin/' - with open(model_tpl, 'wb') as f: + with model_tpl.open(mode='wb') as f: check_call( [ 'sed', @@ -602,24 +604,24 @@ def build_10_1_49_11(path): ) # generate snom.htm.tpl from snom-model.htm.tpl.mtpl - model_tpl = os.path.join(path, 'templates', 'common', f'snom{model}.htm.tpl') + model_tpl = template_dir / f'snom{model}.htm.tpl' sed_script = f's/#MODEL#/{model}/' - with open(model_tpl, 'wb') as f: + with model_tpl.open(mode='wb') as f: check_call( ['sed', sed_script, 'common/templates/common/snom-model.htm.tpl.btpl'], stdout=f, ) # generate snom.xml.tpl from snom-model.xml.mtpl - model_tpl = os.path.join(path, 'templates', 'common', f'snom{model}.xml.tpl') + model_tpl = template_dir / f'snom{model}.xml.tpl' sed_script = f's/#MODEL#/{model}/' - with open(model_tpl, 'wb') as f: + with model_tpl.open(mode='wb') as f: check_call( ['sed', sed_script, 'common/templates/common/snom-model.xml.tpl.btpl'], stdout=f, ) - check_call(['rsync', '-rlp', '--exclude', '.*', '10.1.49.11/', path]) + check_call(['rsync', '-rlp', '--exclude', '.*', 'v10_1_49_11/', path]) @target('10.1.51.12', 'wazo-snom-10.1.51.12') @@ -663,14 +665,13 @@ def build_10_1_51_12(path): path, ] ) + template_dir = Path(path) / 'templates' / 'common' for model, fw_suffix in MODELS: # generate snom-firmware.xml.tpl from snom-model-firmware.xml.tpl.btpl - model_tpl = os.path.join( - path, 'templates', 'common', f'snom{model}-firmware.xml.tpl' - ) + model_tpl = template_dir / f'snom{model}-firmware.xml.tpl' sed_script = f's/#FW_FILENAME#/snom{model}-10.1.51.12-SIP-{fw_suffix}.bin/' - with open(model_tpl, 'wb') as f: + with model_tpl.open(mode='wb') as f: check_call( [ 'sed', @@ -681,24 +682,24 @@ def build_10_1_51_12(path): ) # generate snom.htm.tpl from snom-model.htm.tpl.mtpl - model_tpl = os.path.join(path, 'templates', 'common', f'snom{model}.htm.tpl') + model_tpl = template_dir / f'snom{model}.htm.tpl' sed_script = f's/#MODEL#/{model}/' - with open(model_tpl, 'wb') as f: + with model_tpl.open(mode='wb') as f: check_call( ['sed', sed_script, 'common/templates/common/snom-model.htm.tpl.btpl'], stdout=f, ) # generate snom.xml.tpl from snom-model.xml.mtpl - model_tpl = os.path.join(path, 'templates', 'common', f'snom{model}.xml.tpl') + model_tpl = template_dir / f'snom{model}.xml.tpl' sed_script = f's/#MODEL#/{model}/' - with open(model_tpl, 'wb') as f: + with model_tpl.open(mode='wb') as f: check_call( ['sed', sed_script, 'common/templates/common/snom-model.xml.tpl.btpl'], stdout=f, ) - check_call(['rsync', '-rlp', '--exclude', '.*', '10.1.51.12/', path]) + check_call(['rsync', '-rlp', '--exclude', '.*', 'v10_1_51_12/', path]) @target('10.1.54.13', 'wazo-snom-10.1.54.13') @@ -742,14 +743,13 @@ def build_10_1_54_13(path): path, ] ) + template_dir = Path(path) / 'templates' / 'common' for model, fw_suffix in MODELS: # generate snom-firmware.xml.tpl from snom-model-firmware.xml.tpl.btpl - model_tpl = os.path.join( - path, 'templates', 'common', f'snom{model}-firmware.xml.tpl' - ) + model_tpl = template_dir / f'snom{model}-firmware.xml.tpl' sed_script = f's/#FW_FILENAME#/snom{model}-10.1.54.13-SIP-{fw_suffix}.bin/' - with open(model_tpl, 'wb') as f: + with model_tpl.open(mode='wb') as f: check_call( [ 'sed', @@ -760,24 +760,24 @@ def build_10_1_54_13(path): ) # generate snom.htm.tpl from snom-model.htm.tpl.mtpl - model_tpl = os.path.join(path, 'templates', 'common', f'snom{model}.htm.tpl') + model_tpl = template_dir / f'snom{model}.htm.tpl' sed_script = f's/#MODEL#/{model}/' - with open(model_tpl, 'wb') as f: + with model_tpl.open(mode='wb') as f: check_call( ['sed', sed_script, 'common/templates/common/snom-model.htm.tpl.btpl'], stdout=f, ) # generate snom.xml.tpl from snom-model.xml.mtpl - model_tpl = os.path.join(path, 'templates', 'common', f'snom{model}.xml.tpl') + model_tpl = template_dir / f'snom{model}.xml.tpl' sed_script = f's/#MODEL#/{model}/' - with open(model_tpl, 'wb') as f: + with model_tpl.open(mode='wb') as f: check_call( ['sed', sed_script, 'common/templates/common/snom-model.xml.tpl.btpl'], stdout=f, ) - check_call(['rsync', '-rlp', '--exclude', '.*', '10.1.54.13/', path]) + check_call(['rsync', '-rlp', '--exclude', '.*', 'v10_1_54_13/', path]) @target('05.20.0001', 'wazo-snom-dect-05.20.0001') @@ -809,14 +809,13 @@ def build_05_20_0001(path): path, ] ) + template_dir = Path(path) / 'templates' / 'common' for model in MODELS: # generate snom-firmware.xml.tpl from snom-model-firmware.xml.tpl.btpl - model_tpl = os.path.join( - path, 'templates', 'common', f'snom{model}-firmware.xml.tpl' - ) + model_tpl = template_dir / f'snom{model}-firmware.xml.tpl' sed_script = f's/#FW_FILENAME#/{model}_v0520_b0001.fwu/' - with open(model_tpl, 'wb') as f: + with model_tpl.open(mode='wb') as f: check_call( [ 'sed', @@ -827,9 +826,9 @@ def build_05_20_0001(path): ) # generate snom.htm.tpl from snom-model.htm.tpl.mtpl - model_tpl = os.path.join(path, 'templates', 'common', f'snom{model}.htm.tpl') + model_tpl = template_dir / f'snom{model}.htm.tpl' sed_script = f's/#MODEL#/{model}/' - with open(model_tpl, 'wb') as f: + with model_tpl.open(mode='wb') as f: check_call( [ 'sed', @@ -840,9 +839,9 @@ def build_05_20_0001(path): ) # generate snom.xml.tpl from snom-model.xml.mtpl - model_tpl = os.path.join(path, 'templates', 'common', f'snom{model}.xml.tpl') + model_tpl = template_dir / f'snom{model}.xml.tpl' sed_script = f's/#MODEL#/{model}/' - with open(model_tpl, 'wb') as f: + with model_tpl.open(mode='wb') as f: check_call( [ 'sed', @@ -852,7 +851,7 @@ def build_05_20_0001(path): stdout=f, ) - check_call(['rsync', '-rlp', '--exclude', '.*', '05.20.0001/', path]) + check_call(['rsync', '-rlp', '--exclude', '.*', 'v05_20_0001/', path]) @target('10.1.101.11', 'wazo-snom-10.1.101.11') @@ -895,14 +894,13 @@ def build_10_1_101_11(path): path, ] ) + template_dir = Path(path) / 'templates' / 'common' for model, fw_suffix in MODELS: # generate snom-firmware.xml.tpl from snom-model-firmware.xml.tpl.btpl - model_tpl = os.path.join( - path, 'templates', 'common', f'snom{model}-firmware.xml.tpl' - ) + model_tpl = template_dir / f'snom{model}-firmware.xml.tpl' sed_script = f's/#FW_FILENAME#/snom{model}-10.1.101.11-SIP-{fw_suffix}.bin/' - with open(model_tpl, 'wb') as f: + with model_tpl.open(mode='wb') as f: check_call( [ 'sed', @@ -913,24 +911,24 @@ def build_10_1_101_11(path): ) # generate snom.htm.tpl from snom-model.htm.tpl.mtpl - model_tpl = os.path.join(path, 'templates', 'common', f'snom{model}.htm.tpl') + model_tpl = template_dir / f'snom{model}.htm.tpl' sed_script = f's/#MODEL#/{model}/' - with open(model_tpl, 'wb') as f: + with model_tpl.open(mode='wb') as f: check_call( ['sed', sed_script, 'common/templates/common/snom-model.htm.tpl.btpl'], stdout=f, ) # generate snom.xml.tpl from snom-model.xml.mtpl - model_tpl = os.path.join(path, 'templates', 'common', f'snom{model}.xml.tpl') + model_tpl = template_dir / f'snom{model}.xml.tpl' sed_script = f's/#MODEL#/{model}/' - with open(model_tpl, 'wb') as f: + with model_tpl.open(mode='wb') as f: check_call( ['sed', sed_script, 'common/templates/common/snom-model.xml.tpl.btpl'], stdout=f, ) - check_call(['rsync', '-rlp', '--exclude', '.*', '10.1.101.11/', path]) + check_call(['rsync', '-rlp', '--exclude', '.*', 'v10_1_101_11/', path]) @target('10.1.141.13', 'wazo-snom-10.1.141.13') @@ -976,16 +974,15 @@ def build_10_1_141_13(path): path, ] ) + template_dir = Path(path) / 'templates' / 'common' for model, fw_suffix in MODELS: # generate snom-firmware.xml.tpl from snom-model-firmware.xml.tpl.btpl - model_tpl = os.path.join( - path, 'templates', 'common', f'snom{model}-firmware.xml.tpl' - ) + model_tpl = template_dir / f'snom{model}-firmware.xml.tpl' sed_script = f's/#FW_FILENAME#/snom{model}-10.1.141.13-SIP-{fw_suffix}.bin/' if model.startswith("D8"): sed_script = f's/#FW_FILENAME#/snom{model}-10.1.141.13-SIP-{fw_suffix}.swu/' - with open(model_tpl, 'wb') as f: + with model_tpl.open(mode='wb') as f: check_call( [ 'sed', @@ -996,24 +993,24 @@ def build_10_1_141_13(path): ) # generate snom.htm.tpl from snom-model.htm.tpl.mtpl - model_tpl = os.path.join(path, 'templates', 'common', f'snom{model}.htm.tpl') + model_tpl = template_dir / f'snom{model}.htm.tpl' sed_script = f's/#MODEL#/{model}/' - with open(model_tpl, 'wb') as f: + with model_tpl.open(mode='wb') as f: check_call( ['sed', sed_script, 'common/templates/common/snom-model.htm.tpl.btpl'], stdout=f, ) # generate snom.xml.tpl from snom-model.xml.mtpl - model_tpl = os.path.join(path, 'templates', 'common', f'snom{model}.xml.tpl') + model_tpl = template_dir / f'snom{model}.xml.tpl' sed_script = f's/#MODEL#/{model}/' - with open(model_tpl, 'wb') as f: + with model_tpl.open(mode='wb') as f: check_call( ['sed', sed_script, 'common/templates/common/snom-model.xml.tpl.btpl'], stdout=f, ) - check_call(['rsync', '-rlp', '--exclude', '.*', '10.1.141.13/', path]) + check_call(['rsync', '-rlp', '--exclude', '.*', 'v10_1_141_13/', path]) @target('10.1.152.12', 'wazo-snom-10.1.152.12') @@ -1059,16 +1056,15 @@ def build_10_1_152_12(path): path, ] ) + template_dir = Path(path) / 'templates' / 'common' for model, fw_suffix in MODELS: # generate snom-firmware.xml.tpl from snom-model-firmware.xml.tpl.btpl - model_tpl = os.path.join( - path, 'templates', 'common', f'snom{model}-firmware.xml.tpl' - ) + model_tpl = template_dir / f'snom{model}-firmware.xml.tpl' sed_script = f's/#FW_FILENAME#/snom{model}-10.1.152.12-SIP-{fw_suffix}.bin/' if model.startswith("D8"): sed_script = f's/#FW_FILENAME#/snom{model}-10.1.152.12-SIP-{fw_suffix}.swu/' - with open(model_tpl, 'wb') as f: + with model_tpl.open(mode='wb') as f: check_call( [ 'sed', @@ -1079,21 +1075,21 @@ def build_10_1_152_12(path): ) # generate snom.htm.tpl from snom-model.htm.tpl.mtpl - model_tpl = os.path.join(path, 'templates', 'common', f'snom{model}.htm.tpl') + model_tpl = template_dir / f'snom{model}.htm.tpl' sed_script = f's/#MODEL#/{model}/' - with open(model_tpl, 'wb') as f: + with model_tpl.open(mode='wb') as f: check_call( ['sed', sed_script, 'common/templates/common/snom-model.htm.tpl.btpl'], stdout=f, ) # generate snom.xml.tpl from snom-model.xml.mtpl - model_tpl = os.path.join(path, 'templates', 'common', f'snom{model}.xml.tpl') + model_tpl = template_dir / f'snom{model}.xml.tpl' sed_script = f's/#MODEL#/{model}/' - with open(model_tpl, 'wb') as f: + with model_tpl.open(mode='wb') as f: check_call( ['sed', sed_script, 'common/templates/common/snom-model.xml.tpl.btpl'], stdout=f, ) - check_call(['rsync', '-rlp', '--exclude', '.*', '10.1.152.12/', path]) + check_call(['rsync', '-rlp', '--exclude', '.*', 'v10_1_152_12/', path]) diff --git a/plugins/wazo-snom/common/common.py b/plugins/wazo_snom/common/common.py similarity index 99% rename from plugins/wazo-snom/common/common.py rename to plugins/wazo_snom/common/common.py index 31834b9479a93986167d630e1e19c0e2387a26c5..e0d565574bf298a827b7b58ccd41d07451d77dc4 100644 --- a/plugins/wazo-snom/common/common.py +++ b/plugins/wazo_snom/common/common.py @@ -184,6 +184,7 @@ class BaseSnomPlugin(StandardPlugin): def configure_common(self, raw_config): self._add_uxm_firmware(raw_config) + self._add_server_url(raw_config) for tpl_filename, filename in self._common_templates(): tpl = self._tpl_helper.get_template(tpl_filename) dst = os.path.join(self._tftpboot_dir, filename) diff --git a/plugins/wazo-snom/common/templates/300.tpl b/plugins/wazo_snom/common/templates/300.tpl similarity index 100% rename from plugins/wazo-snom/common/templates/300.tpl rename to plugins/wazo_snom/common/templates/300.tpl diff --git a/plugins/wazo-snom/common/templates/320.tpl b/plugins/wazo_snom/common/templates/320.tpl similarity index 100% rename from plugins/wazo-snom/common/templates/320.tpl rename to plugins/wazo_snom/common/templates/320.tpl diff --git a/plugins/wazo-snom/common/templates/370.tpl b/plugins/wazo_snom/common/templates/370.tpl similarity index 100% rename from plugins/wazo-snom/common/templates/370.tpl rename to plugins/wazo_snom/common/templates/370.tpl diff --git a/plugins/wazo-snom/common/templates/710.tpl b/plugins/wazo_snom/common/templates/710.tpl similarity index 100% rename from plugins/wazo-snom/common/templates/710.tpl rename to plugins/wazo_snom/common/templates/710.tpl diff --git a/plugins/wazo-snom/common/templates/715.tpl b/plugins/wazo_snom/common/templates/715.tpl similarity index 100% rename from plugins/wazo-snom/common/templates/715.tpl rename to plugins/wazo_snom/common/templates/715.tpl diff --git a/plugins/wazo-snom/common/templates/720.tpl b/plugins/wazo_snom/common/templates/720.tpl similarity index 100% rename from plugins/wazo-snom/common/templates/720.tpl rename to plugins/wazo_snom/common/templates/720.tpl diff --git a/plugins/wazo-snom/common/templates/725.tpl b/plugins/wazo_snom/common/templates/725.tpl similarity index 100% rename from plugins/wazo-snom/common/templates/725.tpl rename to plugins/wazo_snom/common/templates/725.tpl diff --git a/plugins/wazo-snom/common/templates/760.tpl b/plugins/wazo_snom/common/templates/760.tpl similarity index 100% rename from plugins/wazo-snom/common/templates/760.tpl rename to plugins/wazo_snom/common/templates/760.tpl diff --git a/plugins/wazo-snom/common/templates/820.tpl b/plugins/wazo_snom/common/templates/820.tpl similarity index 100% rename from plugins/wazo-snom/common/templates/820.tpl rename to plugins/wazo_snom/common/templates/820.tpl diff --git a/plugins/wazo-snom/common/templates/821.tpl b/plugins/wazo_snom/common/templates/821.tpl similarity index 100% rename from plugins/wazo-snom/common/templates/821.tpl rename to plugins/wazo_snom/common/templates/821.tpl diff --git a/plugins/wazo-snom/common/templates/870.tpl b/plugins/wazo_snom/common/templates/870.tpl similarity index 100% rename from plugins/wazo-snom/common/templates/870.tpl rename to plugins/wazo_snom/common/templates/870.tpl diff --git a/plugins/wazo-snom/common/templates/D305.tpl b/plugins/wazo_snom/common/templates/D305.tpl similarity index 100% rename from plugins/wazo-snom/common/templates/D305.tpl rename to plugins/wazo_snom/common/templates/D305.tpl diff --git a/plugins/wazo-snom/common/templates/D315.tpl b/plugins/wazo_snom/common/templates/D315.tpl similarity index 100% rename from plugins/wazo-snom/common/templates/D315.tpl rename to plugins/wazo_snom/common/templates/D315.tpl diff --git a/plugins/wazo-snom/common/templates/D335.tpl b/plugins/wazo_snom/common/templates/D335.tpl similarity index 100% rename from plugins/wazo-snom/common/templates/D335.tpl rename to plugins/wazo_snom/common/templates/D335.tpl diff --git a/plugins/wazo-snom/common/templates/D345.tpl b/plugins/wazo_snom/common/templates/D345.tpl similarity index 100% rename from plugins/wazo-snom/common/templates/D345.tpl rename to plugins/wazo_snom/common/templates/D345.tpl diff --git a/plugins/wazo-snom/common/templates/D375.tpl b/plugins/wazo_snom/common/templates/D375.tpl similarity index 100% rename from plugins/wazo-snom/common/templates/D375.tpl rename to plugins/wazo_snom/common/templates/D375.tpl diff --git a/plugins/wazo-snom/common/templates/D385.tpl b/plugins/wazo_snom/common/templates/D385.tpl similarity index 100% rename from plugins/wazo-snom/common/templates/D385.tpl rename to plugins/wazo_snom/common/templates/D385.tpl diff --git a/plugins/wazo-snom/common/templates/D712.tpl b/plugins/wazo_snom/common/templates/D712.tpl similarity index 100% rename from plugins/wazo-snom/common/templates/D712.tpl rename to plugins/wazo_snom/common/templates/D712.tpl diff --git a/plugins/wazo-snom/common/templates/D713.tpl b/plugins/wazo_snom/common/templates/D713.tpl similarity index 100% rename from plugins/wazo-snom/common/templates/D713.tpl rename to plugins/wazo_snom/common/templates/D713.tpl diff --git a/plugins/wazo-snom/common/templates/D717.tpl b/plugins/wazo_snom/common/templates/D717.tpl similarity index 100% rename from plugins/wazo-snom/common/templates/D717.tpl rename to plugins/wazo_snom/common/templates/D717.tpl diff --git a/plugins/wazo-snom/common/templates/D735.tpl b/plugins/wazo_snom/common/templates/D735.tpl similarity index 100% rename from plugins/wazo-snom/common/templates/D735.tpl rename to plugins/wazo_snom/common/templates/D735.tpl diff --git a/plugins/wazo-snom/common/templates/D745.tpl b/plugins/wazo_snom/common/templates/D745.tpl similarity index 100% rename from plugins/wazo-snom/common/templates/D745.tpl rename to plugins/wazo_snom/common/templates/D745.tpl diff --git a/plugins/wazo-snom/common/templates/D765.tpl b/plugins/wazo_snom/common/templates/D765.tpl similarity index 100% rename from plugins/wazo-snom/common/templates/D765.tpl rename to plugins/wazo_snom/common/templates/D765.tpl diff --git a/plugins/wazo-snom/common/templates/D785.tpl b/plugins/wazo_snom/common/templates/D785.tpl similarity index 100% rename from plugins/wazo-snom/common/templates/D785.tpl rename to plugins/wazo_snom/common/templates/D785.tpl diff --git a/plugins/wazo-snom/common/templates/D862.tpl b/plugins/wazo_snom/common/templates/D862.tpl similarity index 100% rename from plugins/wazo-snom/common/templates/D862.tpl rename to plugins/wazo_snom/common/templates/D862.tpl diff --git a/plugins/wazo-snom/common/templates/D865.tpl b/plugins/wazo_snom/common/templates/D865.tpl similarity index 100% rename from plugins/wazo-snom/common/templates/D865.tpl rename to plugins/wazo_snom/common/templates/D865.tpl diff --git a/plugins/wazo-snom/common/templates/MP.tpl b/plugins/wazo_snom/common/templates/MP.tpl similarity index 100% rename from plugins/wazo-snom/common/templates/MP.tpl rename to plugins/wazo_snom/common/templates/MP.tpl diff --git a/plugins/wazo-snom/common/templates/PA1.tpl b/plugins/wazo_snom/common/templates/PA1.tpl similarity index 100% rename from plugins/wazo-snom/common/templates/PA1.tpl rename to plugins/wazo_snom/common/templates/PA1.tpl diff --git a/plugins/wazo-snom/common/templates/base.tpl b/plugins/wazo_snom/common/templates/base.tpl similarity index 100% rename from plugins/wazo-snom/common/templates/base.tpl rename to plugins/wazo_snom/common/templates/base.tpl diff --git a/plugins/wazo-snom/common/templates/common/gui_lang.xml.tpl b/plugins/wazo_snom/common/templates/common/gui_lang.xml.tpl similarity index 100% rename from plugins/wazo-snom/common/templates/common/gui_lang.xml.tpl rename to plugins/wazo_snom/common/templates/common/gui_lang.xml.tpl diff --git a/plugins/wazo-snom/common/templates/common/snom-model-firmware.xml.tpl.btpl b/plugins/wazo_snom/common/templates/common/snom-model-firmware.xml.tpl.btpl similarity index 100% rename from plugins/wazo-snom/common/templates/common/snom-model-firmware.xml.tpl.btpl rename to plugins/wazo_snom/common/templates/common/snom-model-firmware.xml.tpl.btpl diff --git a/plugins/wazo-snom/common/templates/common/snom-model.htm.tpl.btpl b/plugins/wazo_snom/common/templates/common/snom-model.htm.tpl.btpl similarity index 100% rename from plugins/wazo-snom/common/templates/common/snom-model.htm.tpl.btpl rename to plugins/wazo_snom/common/templates/common/snom-model.htm.tpl.btpl diff --git a/plugins/wazo-snom/common/templates/common/snom-model.xml.tpl.btpl b/plugins/wazo_snom/common/templates/common/snom-model.xml.tpl.btpl similarity index 100% rename from plugins/wazo-snom/common/templates/common/snom-model.xml.tpl.btpl rename to plugins/wazo_snom/common/templates/common/snom-model.xml.tpl.btpl diff --git a/plugins/wazo-snom/common/templates/common/web_lang.xml.tpl b/plugins/wazo_snom/common/templates/common/web_lang.xml.tpl similarity index 100% rename from plugins/wazo-snom/common/templates/common/web_lang.xml.tpl rename to plugins/wazo_snom/common/templates/common/web_lang.xml.tpl diff --git a/plugins/wazo-snom/common/templates/other/base.htm.tpl b/plugins/wazo_snom/common/templates/other/base.htm.tpl similarity index 100% rename from plugins/wazo-snom/common/templates/other/base.htm.tpl rename to plugins/wazo_snom/common/templates/other/base.htm.tpl diff --git a/plugins/wazo-snom/common/var/tftpboot/snom-general.xml b/plugins/wazo_snom/common/var/tftpboot/snom-general.xml similarity index 100% rename from plugins/wazo-snom/common/var/tftpboot/snom-general.xml rename to plugins/wazo_snom/common/var/tftpboot/snom-general.xml diff --git a/plugins/wazo-snom/common_dect/common.py b/plugins/wazo_snom/common_dect/common.py similarity index 99% rename from plugins/wazo-snom/common_dect/common.py rename to plugins/wazo_snom/common_dect/common.py index 7e571367ef19c7d36a8e5b3a7c823231e1572000..3871fadcd0ebf789bac3e0f8651fa466a78c14ff 100644 --- a/plugins/wazo-snom/common_dect/common.py +++ b/plugins/wazo_snom/common_dect/common.py @@ -151,6 +151,7 @@ class BaseSnomPlugin(StandardPlugin): yield tpl_format % model, file_format % model def configure_common(self, raw_config): + self._add_server_url(raw_config) for tpl_filename, filename in self._common_templates(): tpl = self._tpl_helper.get_template(tpl_filename) dst = os.path.join(self._tftpboot_dir, filename) diff --git a/plugins/wazo-snom/common_dect/templates/M300.tpl b/plugins/wazo_snom/common_dect/templates/M300.tpl similarity index 100% rename from plugins/wazo-snom/common_dect/templates/M300.tpl rename to plugins/wazo_snom/common_dect/templates/M300.tpl diff --git a/plugins/wazo-snom/common_dect/templates/M700.tpl b/plugins/wazo_snom/common_dect/templates/M700.tpl similarity index 100% rename from plugins/wazo-snom/common_dect/templates/M700.tpl rename to plugins/wazo_snom/common_dect/templates/M700.tpl diff --git a/plugins/wazo-snom/common_dect/templates/M900.tpl b/plugins/wazo_snom/common_dect/templates/M900.tpl similarity index 100% rename from plugins/wazo-snom/common_dect/templates/M900.tpl rename to plugins/wazo_snom/common_dect/templates/M900.tpl diff --git a/plugins/wazo-snom/common_dect/templates/base.tpl b/plugins/wazo_snom/common_dect/templates/base.tpl similarity index 100% rename from plugins/wazo-snom/common_dect/templates/base.tpl rename to plugins/wazo_snom/common_dect/templates/base.tpl diff --git a/plugins/wazo-snom/common_dect/templates/common/snom-general.xml.tpl b/plugins/wazo_snom/common_dect/templates/common/snom-general.xml.tpl similarity index 100% rename from plugins/wazo-snom/common_dect/templates/common/snom-general.xml.tpl rename to plugins/wazo_snom/common_dect/templates/common/snom-general.xml.tpl diff --git a/plugins/wazo-snom/common_dect/templates/common/snom-model-firmware.xml.tpl.btpl b/plugins/wazo_snom/common_dect/templates/common/snom-model-firmware.xml.tpl.btpl similarity index 100% rename from plugins/wazo-snom/common_dect/templates/common/snom-model-firmware.xml.tpl.btpl rename to plugins/wazo_snom/common_dect/templates/common/snom-model-firmware.xml.tpl.btpl diff --git a/plugins/wazo-snom/common_dect/templates/common/snom-model.htm.tpl.btpl b/plugins/wazo_snom/common_dect/templates/common/snom-model.htm.tpl.btpl similarity index 100% rename from plugins/wazo-snom/common_dect/templates/common/snom-model.htm.tpl.btpl rename to plugins/wazo_snom/common_dect/templates/common/snom-model.htm.tpl.btpl diff --git a/plugins/wazo-snom/common_dect/templates/common/snom-model.xml.tpl.btpl b/plugins/wazo_snom/common_dect/templates/common/snom-model.xml.tpl.btpl similarity index 100% rename from plugins/wazo-snom/common_dect/templates/common/snom-model.xml.tpl.btpl rename to plugins/wazo_snom/common_dect/templates/common/snom-model.xml.tpl.btpl diff --git a/plugins/wazo-snom/common_dect/templates/other/base.htm.tpl b/plugins/wazo_snom/common_dect/templates/other/base.htm.tpl similarity index 100% rename from plugins/wazo-snom/common_dect/templates/other/base.htm.tpl rename to plugins/wazo_snom/common_dect/templates/other/base.htm.tpl diff --git a/plugins/wazo-snom/tools/generate_pkgs-db.sh b/plugins/wazo_snom/tools/generate_pkgs-db.sh similarity index 100% rename from plugins/wazo-snom/tools/generate_pkgs-db.sh rename to plugins/wazo_snom/tools/generate_pkgs-db.sh diff --git a/plugins/wazo-snom/05.20.0001/entry.py b/plugins/wazo_snom/v05_20_0001/entry.py similarity index 100% rename from plugins/wazo-snom/05.20.0001/entry.py rename to plugins/wazo_snom/v05_20_0001/entry.py diff --git a/plugins/wazo-snom/05.20.0001/install.md b/plugins/wazo_snom/v05_20_0001/install.md similarity index 100% rename from plugins/wazo-snom/05.20.0001/install.md rename to plugins/wazo_snom/v05_20_0001/install.md diff --git a/plugins/wazo-snom/05.20.0001/limitations.md b/plugins/wazo_snom/v05_20_0001/limitations.md similarity index 100% rename from plugins/wazo-snom/05.20.0001/limitations.md rename to plugins/wazo_snom/v05_20_0001/limitations.md diff --git a/plugins/wazo-snom/05.20.0001/pkgs/pkgs.db b/plugins/wazo_snom/v05_20_0001/pkgs/pkgs.db similarity index 100% rename from plugins/wazo-snom/05.20.0001/pkgs/pkgs.db rename to plugins/wazo_snom/v05_20_0001/pkgs/pkgs.db diff --git a/plugins/wazo-snom/05.20.0001/plugin-info b/plugins/wazo_snom/v05_20_0001/plugin-info similarity index 97% rename from plugins/wazo-snom/05.20.0001/plugin-info rename to plugins/wazo_snom/v05_20_0001/plugin-info index b2208352098b407d2c2cb21d6ddcc6f4628a2463..c2921889b3a86ea8130792918b702d744d06622f 100644 --- a/plugins/wazo-snom/05.20.0001/plugin-info +++ b/plugins/wazo_snom/v05_20_0001/plugin-info @@ -1,5 +1,5 @@ { - "version": "0.1.3", + "version": "0.1.4", "description": "Plugin for Snom M300, M700 and M900 in version 05.20.0001", "description_fr": "Greffon pour Snom M300, M700 et M900 en version 05.20.0001", "capabilities": { diff --git a/plugins/wazo-snom/10.1.101.11/entry.py b/plugins/wazo_snom/v10_1_101_11/entry.py similarity index 100% rename from plugins/wazo-snom/10.1.101.11/entry.py rename to plugins/wazo_snom/v10_1_101_11/entry.py diff --git a/plugins/wazo-snom/10.1.101.11/pkgs/pkgs.db b/plugins/wazo_snom/v10_1_101_11/pkgs/pkgs.db similarity index 100% rename from plugins/wazo-snom/10.1.101.11/pkgs/pkgs.db rename to plugins/wazo_snom/v10_1_101_11/pkgs/pkgs.db diff --git a/plugins/wazo-snom/10.1.101.11/plugin-info b/plugins/wazo_snom/v10_1_101_11/plugin-info similarity index 99% rename from plugins/wazo-snom/10.1.101.11/plugin-info rename to plugins/wazo_snom/v10_1_101_11/plugin-info index 2476f63185a0657ca737dce16aff7e1f653a5ff6..2846407b08b133a7545ca51719395a6682c7c7a2 100644 --- a/plugins/wazo-snom/10.1.101.11/plugin-info +++ b/plugins/wazo_snom/v10_1_101_11/plugin-info @@ -1,5 +1,5 @@ { - "version": "0.7.3", + "version": "0.7.4", "description": "Plugin for Snom D3x5, D712, D717, D7x5 in version 10.1.101.11", "description_fr": "Greffon pour Snom D3x5, D712, D717, D7x5 en version 10.1.101.11", "capabilities": { diff --git a/plugins/wazo-snom/10.1.141.13/entry.py b/plugins/wazo_snom/v10_1_141_13/entry.py similarity index 100% rename from plugins/wazo-snom/10.1.141.13/entry.py rename to plugins/wazo_snom/v10_1_141_13/entry.py diff --git a/plugins/wazo-snom/10.1.141.13/pkgs/pkgs.db b/plugins/wazo_snom/v10_1_141_13/pkgs/pkgs.db similarity index 100% rename from plugins/wazo-snom/10.1.141.13/pkgs/pkgs.db rename to plugins/wazo_snom/v10_1_141_13/pkgs/pkgs.db diff --git a/plugins/wazo-snom/10.1.141.13/plugin-info b/plugins/wazo_snom/v10_1_141_13/plugin-info similarity index 99% rename from plugins/wazo-snom/10.1.141.13/plugin-info rename to plugins/wazo_snom/v10_1_141_13/plugin-info index 7a54215584c4fe7751e237570a35e3c21396b7c2..426037e844390bba55b04049356784496c61295a 100644 --- a/plugins/wazo-snom/10.1.141.13/plugin-info +++ b/plugins/wazo_snom/v10_1_141_13/plugin-info @@ -1,5 +1,5 @@ { - "version": "0.7.4", + "version": "0.7.5", "description": "Plugin for Snom D3x5, D71x, D7x5, D86x in version 10.1.141.13", "description_fr": "Greffon pour Snom D3x5, D71x, D7x5, D86x en version 10.1.141.13", "capabilities": { diff --git a/plugins/wazo-snom/10.1.152.12/entry.py b/plugins/wazo_snom/v10_1_152_12/entry.py similarity index 100% rename from plugins/wazo-snom/10.1.152.12/entry.py rename to plugins/wazo_snom/v10_1_152_12/entry.py diff --git a/plugins/wazo-snom/10.1.152.12/pkgs/pkgs.db b/plugins/wazo_snom/v10_1_152_12/pkgs/pkgs.db similarity index 100% rename from plugins/wazo-snom/10.1.152.12/pkgs/pkgs.db rename to plugins/wazo_snom/v10_1_152_12/pkgs/pkgs.db diff --git a/plugins/wazo-snom/10.1.152.12/plugin-info b/plugins/wazo_snom/v10_1_152_12/plugin-info similarity index 99% rename from plugins/wazo-snom/10.1.152.12/plugin-info rename to plugins/wazo_snom/v10_1_152_12/plugin-info index 88d7d5242827bd2875ff15be8660367ea0818b9a..9a101bc0fcfc487ae37840170d213637cef5369f 100644 --- a/plugins/wazo-snom/10.1.152.12/plugin-info +++ b/plugins/wazo_snom/v10_1_152_12/plugin-info @@ -1,5 +1,5 @@ { - "version": "0.7.5", + "version": "0.7.6", "description": "Plugin for Snom D3x5, D71x, D7x5, D86x in version 10.1.152.12", "description_fr": "Greffon pour Snom D3x5, D71x, D7x5, D86x en version 10.1.152.12", "capabilities": { diff --git a/plugins/wazo-snom/10.1.20.0/entry.py b/plugins/wazo_snom/v10_1_20_0/entry.py similarity index 100% rename from plugins/wazo-snom/10.1.20.0/entry.py rename to plugins/wazo_snom/v10_1_20_0/entry.py diff --git a/plugins/wazo-snom/10.1.20.0/pkgs/pkgs.db b/plugins/wazo_snom/v10_1_20_0/pkgs/pkgs.db similarity index 100% rename from plugins/wazo-snom/10.1.20.0/pkgs/pkgs.db rename to plugins/wazo_snom/v10_1_20_0/pkgs/pkgs.db diff --git a/plugins/wazo-snom/10.1.20.0/plugin-info b/plugins/wazo_snom/v10_1_20_0/plugin-info similarity index 94% rename from plugins/wazo-snom/10.1.20.0/plugin-info rename to plugins/wazo_snom/v10_1_20_0/plugin-info index 3de26c0901ab9e568af223ab3e62c1850973c064..5adc6daf3e9f1a258b2f9952d8952990ce5b324c 100644 --- a/plugins/wazo-snom/10.1.20.0/plugin-info +++ b/plugins/wazo_snom/v10_1_20_0/plugin-info @@ -1,5 +1,5 @@ { - "version": "0.2.1", + "version": "0.2.2", "description": "Plugin for Snom D785 in version 10.1.20.0.", "description_fr": "Greffon pour Snom série D785 en version 10.1.20.0.", "capabilities": { diff --git a/plugins/wazo-snom/10.1.26.1/entry.py b/plugins/wazo_snom/v10_1_26_1/entry.py similarity index 100% rename from plugins/wazo-snom/10.1.26.1/entry.py rename to plugins/wazo_snom/v10_1_26_1/entry.py diff --git a/plugins/wazo-snom/10.1.26.1/pkgs/pkgs.db b/plugins/wazo_snom/v10_1_26_1/pkgs/pkgs.db similarity index 100% rename from plugins/wazo-snom/10.1.26.1/pkgs/pkgs.db rename to plugins/wazo_snom/v10_1_26_1/pkgs/pkgs.db diff --git a/plugins/wazo-snom/10.1.26.1/plugin-info b/plugins/wazo_snom/v10_1_26_1/plugin-info similarity index 94% rename from plugins/wazo-snom/10.1.26.1/plugin-info rename to plugins/wazo_snom/v10_1_26_1/plugin-info index 6bde1b081e0aeb50c278ef256f8f19766c51d4c2..969549d6ef5a0afd5278f10dd3c15b4d799fdd4b 100644 --- a/plugins/wazo-snom/10.1.26.1/plugin-info +++ b/plugins/wazo_snom/v10_1_26_1/plugin-info @@ -1,5 +1,5 @@ { - "version": "0.2.2", + "version": "0.2.3", "description": "Plugin for Snom D735 in version 10.1.26.1.", "description_fr": "Greffon pour Snom série D735 en version 10.1.26.1.", "capabilities": { diff --git a/plugins/wazo-snom/10.1.39.11/entry.py b/plugins/wazo_snom/v10_1_39_11/entry.py similarity index 100% rename from plugins/wazo-snom/10.1.39.11/entry.py rename to plugins/wazo_snom/v10_1_39_11/entry.py diff --git a/plugins/wazo-snom/10.1.39.11/pkgs/pkgs.db b/plugins/wazo_snom/v10_1_39_11/pkgs/pkgs.db similarity index 100% rename from plugins/wazo-snom/10.1.39.11/pkgs/pkgs.db rename to plugins/wazo_snom/v10_1_39_11/pkgs/pkgs.db diff --git a/plugins/wazo-snom/10.1.39.11/plugin-info b/plugins/wazo_snom/v10_1_39_11/plugin-info similarity index 99% rename from plugins/wazo-snom/10.1.39.11/plugin-info rename to plugins/wazo_snom/v10_1_39_11/plugin-info index 1ce70e3afb6b5dce8cf95e36829f69fe594a869e..72a8ff3d311a2e110a7e163e016bb801125010ad 100644 --- a/plugins/wazo-snom/10.1.39.11/plugin-info +++ b/plugins/wazo_snom/v10_1_39_11/plugin-info @@ -1,5 +1,5 @@ { - "version": "0.2.5", + "version": "0.2.6", "description": "Plugin for Snom D3x5, D717, D7x5 in version 10.1.39.11.", "description_fr": "Greffon pour Snom D3x5, D717, D7x5 en version 10.1.39.11.", "capabilities": { diff --git a/plugins/wazo-snom/10.1.46.16/entry.py b/plugins/wazo_snom/v10_1_46_16/entry.py similarity index 100% rename from plugins/wazo-snom/10.1.46.16/entry.py rename to plugins/wazo_snom/v10_1_46_16/entry.py diff --git a/plugins/wazo-snom/10.1.46.16/pkgs/pkgs.db b/plugins/wazo_snom/v10_1_46_16/pkgs/pkgs.db similarity index 100% rename from plugins/wazo-snom/10.1.46.16/pkgs/pkgs.db rename to plugins/wazo_snom/v10_1_46_16/pkgs/pkgs.db diff --git a/plugins/wazo-snom/10.1.46.16/plugin-info b/plugins/wazo_snom/v10_1_46_16/plugin-info similarity index 99% rename from plugins/wazo-snom/10.1.46.16/plugin-info rename to plugins/wazo_snom/v10_1_46_16/plugin-info index 65f9b50b2dc2f2d3cf8414f7e2f54cbd672498c4..6602467939baccc6b45c9174deb30504c38fd36a 100644 --- a/plugins/wazo-snom/10.1.46.16/plugin-info +++ b/plugins/wazo_snom/v10_1_46_16/plugin-info @@ -1,5 +1,5 @@ { - "version": "0.3.5", + "version": "0.3.6", "description": "Plugin for Snom D3x5, D717, D7x5 in version 10.1.46.16", "description_fr": "Greffon pour Snom D3x5, D717, D7x5 en version 10.1.46.16", "capabilities": { diff --git a/plugins/wazo-snom/10.1.49.11/entry.py b/plugins/wazo_snom/v10_1_49_11/entry.py similarity index 100% rename from plugins/wazo-snom/10.1.49.11/entry.py rename to plugins/wazo_snom/v10_1_49_11/entry.py diff --git a/plugins/wazo-snom/10.1.49.11/pkgs/pkgs.db b/plugins/wazo_snom/v10_1_49_11/pkgs/pkgs.db similarity index 100% rename from plugins/wazo-snom/10.1.49.11/pkgs/pkgs.db rename to plugins/wazo_snom/v10_1_49_11/pkgs/pkgs.db diff --git a/plugins/wazo-snom/10.1.49.11/plugin-info b/plugins/wazo_snom/v10_1_49_11/plugin-info similarity index 99% rename from plugins/wazo-snom/10.1.49.11/plugin-info rename to plugins/wazo_snom/v10_1_49_11/plugin-info index 917bcbf28057ac186f1767d89f1247771499a1da..aaeb87877824120bfd0f0dd6d0acca5ddd6f515b 100644 --- a/plugins/wazo-snom/10.1.49.11/plugin-info +++ b/plugins/wazo_snom/v10_1_49_11/plugin-info @@ -1,5 +1,5 @@ { - "version": "0.4.5", + "version": "0.4.6", "description": "Plugin for Snom D3x5, D717, D7x5 in version 10.1.49.11", "description_fr": "Greffon pour Snom D3x5, D717, D7x5 en version 10.1.49.11", "capabilities": { diff --git a/plugins/wazo-snom/10.1.51.12/entry.py b/plugins/wazo_snom/v10_1_51_12/entry.py similarity index 100% rename from plugins/wazo-snom/10.1.51.12/entry.py rename to plugins/wazo_snom/v10_1_51_12/entry.py diff --git a/plugins/wazo-snom/10.1.51.12/pkgs/pkgs.db b/plugins/wazo_snom/v10_1_51_12/pkgs/pkgs.db similarity index 100% rename from plugins/wazo-snom/10.1.51.12/pkgs/pkgs.db rename to plugins/wazo_snom/v10_1_51_12/pkgs/pkgs.db diff --git a/plugins/wazo-snom/10.1.51.12/plugin-info b/plugins/wazo_snom/v10_1_51_12/plugin-info similarity index 99% rename from plugins/wazo-snom/10.1.51.12/plugin-info rename to plugins/wazo_snom/v10_1_51_12/plugin-info index cecc54a9834e07c5ddd28cc6bfb9f6964092acbf..cd6d34e4f093a0c34d57be9d402f886f51bc338a 100644 --- a/plugins/wazo-snom/10.1.51.12/plugin-info +++ b/plugins/wazo_snom/v10_1_51_12/plugin-info @@ -1,5 +1,5 @@ { - "version": "0.5.5", + "version": "0.5.6", "description": "Plugin for Snom D3x5, D717, D7x5 in version 10.1.51.12", "description_fr": "Greffon pour Snom D3x5, D717, D7x5 en version 10.1.51.12", "capabilities": { diff --git a/plugins/wazo-snom/10.1.54.13/entry.py b/plugins/wazo_snom/v10_1_54_13/entry.py similarity index 100% rename from plugins/wazo-snom/10.1.54.13/entry.py rename to plugins/wazo_snom/v10_1_54_13/entry.py diff --git a/plugins/wazo-snom/10.1.54.13/pkgs/pkgs.db b/plugins/wazo_snom/v10_1_54_13/pkgs/pkgs.db similarity index 100% rename from plugins/wazo-snom/10.1.54.13/pkgs/pkgs.db rename to plugins/wazo_snom/v10_1_54_13/pkgs/pkgs.db diff --git a/plugins/wazo-snom/10.1.54.13/plugin-info b/plugins/wazo_snom/v10_1_54_13/plugin-info similarity index 99% rename from plugins/wazo-snom/10.1.54.13/plugin-info rename to plugins/wazo_snom/v10_1_54_13/plugin-info index fada525441756ee1ac231bea9c248675347830b0..ebac715bfa3fd492103d60df2aec6ab90093a5bb 100644 --- a/plugins/wazo-snom/10.1.54.13/plugin-info +++ b/plugins/wazo_snom/v10_1_54_13/plugin-info @@ -1,5 +1,5 @@ { - "version": "0.6.5", + "version": "0.6.6", "description": "Plugin for Snom D3x5, D717, D7x5 in version 10.1.54.13", "description_fr": "Greffon pour Snom D3x5, D717, D7x5 en version 10.1.54.13", "capabilities": { diff --git a/plugins/wazo-snom/8.7.5.35/entry.py b/plugins/wazo_snom/v8_7_5_35/entry.py similarity index 100% rename from plugins/wazo-snom/8.7.5.35/entry.py rename to plugins/wazo_snom/v8_7_5_35/entry.py diff --git a/plugins/wazo-snom/8.7.5.35/pkgs/pkgs.db b/plugins/wazo_snom/v8_7_5_35/pkgs/pkgs.db similarity index 100% rename from plugins/wazo-snom/8.7.5.35/pkgs/pkgs.db rename to plugins/wazo_snom/v8_7_5_35/pkgs/pkgs.db diff --git a/plugins/wazo-snom/8.7.5.35/plugin-info b/plugins/wazo_snom/v8_7_5_35/plugin-info similarity index 99% rename from plugins/wazo-snom/8.7.5.35/plugin-info rename to plugins/wazo_snom/v8_7_5_35/plugin-info index 7079b783c03b0fd39c8bf0b60e9d48c676c21815..65a45e6746cf62f502168b4577cc093f0540fdf8 100644 --- a/plugins/wazo-snom/8.7.5.35/plugin-info +++ b/plugins/wazo_snom/v8_7_5_35/plugin-info @@ -1,5 +1,5 @@ { - "version": "1.8.9", + "version": "1.8.10", "description": "Plugin for Snom 300, 320, 370, 710/D710, 715/D715, 720, D725, 760, D765, 820, 821, 870, MP and PA1 in version 8.7.5.35.", "description_fr": "Greffon pour Snom 300, 320, 370, 710/D710, 715/D715, 720, D725, 760, D765, 820, 821, 870, MP et PA1 en version 8.7.5.35.", "capabilities": { diff --git a/plugins/wazo-snom/8.9.3.40/entry.py b/plugins/wazo_snom/v8_9_3_40/entry.py similarity index 100% rename from plugins/wazo-snom/8.9.3.40/entry.py rename to plugins/wazo_snom/v8_9_3_40/entry.py diff --git a/plugins/wazo-snom/8.9.3.40/pkgs/pkgs.db b/plugins/wazo_snom/v8_9_3_40/pkgs/pkgs.db similarity index 100% rename from plugins/wazo-snom/8.9.3.40/pkgs/pkgs.db rename to plugins/wazo_snom/v8_9_3_40/pkgs/pkgs.db diff --git a/plugins/wazo-snom/8.9.3.40/plugin-info b/plugins/wazo_snom/v8_9_3_40/plugin-info similarity index 94% rename from plugins/wazo-snom/8.9.3.40/plugin-info rename to plugins/wazo_snom/v8_9_3_40/plugin-info index afb1e9470b4b1f93ff301e861a46eb337c644742..9b5a440ea2a1cfc70908d2c58fb7398e16117f62 100644 --- a/plugins/wazo-snom/8.9.3.40/plugin-info +++ b/plugins/wazo_snom/v8_9_3_40/plugin-info @@ -1,5 +1,5 @@ { - "version": "1.7.8", + "version": "1.7.9", "description": "Plugin for Snom D745 in version 8.9.3.40.", "description_fr": "Greffon pour Snom D745 en version 8.9.3.40.", "capabilities": { diff --git a/plugins/wazo-snom/8.9.3.40/var/cache/snomlang_8.9.3.xivo.zip b/plugins/wazo_snom/v8_9_3_40/var/cache/snomlang_8.9.3.xivo.zip similarity index 100% rename from plugins/wazo-snom/8.9.3.40/var/cache/snomlang_8.9.3.xivo.zip rename to plugins/wazo_snom/v8_9_3_40/var/cache/snomlang_8.9.3.xivo.zip diff --git a/plugins/wazo-snom/8.9.3.60/entry.py b/plugins/wazo_snom/v8_9_3_60/entry.py similarity index 100% rename from plugins/wazo-snom/8.9.3.60/entry.py rename to plugins/wazo_snom/v8_9_3_60/entry.py diff --git a/plugins/wazo-snom/8.9.3.60/pkgs/pkgs.db b/plugins/wazo_snom/v8_9_3_60/pkgs/pkgs.db similarity index 100% rename from plugins/wazo-snom/8.9.3.60/pkgs/pkgs.db rename to plugins/wazo_snom/v8_9_3_60/pkgs/pkgs.db diff --git a/plugins/wazo-snom/8.9.3.60/plugin-info b/plugins/wazo_snom/v8_9_3_60/plugin-info similarity index 98% rename from plugins/wazo-snom/8.9.3.60/plugin-info rename to plugins/wazo_snom/v8_9_3_60/plugin-info index 34955b02858accad1246d582b5206cb3a179d91f..ba864d703a5973666fde3f99fd1403a488e3a904 100644 --- a/plugins/wazo-snom/8.9.3.60/plugin-info +++ b/plugins/wazo_snom/v8_9_3_60/plugin-info @@ -1,5 +1,5 @@ { - "version": "0.1.8", + "version": "0.1.9", "description": "Plugin for Snom D305, D315, D345 and D375 in version 8.9.3.60.", "description_fr": "Greffon pour Snom D305, D315, D345 and D375 en version 8.9.3.60.", "capabilities": { diff --git a/plugins/wazo-snom/8.9.3.60/var/cache/snomlang_8.9.3.xivo.zip b/plugins/wazo_snom/v8_9_3_60/var/cache/snomlang_8.9.3.xivo.zip similarity index 100% rename from plugins/wazo-snom/8.9.3.60/var/cache/snomlang_8.9.3.xivo.zip rename to plugins/wazo_snom/v8_9_3_60/var/cache/snomlang_8.9.3.xivo.zip diff --git a/plugins/wazo-snom/8.9.3.80/entry.py b/plugins/wazo_snom/v8_9_3_80/entry.py similarity index 100% rename from plugins/wazo-snom/8.9.3.80/entry.py rename to plugins/wazo_snom/v8_9_3_80/entry.py diff --git a/plugins/wazo-snom/8.9.3.80/pkgs/pkgs.db b/plugins/wazo_snom/v8_9_3_80/pkgs/pkgs.db similarity index 100% rename from plugins/wazo-snom/8.9.3.80/pkgs/pkgs.db rename to plugins/wazo_snom/v8_9_3_80/pkgs/pkgs.db diff --git a/plugins/wazo-snom/8.9.3.80/plugin-info b/plugins/wazo_snom/v8_9_3_80/plugin-info similarity index 99% rename from plugins/wazo-snom/8.9.3.80/plugin-info rename to plugins/wazo_snom/v8_9_3_80/plugin-info index 0cfcaeffd0d8d519c83fcdb11e2ab1af6af54871..6ed46fe89aee2e2fb0a17db521de017304876396 100644 --- a/plugins/wazo-snom/8.9.3.80/plugin-info +++ b/plugins/wazo_snom/v8_9_3_80/plugin-info @@ -1,5 +1,5 @@ { - "version": "0.2.8", + "version": "0.2.9", "description": "Plugin for Snom D3x5, D7x5, D7x0 series in version 8.9.3.80.", "description_fr": "Greffon pour Snom séries D3x5; D7x5 et D7x0 en version 8.9.3.80.", "capabilities": { diff --git a/plugins/wazo-snom/8.9.3.80/var/cache/snomlang_8.9.3.xivo.zip b/plugins/wazo_snom/v8_9_3_80/var/cache/snomlang_8.9.3.xivo.zip similarity index 100% rename from plugins/wazo-snom/8.9.3.80/var/cache/snomlang_8.9.3.xivo.zip rename to plugins/wazo_snom/v8_9_3_80/var/cache/snomlang_8.9.3.xivo.zip diff --git a/plugins/wazo-technicolor/ST2022-4.78.1/entry.py b/plugins/wazo_technicolor/ST2022_v4_78_1/entry.py similarity index 100% rename from plugins/wazo-technicolor/ST2022-4.78.1/entry.py rename to plugins/wazo_technicolor/ST2022_v4_78_1/entry.py diff --git a/plugins/wazo-technicolor/ST2022-4.78.1/pkgs/pkgs.db b/plugins/wazo_technicolor/ST2022_v4_78_1/pkgs/pkgs.db similarity index 100% rename from plugins/wazo-technicolor/ST2022-4.78.1/pkgs/pkgs.db rename to plugins/wazo_technicolor/ST2022_v4_78_1/pkgs/pkgs.db diff --git a/plugins/wazo-technicolor/ST2022-4.78.1/plugin-info b/plugins/wazo_technicolor/ST2022_v4_78_1/plugin-info similarity index 100% rename from plugins/wazo-technicolor/ST2022-4.78.1/plugin-info rename to plugins/wazo_technicolor/ST2022_v4_78_1/plugin-info diff --git a/plugins/wazo-technicolor/ST2022-4.78.1/templates/common/ST2022S.inf.tpl b/plugins/wazo_technicolor/ST2022_v4_78_1/templates/common/ST2022S.inf.tpl similarity index 100% rename from plugins/wazo-technicolor/ST2022-4.78.1/templates/common/ST2022S.inf.tpl rename to plugins/wazo_technicolor/ST2022_v4_78_1/templates/common/ST2022S.inf.tpl diff --git a/plugins/wazo-technicolor/ST2022-4.78.1/var/tftpboot/comconf-4.78.1-1.txt b/plugins/wazo_technicolor/ST2022_v4_78_1/var/tftpboot/comconf-4.78.1-1.txt similarity index 100% rename from plugins/wazo-technicolor/ST2022-4.78.1/var/tftpboot/comconf-4.78.1-1.txt rename to plugins/wazo_technicolor/ST2022_v4_78_1/var/tftpboot/comconf-4.78.1-1.txt diff --git a/plugins/wazo-technicolor/ST2022-4.78.1/var/tftpboot/telconf-4.78.1-1.txt b/plugins/wazo_technicolor/ST2022_v4_78_1/var/tftpboot/telconf-4.78.1-1.txt similarity index 100% rename from plugins/wazo-technicolor/ST2022-4.78.1/var/tftpboot/telconf-4.78.1-1.txt rename to plugins/wazo_technicolor/ST2022_v4_78_1/var/tftpboot/telconf-4.78.1-1.txt diff --git a/plugins/wazo-technicolor/ST2030-2.74/entry.py b/plugins/wazo_technicolor/ST2030_v2_74/entry.py similarity index 100% rename from plugins/wazo-technicolor/ST2030-2.74/entry.py rename to plugins/wazo_technicolor/ST2030_v2_74/entry.py diff --git a/plugins/wazo-technicolor/ST2030-2.74/pkgs/pkgs.db b/plugins/wazo_technicolor/ST2030_v2_74/pkgs/pkgs.db similarity index 100% rename from plugins/wazo-technicolor/ST2030-2.74/pkgs/pkgs.db rename to plugins/wazo_technicolor/ST2030_v2_74/pkgs/pkgs.db diff --git a/plugins/wazo-technicolor/ST2030-2.74/plugin-info b/plugins/wazo_technicolor/ST2030_v2_74/plugin-info similarity index 100% rename from plugins/wazo-technicolor/ST2030-2.74/plugin-info rename to plugins/wazo_technicolor/ST2030_v2_74/plugin-info diff --git a/plugins/wazo-technicolor/ST2030-2.74/templates/common/ST2030S.inf.tpl b/plugins/wazo_technicolor/ST2030_v2_74/templates/common/ST2030S.inf.tpl similarity index 100% rename from plugins/wazo-technicolor/ST2030-2.74/templates/common/ST2030S.inf.tpl rename to plugins/wazo_technicolor/ST2030_v2_74/templates/common/ST2030S.inf.tpl diff --git a/plugins/wazo-technicolor/ST2030-2.74/var/tftpboot/comconf-2.74-1.txt b/plugins/wazo_technicolor/ST2030_v2_74/var/tftpboot/comconf-2.74-1.txt similarity index 100% rename from plugins/wazo-technicolor/ST2030-2.74/var/tftpboot/comconf-2.74-1.txt rename to plugins/wazo_technicolor/ST2030_v2_74/var/tftpboot/comconf-2.74-1.txt diff --git a/plugins/wazo-technicolor/ST2030-2.74/var/tftpboot/telconf-2.74-1.txt b/plugins/wazo_technicolor/ST2030_v2_74/var/tftpboot/telconf-2.74-1.txt similarity index 100% rename from plugins/wazo-technicolor/ST2030-2.74/var/tftpboot/telconf-2.74-1.txt rename to plugins/wazo_technicolor/ST2030_v2_74/var/tftpboot/telconf-2.74-1.txt diff --git a/plugins/wazo-technicolor/TB30-1.74.0/entry.py b/plugins/wazo_technicolor/TB30_v1_74_0/entry.py similarity index 100% rename from plugins/wazo-technicolor/TB30-1.74.0/entry.py rename to plugins/wazo_technicolor/TB30_v1_74_0/entry.py diff --git a/plugins/wazo-technicolor/TB30-1.74.0/install.md b/plugins/wazo_technicolor/TB30_v1_74_0/install.md similarity index 100% rename from plugins/wazo-technicolor/TB30-1.74.0/install.md rename to plugins/wazo_technicolor/TB30_v1_74_0/install.md diff --git a/plugins/wazo-technicolor/TB30-1.74.0/pkgs/pkgs.db b/plugins/wazo_technicolor/TB30_v1_74_0/pkgs/pkgs.db similarity index 100% rename from plugins/wazo-technicolor/TB30-1.74.0/pkgs/pkgs.db rename to plugins/wazo_technicolor/TB30_v1_74_0/pkgs/pkgs.db diff --git a/plugins/wazo-technicolor/TB30-1.74.0/plugin-info b/plugins/wazo_technicolor/TB30_v1_74_0/plugin-info similarity index 100% rename from plugins/wazo-technicolor/TB30-1.74.0/plugin-info rename to plugins/wazo_technicolor/TB30_v1_74_0/plugin-info diff --git a/plugins/wazo-technicolor/TB30-1.74.0/templates/common/TB30S.inf.tpl b/plugins/wazo_technicolor/TB30_v1_74_0/templates/common/TB30S.inf.tpl similarity index 100% rename from plugins/wazo-technicolor/TB30-1.74.0/templates/common/TB30S.inf.tpl rename to plugins/wazo_technicolor/TB30_v1_74_0/templates/common/TB30S.inf.tpl diff --git a/plugins/wazo-technicolor/TB30-1.74.0/var/tftpboot/comconf-1.74.0-1.txt b/plugins/wazo_technicolor/TB30_v1_74_0/var/tftpboot/comconf-1.74.0-1.txt similarity index 100% rename from plugins/wazo-technicolor/TB30-1.74.0/var/tftpboot/comconf-1.74.0-1.txt rename to plugins/wazo_technicolor/TB30_v1_74_0/var/tftpboot/comconf-1.74.0-1.txt diff --git a/plugins/wazo-technicolor/TB30-1.74.0/var/tftpboot/telconf-1.74.0-1.txt b/plugins/wazo_technicolor/TB30_v1_74_0/var/tftpboot/telconf-1.74.0-1.txt similarity index 100% rename from plugins/wazo-technicolor/TB30-1.74.0/var/tftpboot/telconf-1.74.0-1.txt rename to plugins/wazo_technicolor/TB30_v1_74_0/var/tftpboot/telconf-1.74.0-1.txt diff --git a/plugins/wazo-technicolor/build.py b/plugins/wazo_technicolor/build.py similarity index 72% rename from plugins/wazo-technicolor/build.py rename to plugins/wazo_technicolor/build.py index 13635053066556c9efe131f8adc937dd5c1f24ba..1911281eccedc858d06ca89feb0d1c98510c0515 100644 --- a/plugins/wazo-technicolor/build.py +++ b/plugins/wazo_technicolor/build.py @@ -1,4 +1,4 @@ -# Copyright (C) 2013-2022 The Wazo Authors (see the AUTHORS file) +# Copyright 2013-2023 The Wazo Authors (see the AUTHORS file) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -15,12 +15,22 @@ # Depends on the following external programs: # -rsync +from __future__ import annotations +from typing import TYPE_CHECKING, Callable from subprocess import check_call +if TYPE_CHECKING: + + def target( + target_id: str, plugin_id: str, std_dirs: bool = True + ) -> Callable[[str], None]: + """The `target` method is injected in `exec` call by the build script.""" + return lambda x: None + @target('ST2022-4.78.1', 'wazo-technicolor-ST2022-4.78.1') -def build_ST2022_4_78_1(path): +def build_ST2022_4_78_1(path: str) -> None: check_call( [ 'rsync', @@ -37,12 +47,11 @@ def build_ST2022_4_78_1(path): path, ] ) - - check_call(['rsync', '-rlp', '--exclude', '.*', 'ST2022-4.78.1/', path]) + check_call(['rsync', '-rlp', '--exclude', '.*', 'ST2022_v4_78_1/', path]) @target('ST2030-2.74', 'wazo-technicolor-ST2030-2.74') -def build_ST2030_2_74(path): +def build_ST2030_2_74(path: str) -> None: check_call( [ 'rsync', @@ -59,12 +68,11 @@ def build_ST2030_2_74(path): path, ] ) - - check_call(['rsync', '-rlp', '--exclude', '.*', 'ST2030-2.74/', path]) + check_call(['rsync', '-rlp', '--exclude', '.*', 'ST2030_v2_74/', path]) @target('TB30-1.74.0', 'wazo-technicolor-TB30-1.74.0') -def build_TB30_1_74_0(path): +def build_TB30_1_74_0(path: str) -> None: check_call( [ 'rsync', @@ -81,5 +89,4 @@ def build_TB30_1_74_0(path): path, ] ) - - check_call(['rsync', '-rlp', '--exclude', '.*', 'TB30-1.74.0/', path]) + check_call(['rsync', '-rlp', '--exclude', '.*', 'TB30_v1_74_0/', path]) diff --git a/plugins/wazo-technicolor/common/common.py b/plugins/wazo_technicolor/common/common.py similarity index 100% rename from plugins/wazo-technicolor/common/common.py rename to plugins/wazo_technicolor/common/common.py diff --git a/plugins/wazo-technicolor/common/templates/ST2022.tpl b/plugins/wazo_technicolor/common/templates/ST2022.tpl similarity index 100% rename from plugins/wazo-technicolor/common/templates/ST2022.tpl rename to plugins/wazo_technicolor/common/templates/ST2022.tpl diff --git a/plugins/wazo-technicolor/common/templates/ST2030.tpl b/plugins/wazo_technicolor/common/templates/ST2030.tpl similarity index 100% rename from plugins/wazo-technicolor/common/templates/ST2030.tpl rename to plugins/wazo_technicolor/common/templates/ST2030.tpl diff --git a/plugins/wazo-technicolor/common/templates/TB30.tpl b/plugins/wazo_technicolor/common/templates/TB30.tpl similarity index 100% rename from plugins/wazo-technicolor/common/templates/TB30.tpl rename to plugins/wazo_technicolor/common/templates/TB30.tpl diff --git a/plugins/wazo-technicolor/common/templates/base.tpl b/plugins/wazo_technicolor/common/templates/base.tpl similarity index 100% rename from plugins/wazo-technicolor/common/templates/base.tpl rename to plugins/wazo_technicolor/common/templates/base.tpl diff --git a/plugins/wazo-yealink/v83/tests/__init__.py b/plugins/wazo_yealink/__init__.py similarity index 100% rename from plugins/wazo-yealink/v83/tests/__init__.py rename to plugins/wazo_yealink/__init__.py diff --git a/plugins/wazo-yealink/build.py b/plugins/wazo_yealink/build.py similarity index 70% rename from plugins/wazo-yealink/build.py rename to plugins/wazo_yealink/build.py index c654a11f9024be99a0ff638bf542e457e1be2b7c..09f9595dd59a9b5135028906d027168c14346147 100644 --- a/plugins/wazo-yealink/build.py +++ b/plugins/wazo_yealink/build.py @@ -1,65 +1,67 @@ """ -Copyright 2013-2022 The Wazo Authors (see the AUTHORS file) +Copyright 2013-2023 The Wazo Authors (see the AUTHORS file) SPDX-License-Identifier: GPL-3.0-or-later Depends on the following external programs: -rsync """ +from __future__ import annotations +from typing import TYPE_CHECKING, Callable from subprocess import check_call +if TYPE_CHECKING: + + def target( + target_id: str, plugin_id: str, std_dirs: bool = True + ) -> Callable[[str], None]: + """The `target` method is injected in `exec` call by the build script.""" + return lambda x: None + @target('v73', 'wazo-yealink-v73') -def build_v73(path): +def build_v73(path: str) -> None: check_call(['rsync', '-rlp', '--exclude', '.*', 'common/', path]) - check_call(['rsync', '-rlp', '--exclude', '.*', 'v73/', path]) @target('v80', 'wazo-yealink-v80') -def build_v80(path): +def build_v80(path: str) -> None: check_call(['rsync', '-rlp', '--exclude', '.*', 'common/', path]) - check_call(['rsync', '-rlp', '--exclude', '.*', 'v80/', path]) @target('v81', 'wazo-yealink-v81') -def build_v81(path): +def build_v81(path: str) -> None: check_call(['rsync', '-rlp', '--exclude', '.*', 'common/', path]) - check_call(['rsync', '-rlp', '--exclude', '.*', 'v81/', path]) @target('v82', 'wazo-yealink-v82') -def build_v82(path): +def build_v82(path: str) -> None: check_call(['rsync', '-rlp', '--exclude', '.*', 'common/', path]) - check_call(['rsync', '-rlp', '--exclude', '.*', 'v82/', path]) @target('v83', 'wazo-yealink-v83') -def build_v83(path): +def build_v83(path: str) -> None: check_call(['rsync', '-rlp', '--exclude', '.*', 'common/', path]) - check_call(['rsync', '-rlp', '--exclude', '.*', 'v83/', path]) @target('v84', 'wazo-yealink-v84') -def build_v84(path): +def build_v84(path: str) -> None: check_call(['rsync', '-rlp', '--exclude', '.*', 'common/', path]) - check_call(['rsync', '-rlp', '--exclude', '.*', 'v84/', path]) @target('v85', 'wazo-yealink-v85') -def build_v85(path): +def build_v85(path: str) -> None: check_call(['rsync', '-rlp', '--exclude', '.*', 'common/', path]) - check_call(['rsync', '-rlp', '--exclude', '.*', 'v85/', path]) @target('v86', 'wazo-yealink-v86') -def build_v86(path): +def build_v86(path: str) -> None: check_call(['rsync', '-rlp', '--exclude', '.*', 'common/', path]) - check_call(['rsync', '-rlp', '--exclude', '.*', 'v86/', path]) diff --git a/plugins/wazo-yealink/common/common.py b/plugins/wazo_yealink/common/common.py similarity index 99% rename from plugins/wazo-yealink/common/common.py rename to plugins/wazo_yealink/common/common.py index f4e15e6fbf226ff1d559cc2a57f55a6f67fb036b..854f7288c52d1bceb9e96af4cd9cccb0822b83c3 100644 --- a/plugins/wazo-yealink/common/common.py +++ b/plugins/wazo_yealink/common/common.py @@ -359,6 +359,7 @@ class BaseYealinkPlugin(StandardPlugin): http_dev_info_extractor = BaseYealinkHTTPDeviceInfoExtractor() def configure_common(self, raw_config): + self._add_server_url(raw_config) for filename, fw_filename, tpl_filename in self._COMMON_FILES: tpl = self._tpl_helper.get_template(f'common/{tpl_filename}') dst = os.path.join(self._tftpboot_dir, filename) diff --git a/plugins/wazo-yealink/common/var/tftpboot/directory_setting.xml b/plugins/wazo_yealink/common/var/tftpboot/directory_setting.xml similarity index 100% rename from plugins/wazo-yealink/common/var/tftpboot/directory_setting.xml rename to plugins/wazo_yealink/common/var/tftpboot/directory_setting.xml diff --git a/plugins/wazo-yealink/v84/__init__.py b/plugins/wazo_yealink/v73/__init__.py similarity index 100% rename from plugins/wazo-yealink/v84/__init__.py rename to plugins/wazo_yealink/v73/__init__.py diff --git a/plugins/wazo-yealink/v73/entry.py b/plugins/wazo_yealink/v73/entry.py similarity index 100% rename from plugins/wazo-yealink/v73/entry.py rename to plugins/wazo_yealink/v73/entry.py diff --git a/plugins/wazo-yealink/v73/pkgs/pkgs.db b/plugins/wazo_yealink/v73/pkgs/pkgs.db similarity index 100% rename from plugins/wazo-yealink/v73/pkgs/pkgs.db rename to plugins/wazo_yealink/v73/pkgs/pkgs.db diff --git a/plugins/wazo-yealink/v73/plugin-info b/plugins/wazo_yealink/v73/plugin-info similarity index 98% rename from plugins/wazo-yealink/v73/plugin-info rename to plugins/wazo_yealink/v73/plugin-info index b84d5399b2d810c4299943c6680ccb860548c2a7..b624189fa06981f11da39202ccc620b01a377adb 100644 --- a/plugins/wazo-yealink/v73/plugin-info +++ b/plugins/wazo_yealink/v73/plugin-info @@ -1,5 +1,5 @@ { - "version": "1.47.2", + "version": "1.47.3", "description": "Plugin for Yealink T20P, T22P, T26P, T28P and W52P in version V73.", "description_fr": "Greffon pour Yealink T20P, T22P, T26P, T28P and W52P en version V73.", "vendor" : "Yealink", diff --git a/plugins/wazo-yealink/v73/templates/T20P.tpl b/plugins/wazo_yealink/v73/templates/T20P.tpl similarity index 100% rename from plugins/wazo-yealink/v73/templates/T20P.tpl rename to plugins/wazo_yealink/v73/templates/T20P.tpl diff --git a/plugins/wazo-yealink/v73/templates/T22P.tpl b/plugins/wazo_yealink/v73/templates/T22P.tpl similarity index 100% rename from plugins/wazo-yealink/v73/templates/T22P.tpl rename to plugins/wazo_yealink/v73/templates/T22P.tpl diff --git a/plugins/wazo-yealink/v73/templates/T26P.tpl b/plugins/wazo_yealink/v73/templates/T26P.tpl similarity index 100% rename from plugins/wazo-yealink/v73/templates/T26P.tpl rename to plugins/wazo_yealink/v73/templates/T26P.tpl diff --git a/plugins/wazo-yealink/v73/templates/T28P.tpl b/plugins/wazo_yealink/v73/templates/T28P.tpl similarity index 100% rename from plugins/wazo-yealink/v73/templates/T28P.tpl rename to plugins/wazo_yealink/v73/templates/T28P.tpl diff --git a/plugins/wazo-yealink/v73/templates/W52P.tpl b/plugins/wazo_yealink/v73/templates/W52P.tpl similarity index 100% rename from plugins/wazo-yealink/v73/templates/W52P.tpl rename to plugins/wazo_yealink/v73/templates/W52P.tpl diff --git a/plugins/wazo-yealink/v73/templates/base.tpl b/plugins/wazo_yealink/v73/templates/base.tpl similarity index 100% rename from plugins/wazo-yealink/v73/templates/base.tpl rename to plugins/wazo_yealink/v73/templates/base.tpl diff --git a/plugins/wazo-yealink/v73/templates/common/W52P.tpl b/plugins/wazo_yealink/v73/templates/common/W52P.tpl similarity index 100% rename from plugins/wazo-yealink/v73/templates/common/W52P.tpl rename to plugins/wazo_yealink/v73/templates/common/W52P.tpl diff --git a/plugins/wazo-yealink/v73/templates/common/model-M7+M1.tpl b/plugins/wazo_yealink/v73/templates/common/model-M7+M1.tpl similarity index 100% rename from plugins/wazo-yealink/v73/templates/common/model-M7+M1.tpl rename to plugins/wazo_yealink/v73/templates/common/model-M7+M1.tpl diff --git a/plugins/wazo-yealink/v84/tests/__init__.py b/plugins/wazo_yealink/v80/__init__.py similarity index 100% rename from plugins/wazo-yealink/v84/tests/__init__.py rename to plugins/wazo_yealink/v80/__init__.py diff --git a/plugins/wazo-yealink/v80/entry.py b/plugins/wazo_yealink/v80/entry.py similarity index 100% rename from plugins/wazo-yealink/v80/entry.py rename to plugins/wazo_yealink/v80/entry.py diff --git a/plugins/wazo-yealink/v80/pkgs/pkgs.db b/plugins/wazo_yealink/v80/pkgs/pkgs.db similarity index 100% rename from plugins/wazo-yealink/v80/pkgs/pkgs.db rename to plugins/wazo_yealink/v80/pkgs/pkgs.db diff --git a/plugins/wazo-yealink/v80/plugin-info b/plugins/wazo_yealink/v80/plugin-info similarity index 99% rename from plugins/wazo-yealink/v80/plugin-info rename to plugins/wazo_yealink/v80/plugin-info index f27728fcb17c19396247a7dc0254f55238f49af7..1ae35e5dc405e93025dbbb578b635d21e34f98ea 100644 --- a/plugins/wazo-yealink/v80/plugin-info +++ b/plugins/wazo_yealink/v80/plugin-info @@ -1,5 +1,5 @@ { - "version": "1.49.2", + "version": "1.49.3", "description": "Plugin for Yealink CP860, T19P E2, T21P E2, T40P, T41P, T42G, T46G, T48G and W52/6P in version V80.", "description_fr": "Greffon pour Yealink CP860, T19P E2, T21P E2, T40P, T41P, T42G, T46G, T48G et W52/6P en version V80.", "vendor" : "Yealink", diff --git a/plugins/wazo-yealink/v80/templates/CP860.tpl b/plugins/wazo_yealink/v80/templates/CP860.tpl similarity index 100% rename from plugins/wazo-yealink/v80/templates/CP860.tpl rename to plugins/wazo_yealink/v80/templates/CP860.tpl diff --git a/plugins/wazo-yealink/v80/templates/CP960.tpl b/plugins/wazo_yealink/v80/templates/CP960.tpl similarity index 100% rename from plugins/wazo-yealink/v80/templates/CP960.tpl rename to plugins/wazo_yealink/v80/templates/CP960.tpl diff --git a/plugins/wazo-yealink/v80/templates/T19P_E2.tpl b/plugins/wazo_yealink/v80/templates/T19P_E2.tpl similarity index 100% rename from plugins/wazo-yealink/v80/templates/T19P_E2.tpl rename to plugins/wazo_yealink/v80/templates/T19P_E2.tpl diff --git a/plugins/wazo-yealink/v80/templates/T21P_E2.tpl b/plugins/wazo_yealink/v80/templates/T21P_E2.tpl similarity index 100% rename from plugins/wazo-yealink/v80/templates/T21P_E2.tpl rename to plugins/wazo_yealink/v80/templates/T21P_E2.tpl diff --git a/plugins/wazo-yealink/v80/templates/T23G.tpl b/plugins/wazo_yealink/v80/templates/T23G.tpl similarity index 100% rename from plugins/wazo-yealink/v80/templates/T23G.tpl rename to plugins/wazo_yealink/v80/templates/T23G.tpl diff --git a/plugins/wazo-yealink/v80/templates/T23P.tpl b/plugins/wazo_yealink/v80/templates/T23P.tpl similarity index 100% rename from plugins/wazo-yealink/v80/templates/T23P.tpl rename to plugins/wazo_yealink/v80/templates/T23P.tpl diff --git a/plugins/wazo-yealink/v80/templates/T27P.tpl b/plugins/wazo_yealink/v80/templates/T27P.tpl similarity index 100% rename from plugins/wazo-yealink/v80/templates/T27P.tpl rename to plugins/wazo_yealink/v80/templates/T27P.tpl diff --git a/plugins/wazo-yealink/v80/templates/T29G.tpl b/plugins/wazo_yealink/v80/templates/T29G.tpl similarity index 100% rename from plugins/wazo-yealink/v80/templates/T29G.tpl rename to plugins/wazo_yealink/v80/templates/T29G.tpl diff --git a/plugins/wazo-yealink/v80/templates/T40P.tpl b/plugins/wazo_yealink/v80/templates/T40P.tpl similarity index 100% rename from plugins/wazo-yealink/v80/templates/T40P.tpl rename to plugins/wazo_yealink/v80/templates/T40P.tpl diff --git a/plugins/wazo-yealink/v80/templates/T41P.tpl b/plugins/wazo_yealink/v80/templates/T41P.tpl similarity index 100% rename from plugins/wazo-yealink/v80/templates/T41P.tpl rename to plugins/wazo_yealink/v80/templates/T41P.tpl diff --git a/plugins/wazo-yealink/v80/templates/T42G.tpl b/plugins/wazo_yealink/v80/templates/T42G.tpl similarity index 100% rename from plugins/wazo-yealink/v80/templates/T42G.tpl rename to plugins/wazo_yealink/v80/templates/T42G.tpl diff --git a/plugins/wazo-yealink/v80/templates/T46G.tpl b/plugins/wazo_yealink/v80/templates/T46G.tpl similarity index 100% rename from plugins/wazo-yealink/v80/templates/T46G.tpl rename to plugins/wazo_yealink/v80/templates/T46G.tpl diff --git a/plugins/wazo-yealink/v80/templates/T48G.tpl b/plugins/wazo_yealink/v80/templates/T48G.tpl similarity index 100% rename from plugins/wazo-yealink/v80/templates/T48G.tpl rename to plugins/wazo_yealink/v80/templates/T48G.tpl diff --git a/plugins/wazo-yealink/v80/templates/T49G.tpl b/plugins/wazo_yealink/v80/templates/T49G.tpl similarity index 100% rename from plugins/wazo-yealink/v80/templates/T49G.tpl rename to plugins/wazo_yealink/v80/templates/T49G.tpl diff --git a/plugins/wazo-yealink/v80/templates/W52P.tpl b/plugins/wazo_yealink/v80/templates/W52P.tpl similarity index 100% rename from plugins/wazo-yealink/v80/templates/W52P.tpl rename to plugins/wazo_yealink/v80/templates/W52P.tpl diff --git a/plugins/wazo-yealink/v80/templates/base.tpl b/plugins/wazo_yealink/v80/templates/base.tpl similarity index 100% rename from plugins/wazo-yealink/v80/templates/base.tpl rename to plugins/wazo_yealink/v80/templates/base.tpl diff --git a/plugins/wazo-yealink/v80/templates/common/W52P.tpl b/plugins/wazo_yealink/v80/templates/common/W52P.tpl similarity index 100% rename from plugins/wazo-yealink/v80/templates/common/W52P.tpl rename to plugins/wazo_yealink/v80/templates/common/W52P.tpl diff --git a/plugins/wazo-yealink/v80/templates/common/model.tpl b/plugins/wazo_yealink/v80/templates/common/model.tpl similarity index 100% rename from plugins/wazo-yealink/v80/templates/common/model.tpl rename to plugins/wazo_yealink/v80/templates/common/model.tpl diff --git a/plugins/wazo-yealink/v80/var/tftpboot/lang/T19-T21-T23-T40/003.GUI.French.lang b/plugins/wazo_yealink/v80/var/tftpboot/lang/T19-T21-T23-T40/003.GUI.French.lang similarity index 100% rename from plugins/wazo-yealink/v80/var/tftpboot/lang/T19-T21-T23-T40/003.GUI.French.lang rename to plugins/wazo_yealink/v80/var/tftpboot/lang/T19-T21-T23-T40/003.GUI.French.lang diff --git a/plugins/wazo-yealink/v80/var/tftpboot/lang/T41-T42/003.GUI.French.lang b/plugins/wazo_yealink/v80/var/tftpboot/lang/T41-T42/003.GUI.French.lang similarity index 100% rename from plugins/wazo-yealink/v80/var/tftpboot/lang/T41-T42/003.GUI.French.lang rename to plugins/wazo_yealink/v80/var/tftpboot/lang/T41-T42/003.GUI.French.lang diff --git a/plugins/wazo-yealink/v80/var/tftpboot/lang/T46/003.GUI.French.lang b/plugins/wazo_yealink/v80/var/tftpboot/lang/T46/003.GUI.French.lang similarity index 100% rename from plugins/wazo-yealink/v80/var/tftpboot/lang/T46/003.GUI.French.lang rename to plugins/wazo_yealink/v80/var/tftpboot/lang/T46/003.GUI.French.lang diff --git a/plugins/wazo-yealink/v80/var/tftpboot/lang/T48/003.GUI.French.lang b/plugins/wazo_yealink/v80/var/tftpboot/lang/T48/003.GUI.French.lang similarity index 100% rename from plugins/wazo-yealink/v80/var/tftpboot/lang/T48/003.GUI.French.lang rename to plugins/wazo_yealink/v80/var/tftpboot/lang/T48/003.GUI.French.lang diff --git a/plugins/wazo-yealink/v85/__init__.py b/plugins/wazo_yealink/v81/__init__.py similarity index 100% rename from plugins/wazo-yealink/v85/__init__.py rename to plugins/wazo_yealink/v81/__init__.py diff --git a/plugins/wazo-yealink/v81/entry.py b/plugins/wazo_yealink/v81/entry.py similarity index 100% rename from plugins/wazo-yealink/v81/entry.py rename to plugins/wazo_yealink/v81/entry.py diff --git a/plugins/wazo-yealink/v81/pkgs/pkgs.db b/plugins/wazo_yealink/v81/pkgs/pkgs.db similarity index 100% rename from plugins/wazo-yealink/v81/pkgs/pkgs.db rename to plugins/wazo_yealink/v81/pkgs/pkgs.db diff --git a/plugins/wazo-yealink/v81/plugin-info b/plugins/wazo_yealink/v81/plugin-info similarity index 99% rename from plugins/wazo-yealink/v81/plugin-info rename to plugins/wazo_yealink/v81/plugin-info index 3e3c2975e774960fe3ad922c4426d83b8bbe59a8..4b4c7b87ac730a4068f21c0485af6c59fe6ee4b7 100644 --- a/plugins/wazo-yealink/v81/plugin-info +++ b/plugins/wazo_yealink/v81/plugin-info @@ -1,5 +1,5 @@ { - "version": "1.48.4", + "version": "1.48.5", "description": "Plugin for Yealink for all T2X and T4X series, W52/56 and CP860 in version V81.", "description_fr": "Greffon pour Yealink toutes les séries T2X et T4X, W52/56 et CP860 en version V81.", "vendor" : "Yealink", diff --git a/plugins/wazo-yealink/v81/templates/CP860.tpl b/plugins/wazo_yealink/v81/templates/CP860.tpl similarity index 100% rename from plugins/wazo-yealink/v81/templates/CP860.tpl rename to plugins/wazo_yealink/v81/templates/CP860.tpl diff --git a/plugins/wazo-yealink/v81/templates/CP920.tpl b/plugins/wazo_yealink/v81/templates/CP920.tpl similarity index 100% rename from plugins/wazo-yealink/v81/templates/CP920.tpl rename to plugins/wazo_yealink/v81/templates/CP920.tpl diff --git a/plugins/wazo-yealink/v81/templates/T19P_E2.tpl b/plugins/wazo_yealink/v81/templates/T19P_E2.tpl similarity index 100% rename from plugins/wazo-yealink/v81/templates/T19P_E2.tpl rename to plugins/wazo_yealink/v81/templates/T19P_E2.tpl diff --git a/plugins/wazo-yealink/v81/templates/T21P_E2.tpl b/plugins/wazo_yealink/v81/templates/T21P_E2.tpl similarity index 100% rename from plugins/wazo-yealink/v81/templates/T21P_E2.tpl rename to plugins/wazo_yealink/v81/templates/T21P_E2.tpl diff --git a/plugins/wazo-yealink/v81/templates/T23G.tpl b/plugins/wazo_yealink/v81/templates/T23G.tpl similarity index 100% rename from plugins/wazo-yealink/v81/templates/T23G.tpl rename to plugins/wazo_yealink/v81/templates/T23G.tpl diff --git a/plugins/wazo-yealink/v81/templates/T23P.tpl b/plugins/wazo_yealink/v81/templates/T23P.tpl similarity index 100% rename from plugins/wazo-yealink/v81/templates/T23P.tpl rename to plugins/wazo_yealink/v81/templates/T23P.tpl diff --git a/plugins/wazo-yealink/v81/templates/T27G.tpl b/plugins/wazo_yealink/v81/templates/T27G.tpl similarity index 100% rename from plugins/wazo-yealink/v81/templates/T27G.tpl rename to plugins/wazo_yealink/v81/templates/T27G.tpl diff --git a/plugins/wazo-yealink/v81/templates/T27P.tpl b/plugins/wazo_yealink/v81/templates/T27P.tpl similarity index 100% rename from plugins/wazo-yealink/v81/templates/T27P.tpl rename to plugins/wazo_yealink/v81/templates/T27P.tpl diff --git a/plugins/wazo-yealink/v81/templates/T29G.tpl b/plugins/wazo_yealink/v81/templates/T29G.tpl similarity index 100% rename from plugins/wazo-yealink/v81/templates/T29G.tpl rename to plugins/wazo_yealink/v81/templates/T29G.tpl diff --git a/plugins/wazo-yealink/v81/templates/T40G.tpl b/plugins/wazo_yealink/v81/templates/T40G.tpl similarity index 100% rename from plugins/wazo-yealink/v81/templates/T40G.tpl rename to plugins/wazo_yealink/v81/templates/T40G.tpl diff --git a/plugins/wazo-yealink/v81/templates/T40P.tpl b/plugins/wazo_yealink/v81/templates/T40P.tpl similarity index 100% rename from plugins/wazo-yealink/v81/templates/T40P.tpl rename to plugins/wazo_yealink/v81/templates/T40P.tpl diff --git a/plugins/wazo-yealink/v81/templates/T41P.tpl b/plugins/wazo_yealink/v81/templates/T41P.tpl similarity index 100% rename from plugins/wazo-yealink/v81/templates/T41P.tpl rename to plugins/wazo_yealink/v81/templates/T41P.tpl diff --git a/plugins/wazo-yealink/v81/templates/T41S.tpl b/plugins/wazo_yealink/v81/templates/T41S.tpl similarity index 100% rename from plugins/wazo-yealink/v81/templates/T41S.tpl rename to plugins/wazo_yealink/v81/templates/T41S.tpl diff --git a/plugins/wazo-yealink/v81/templates/T42G.tpl b/plugins/wazo_yealink/v81/templates/T42G.tpl similarity index 100% rename from plugins/wazo-yealink/v81/templates/T42G.tpl rename to plugins/wazo_yealink/v81/templates/T42G.tpl diff --git a/plugins/wazo-yealink/v81/templates/T42S.tpl b/plugins/wazo_yealink/v81/templates/T42S.tpl similarity index 100% rename from plugins/wazo-yealink/v81/templates/T42S.tpl rename to plugins/wazo_yealink/v81/templates/T42S.tpl diff --git a/plugins/wazo-yealink/v81/templates/T46G.tpl b/plugins/wazo_yealink/v81/templates/T46G.tpl similarity index 100% rename from plugins/wazo-yealink/v81/templates/T46G.tpl rename to plugins/wazo_yealink/v81/templates/T46G.tpl diff --git a/plugins/wazo-yealink/v81/templates/T46S.tpl b/plugins/wazo_yealink/v81/templates/T46S.tpl similarity index 100% rename from plugins/wazo-yealink/v81/templates/T46S.tpl rename to plugins/wazo_yealink/v81/templates/T46S.tpl diff --git a/plugins/wazo-yealink/v81/templates/T48G.tpl b/plugins/wazo_yealink/v81/templates/T48G.tpl similarity index 100% rename from plugins/wazo-yealink/v81/templates/T48G.tpl rename to plugins/wazo_yealink/v81/templates/T48G.tpl diff --git a/plugins/wazo-yealink/v81/templates/T48S.tpl b/plugins/wazo_yealink/v81/templates/T48S.tpl similarity index 100% rename from plugins/wazo-yealink/v81/templates/T48S.tpl rename to plugins/wazo_yealink/v81/templates/T48S.tpl diff --git a/plugins/wazo-yealink/v81/templates/W52P.tpl b/plugins/wazo_yealink/v81/templates/W52P.tpl similarity index 100% rename from plugins/wazo-yealink/v81/templates/W52P.tpl rename to plugins/wazo_yealink/v81/templates/W52P.tpl diff --git a/plugins/wazo-yealink/v81/templates/base.tpl b/plugins/wazo_yealink/v81/templates/base.tpl similarity index 100% rename from plugins/wazo-yealink/v81/templates/base.tpl rename to plugins/wazo_yealink/v81/templates/base.tpl diff --git a/plugins/wazo-yealink/v81/templates/common/W52P.tpl b/plugins/wazo_yealink/v81/templates/common/W52P.tpl similarity index 100% rename from plugins/wazo-yealink/v81/templates/common/W52P.tpl rename to plugins/wazo_yealink/v81/templates/common/W52P.tpl diff --git a/plugins/wazo-yealink/v81/templates/common/model.tpl b/plugins/wazo_yealink/v81/templates/common/model.tpl similarity index 100% rename from plugins/wazo-yealink/v81/templates/common/model.tpl rename to plugins/wazo_yealink/v81/templates/common/model.tpl diff --git a/plugins/wazo-yealink/v81/var/tftpboot/directory_setting.xml b/plugins/wazo_yealink/v81/var/tftpboot/directory_setting.xml similarity index 100% rename from plugins/wazo-yealink/v81/var/tftpboot/directory_setting.xml rename to plugins/wazo_yealink/v81/var/tftpboot/directory_setting.xml diff --git a/plugins/wazo-yealink/v81/var/tftpboot/lang/T19-T21-T23-T40/003.GUI.French.lang b/plugins/wazo_yealink/v81/var/tftpboot/lang/T19-T21-T23-T40/003.GUI.French.lang similarity index 100% rename from plugins/wazo-yealink/v81/var/tftpboot/lang/T19-T21-T23-T40/003.GUI.French.lang rename to plugins/wazo_yealink/v81/var/tftpboot/lang/T19-T21-T23-T40/003.GUI.French.lang diff --git a/plugins/wazo-yealink/v81/var/tftpboot/lang/T29-T46/003.GUI.French.lang b/plugins/wazo_yealink/v81/var/tftpboot/lang/T29-T46/003.GUI.French.lang similarity index 100% rename from plugins/wazo-yealink/v81/var/tftpboot/lang/T29-T46/003.GUI.French.lang rename to plugins/wazo_yealink/v81/var/tftpboot/lang/T29-T46/003.GUI.French.lang diff --git a/plugins/wazo-yealink/v81/var/tftpboot/lang/T41-T42-T27/003.GUI.French.lang b/plugins/wazo_yealink/v81/var/tftpboot/lang/T41-T42-T27/003.GUI.French.lang similarity index 100% rename from plugins/wazo-yealink/v81/var/tftpboot/lang/T41-T42-T27/003.GUI.French.lang rename to plugins/wazo_yealink/v81/var/tftpboot/lang/T41-T42-T27/003.GUI.French.lang diff --git a/plugins/wazo-yealink/v81/var/tftpboot/lang/T48/003.GUI.French.lang b/plugins/wazo_yealink/v81/var/tftpboot/lang/T48/003.GUI.French.lang similarity index 100% rename from plugins/wazo-yealink/v81/var/tftpboot/lang/T48/003.GUI.French.lang rename to plugins/wazo_yealink/v81/var/tftpboot/lang/T48/003.GUI.French.lang diff --git a/plugins/wazo-yealink/v81/var/tftpboot/lang/T49/003.GUI.French.lang b/plugins/wazo_yealink/v81/var/tftpboot/lang/T49/003.GUI.French.lang similarity index 100% rename from plugins/wazo-yealink/v81/var/tftpboot/lang/T49/003.GUI.French.lang rename to plugins/wazo_yealink/v81/var/tftpboot/lang/T49/003.GUI.French.lang diff --git a/plugins/wazo-yealink/v85/tests/__init__.py b/plugins/wazo_yealink/v82/__init__.py similarity index 100% rename from plugins/wazo-yealink/v85/tests/__init__.py rename to plugins/wazo_yealink/v82/__init__.py diff --git a/plugins/wazo-yealink/v82/common.py b/plugins/wazo_yealink/v82/common.py similarity index 99% rename from plugins/wazo-yealink/v82/common.py rename to plugins/wazo_yealink/v82/common.py index ec54cbe17a5826bea5ff6bc85d1b63931d2dc325..5ed1114992d3aa3851aa832dd44d70c392066969 100644 --- a/plugins/wazo-yealink/v82/common.py +++ b/plugins/wazo_yealink/v82/common.py @@ -357,6 +357,7 @@ class BaseYealinkPlugin(StandardPlugin): http_dev_info_extractor = BaseYealinkHTTPDeviceInfoExtractor() def configure_common(self, raw_config): + self._add_server_url(raw_config) for filename, fw_filename, tpl_filename in self._COMMON_FILES: tpl = self._tpl_helper.get_template(f'common/{tpl_filename}') dst = os.path.join(self._tftpboot_dir, filename) diff --git a/plugins/wazo-yealink/v82/entry.py b/plugins/wazo_yealink/v82/entry.py similarity index 100% rename from plugins/wazo-yealink/v82/entry.py rename to plugins/wazo_yealink/v82/entry.py diff --git a/plugins/wazo-yealink/v82/pkgs/pkgs.db b/plugins/wazo_yealink/v82/pkgs/pkgs.db similarity index 100% rename from plugins/wazo-yealink/v82/pkgs/pkgs.db rename to plugins/wazo_yealink/v82/pkgs/pkgs.db diff --git a/plugins/wazo-yealink/v82/plugin-info b/plugins/wazo_yealink/v82/plugin-info similarity index 99% rename from plugins/wazo-yealink/v82/plugin-info rename to plugins/wazo_yealink/v82/plugin-info index f69584226ea982de6e3e0b27e113f50067313f81..aacf022cafe81d68e4ae0643b68e860130770262 100644 --- a/plugins/wazo-yealink/v82/plugin-info +++ b/plugins/wazo_yealink/v82/plugin-info @@ -1,5 +1,5 @@ { - "version": "1.1.2", + "version": "1.1.3", "description": "Plugin for Yealink for all T2X and T4X series in version V82.", "description_fr": "Greffon pour Yealink pour toutes les series T2X et T4X en version V82.", "vendor" : "Yealink", diff --git a/plugins/wazo-yealink/v82/templates/T19P_E2.tpl b/plugins/wazo_yealink/v82/templates/T19P_E2.tpl similarity index 100% rename from plugins/wazo-yealink/v82/templates/T19P_E2.tpl rename to plugins/wazo_yealink/v82/templates/T19P_E2.tpl diff --git a/plugins/wazo-yealink/v82/templates/T21P_E2.tpl b/plugins/wazo_yealink/v82/templates/T21P_E2.tpl similarity index 100% rename from plugins/wazo-yealink/v82/templates/T21P_E2.tpl rename to plugins/wazo_yealink/v82/templates/T21P_E2.tpl diff --git a/plugins/wazo-yealink/v82/templates/T23G.tpl b/plugins/wazo_yealink/v82/templates/T23G.tpl similarity index 100% rename from plugins/wazo-yealink/v82/templates/T23G.tpl rename to plugins/wazo_yealink/v82/templates/T23G.tpl diff --git a/plugins/wazo-yealink/v82/templates/T23P.tpl b/plugins/wazo_yealink/v82/templates/T23P.tpl similarity index 100% rename from plugins/wazo-yealink/v82/templates/T23P.tpl rename to plugins/wazo_yealink/v82/templates/T23P.tpl diff --git a/plugins/wazo-yealink/v82/templates/T27G.tpl b/plugins/wazo_yealink/v82/templates/T27G.tpl similarity index 100% rename from plugins/wazo-yealink/v82/templates/T27G.tpl rename to plugins/wazo_yealink/v82/templates/T27G.tpl diff --git a/plugins/wazo-yealink/v82/templates/T27P.tpl b/plugins/wazo_yealink/v82/templates/T27P.tpl similarity index 100% rename from plugins/wazo-yealink/v82/templates/T27P.tpl rename to plugins/wazo_yealink/v82/templates/T27P.tpl diff --git a/plugins/wazo-yealink/v82/templates/T29G.tpl b/plugins/wazo_yealink/v82/templates/T29G.tpl similarity index 100% rename from plugins/wazo-yealink/v82/templates/T29G.tpl rename to plugins/wazo_yealink/v82/templates/T29G.tpl diff --git a/plugins/wazo-yealink/v82/templates/T40G.tpl b/plugins/wazo_yealink/v82/templates/T40G.tpl similarity index 100% rename from plugins/wazo-yealink/v82/templates/T40G.tpl rename to plugins/wazo_yealink/v82/templates/T40G.tpl diff --git a/plugins/wazo-yealink/v82/templates/T40P.tpl b/plugins/wazo_yealink/v82/templates/T40P.tpl similarity index 100% rename from plugins/wazo-yealink/v82/templates/T40P.tpl rename to plugins/wazo_yealink/v82/templates/T40P.tpl diff --git a/plugins/wazo-yealink/v82/templates/T41P.tpl b/plugins/wazo_yealink/v82/templates/T41P.tpl similarity index 100% rename from plugins/wazo-yealink/v82/templates/T41P.tpl rename to plugins/wazo_yealink/v82/templates/T41P.tpl diff --git a/plugins/wazo-yealink/v82/templates/T41S.tpl b/plugins/wazo_yealink/v82/templates/T41S.tpl similarity index 100% rename from plugins/wazo-yealink/v82/templates/T41S.tpl rename to plugins/wazo_yealink/v82/templates/T41S.tpl diff --git a/plugins/wazo-yealink/v82/templates/T42G.tpl b/plugins/wazo_yealink/v82/templates/T42G.tpl similarity index 100% rename from plugins/wazo-yealink/v82/templates/T42G.tpl rename to plugins/wazo_yealink/v82/templates/T42G.tpl diff --git a/plugins/wazo-yealink/v82/templates/T42S.tpl b/plugins/wazo_yealink/v82/templates/T42S.tpl similarity index 100% rename from plugins/wazo-yealink/v82/templates/T42S.tpl rename to plugins/wazo_yealink/v82/templates/T42S.tpl diff --git a/plugins/wazo-yealink/v82/templates/T46G.tpl b/plugins/wazo_yealink/v82/templates/T46G.tpl similarity index 100% rename from plugins/wazo-yealink/v82/templates/T46G.tpl rename to plugins/wazo_yealink/v82/templates/T46G.tpl diff --git a/plugins/wazo-yealink/v82/templates/T46S.tpl b/plugins/wazo_yealink/v82/templates/T46S.tpl similarity index 100% rename from plugins/wazo-yealink/v82/templates/T46S.tpl rename to plugins/wazo_yealink/v82/templates/T46S.tpl diff --git a/plugins/wazo-yealink/v82/templates/T48G.tpl b/plugins/wazo_yealink/v82/templates/T48G.tpl similarity index 100% rename from plugins/wazo-yealink/v82/templates/T48G.tpl rename to plugins/wazo_yealink/v82/templates/T48G.tpl diff --git a/plugins/wazo-yealink/v82/templates/T48S.tpl b/plugins/wazo_yealink/v82/templates/T48S.tpl similarity index 100% rename from plugins/wazo-yealink/v82/templates/T48S.tpl rename to plugins/wazo_yealink/v82/templates/T48S.tpl diff --git a/plugins/wazo-yealink/v82/templates/base.tpl b/plugins/wazo_yealink/v82/templates/base.tpl similarity index 100% rename from plugins/wazo-yealink/v82/templates/base.tpl rename to plugins/wazo_yealink/v82/templates/base.tpl diff --git a/plugins/wazo-yealink/v82/templates/common/model.tpl b/plugins/wazo_yealink/v82/templates/common/model.tpl similarity index 100% rename from plugins/wazo-yealink/v82/templates/common/model.tpl rename to plugins/wazo_yealink/v82/templates/common/model.tpl diff --git a/plugins/wazo-yealink/v86/__init__.py b/plugins/wazo_yealink/v82/tests/__init__.py similarity index 100% rename from plugins/wazo-yealink/v86/__init__.py rename to plugins/wazo_yealink/v82/tests/__init__.py diff --git a/plugins/wazo-yealink/v82/tests/conftest.py b/plugins/wazo_yealink/v82/tests/conftest.py similarity index 79% rename from plugins/wazo-yealink/v82/tests/conftest.py rename to plugins/wazo_yealink/v82/tests/conftest.py index ea52d1135e842f838320698a6966af4b0f161dfd..743d1dca120a6f08ce6edc87f1081c97472f7ff1 100644 --- a/plugins/wazo-yealink/v82/tests/conftest.py +++ b/plugins/wazo_yealink/v82/tests/conftest.py @@ -15,7 +15,7 @@ def v82_entry(module_initializer): @pytest.fixture def v82_plugin(v82_entry): - with patch('v82.common.FetchfwPluginHelper'), patch( - 'v82.common.TemplatePluginHelper' + with patch('plugins.wazo_yealink.v82.common.FetchfwPluginHelper'), patch( + 'plugins.wazo_yealink.v82.common.TemplatePluginHelper' ): yield v82_entry.YealinkPlugin(MagicMock(), 'test_dir', MagicMock(), MagicMock()) diff --git a/plugins/wazo-yealink/v82/tests/test_common.py b/plugins/wazo_yealink/v82/tests/test_common.py similarity index 96% rename from plugins/wazo-yealink/v82/tests/test_common.py rename to plugins/wazo_yealink/v82/tests/test_common.py index ade0bce5588377c2c68fea2bf9464e0d1ffcc9b3..e8ff4aeb75f08bf860bc9268b8579d3ea9788145 100644 --- a/plugins/wazo-yealink/v82/tests/test_common.py +++ b/plugins/wazo_yealink/v82/tests/test_common.py @@ -72,7 +72,7 @@ class TestInfoExtraction: def test_http_ua_extractor_when_no_info(self): assert self.http_info_extractor._extract_from_ua('') is None - @patch('v82.common.defer') + @patch('plugins.wazo_yealink.v82.common.defer') def test_extract(self, mocked_defer): self.http_info_extractor.extract( self._mock_request(b'Yealink SIP-T31G 124.85.257.55 80:5e:c0:d5:7d:72'), @@ -104,7 +104,7 @@ class TestInfoExtraction: self._mock_request(path=b'/y000000000025.cfg') ) == {'vendor': 'Yealink', 'model': 'W52P'} - @patch('v82.common.logger') + @patch('plugins.wazo_yealink.v82.common.logger') def test_invalid_mac(self, mocked_logger): self.http_info_extractor._extract_from_ua( 'Yealink SIP-T20P 9.72.0.30 00:15:6525ef16a7c' @@ -163,7 +163,7 @@ class TestPluginAssociation: class TestPlugin: - @patch('v82.common.FetchfwPluginHelper') + @patch('plugins.wazo_yealink.v82.common.FetchfwPluginHelper') def test_init(self, fetch_fw, v82_entry): fetch_fw.return_value.services.return_value = sentinel.fetchfw_services fetch_fw.new_downloaders.return_value = sentinel.fetchfw_downloaders @@ -174,7 +174,7 @@ class TestPlugin: fetch_fw.assert_called_once_with('test_dir', sentinel.fetchfw_downloaders) def test_common_configure(self, v82_plugin): - raw_config = {} + raw_config = {'http_base_url': 'http://localhost:8667'} v82_plugin._tpl_helper.get_template.return_value = 'template' v82_plugin.configure_common(raw_config) v82_plugin._tpl_helper.get_template.assert_called_with('common/model.tpl') @@ -209,14 +209,14 @@ class TestPlugin: v82_plugin.deconfigure({'mac': '80:5e:c0:d5:7d:72'}) mocked_remove.assert_called_with('test_dir/var/tftpboot/805ec0d57d72.cfg') - @patch('v82.common.logger') + @patch('plugins.wazo_yealink.v82.common.logger') def test_deconfigure_no_file(self, mocked_logger, v82_plugin): v82_plugin.deconfigure({'mac': '00:00:00:00:00:00'}) message, exception = mocked_logger.info.call_args[0] assert message == 'error while removing file: %s' assert isinstance(exception, FileNotFoundError) - @patch('v82.common.synchronize') + @patch('plugins.wazo_yealink.v82.common.synchronize') def test_synchronize(self, provd_synchronize, v82_plugin): device = {'mac': '80:5e:c0:d5:7d:72'} v82_plugin.synchronize(device, {}) @@ -250,7 +250,7 @@ class TestPlugin: with pytest.raises(Exception): v82_plugin._check_device({}) - @patch('v82.common.plugins') + @patch('plugins.wazo_yealink.v82.common.plugins') def test_phonebook_url(self, provd_plugins, v82_plugin): raw_config = {'config_version': 1} v82_plugin._add_xivo_phonebook_url(raw_config) @@ -292,7 +292,7 @@ class TestPlugin: '3': None, } - @patch('v82.common.logger') + @patch('plugins.wazo_yealink.v82.common.logger') def test_timezones(self, mocked_logger, v82_plugin): raw_config = {'timezone': 'America/Montreal'} v82_plugin._add_timezone(raw_config) @@ -328,7 +328,7 @@ class TestPlugin: assert message == 'Unknown timezone: %s' assert isinstance(exception, TimezoneNotFoundError) - @patch('v82.common.logger') + @patch('plugins.wazo_yealink.v82.common.logger') def test_function_keys(self, mocked_logger, v82_plugin): raw_config = { 'funckeys': { diff --git a/plugins/wazo-yealink/v82/var/tftpboot/directory_setting.xml b/plugins/wazo_yealink/v82/var/tftpboot/directory_setting.xml similarity index 100% rename from plugins/wazo-yealink/v82/var/tftpboot/directory_setting.xml rename to plugins/wazo_yealink/v82/var/tftpboot/directory_setting.xml diff --git a/plugins/wazo-yealink/v82/var/tftpboot/lang/T19-T21-T23-T40G/004.GUI.French.lang b/plugins/wazo_yealink/v82/var/tftpboot/lang/T19-T21-T23-T40G/004.GUI.French.lang similarity index 100% rename from plugins/wazo-yealink/v82/var/tftpboot/lang/T19-T21-T23-T40G/004.GUI.French.lang rename to plugins/wazo_yealink/v82/var/tftpboot/lang/T19-T21-T23-T40G/004.GUI.French.lang diff --git a/plugins/wazo-yealink/v82/var/tftpboot/lang/T27/004.GUI.French.lang b/plugins/wazo_yealink/v82/var/tftpboot/lang/T27/004.GUI.French.lang similarity index 100% rename from plugins/wazo-yealink/v82/var/tftpboot/lang/T27/004.GUI.French.lang rename to plugins/wazo_yealink/v82/var/tftpboot/lang/T27/004.GUI.French.lang diff --git a/plugins/wazo-yealink/v82/var/tftpboot/lang/T29G/004.GUI.French.lang b/plugins/wazo_yealink/v82/var/tftpboot/lang/T29G/004.GUI.French.lang similarity index 100% rename from plugins/wazo-yealink/v82/var/tftpboot/lang/T29G/004.GUI.French.lang rename to plugins/wazo_yealink/v82/var/tftpboot/lang/T29G/004.GUI.French.lang diff --git a/plugins/wazo-yealink/v82/var/tftpboot/lang/T40P/004.GUI.French.lang b/plugins/wazo_yealink/v82/var/tftpboot/lang/T40P/004.GUI.French.lang similarity index 100% rename from plugins/wazo-yealink/v82/var/tftpboot/lang/T40P/004.GUI.French.lang rename to plugins/wazo_yealink/v82/var/tftpboot/lang/T40P/004.GUI.French.lang diff --git a/plugins/wazo-yealink/v82/var/tftpboot/lang/T41P-T42G/004.GUI.French.lang b/plugins/wazo_yealink/v82/var/tftpboot/lang/T41P-T42G/004.GUI.French.lang similarity index 100% rename from plugins/wazo-yealink/v82/var/tftpboot/lang/T41P-T42G/004.GUI.French.lang rename to plugins/wazo_yealink/v82/var/tftpboot/lang/T41P-T42G/004.GUI.French.lang diff --git a/plugins/wazo-yealink/v82/var/tftpboot/lang/T41S-T42S/004.GUI.French.lang b/plugins/wazo_yealink/v82/var/tftpboot/lang/T41S-T42S/004.GUI.French.lang similarity index 100% rename from plugins/wazo-yealink/v82/var/tftpboot/lang/T41S-T42S/004.GUI.French.lang rename to plugins/wazo_yealink/v82/var/tftpboot/lang/T41S-T42S/004.GUI.French.lang diff --git a/plugins/wazo-yealink/v82/var/tftpboot/lang/T46G/004.GUI.French.lang b/plugins/wazo_yealink/v82/var/tftpboot/lang/T46G/004.GUI.French.lang similarity index 100% rename from plugins/wazo-yealink/v82/var/tftpboot/lang/T46G/004.GUI.French.lang rename to plugins/wazo_yealink/v82/var/tftpboot/lang/T46G/004.GUI.French.lang diff --git a/plugins/wazo-yealink/v82/var/tftpboot/lang/T46S/004.GUI.French.lang b/plugins/wazo_yealink/v82/var/tftpboot/lang/T46S/004.GUI.French.lang similarity index 100% rename from plugins/wazo-yealink/v82/var/tftpboot/lang/T46S/004.GUI.French.lang rename to plugins/wazo_yealink/v82/var/tftpboot/lang/T46S/004.GUI.French.lang diff --git a/plugins/wazo-yealink/v82/var/tftpboot/lang/T48G/004.GUI.French.lang b/plugins/wazo_yealink/v82/var/tftpboot/lang/T48G/004.GUI.French.lang similarity index 100% rename from plugins/wazo-yealink/v82/var/tftpboot/lang/T48G/004.GUI.French.lang rename to plugins/wazo_yealink/v82/var/tftpboot/lang/T48G/004.GUI.French.lang diff --git a/plugins/wazo-yealink/v82/var/tftpboot/lang/T48S/004.GUI.French.lang b/plugins/wazo_yealink/v82/var/tftpboot/lang/T48S/004.GUI.French.lang similarity index 100% rename from plugins/wazo-yealink/v82/var/tftpboot/lang/T48S/004.GUI.French.lang rename to plugins/wazo_yealink/v82/var/tftpboot/lang/T48S/004.GUI.French.lang diff --git a/plugins/wazo-yealink/v86/tests/__init__.py b/plugins/wazo_yealink/v83/__init__.py similarity index 100% rename from plugins/wazo-yealink/v86/tests/__init__.py rename to plugins/wazo_yealink/v83/__init__.py diff --git a/plugins/wazo-yealink/v83/common.py b/plugins/wazo_yealink/v83/common.py similarity index 99% rename from plugins/wazo-yealink/v83/common.py rename to plugins/wazo_yealink/v83/common.py index 93eeca076ea8522c5389612682068d98024642f5..3880f3fdfd1ff60a7acc6490045bf597dad0c621 100644 --- a/plugins/wazo-yealink/v83/common.py +++ b/plugins/wazo_yealink/v83/common.py @@ -393,6 +393,7 @@ class BaseYealinkPlugin(StandardPlugin): http_dev_info_extractor = BaseYealinkHTTPDeviceInfoExtractor() def configure_common(self, raw_config): + self._add_server_url(raw_config) for filename, fw_filename, tpl_filename in self._COMMON_FILES: tpl = self._tpl_helper.get_template(f'common/{tpl_filename}') dst = os.path.join(self._tftpboot_dir, filename) diff --git a/plugins/wazo-yealink/v83/entry.py b/plugins/wazo_yealink/v83/entry.py similarity index 100% rename from plugins/wazo-yealink/v83/entry.py rename to plugins/wazo_yealink/v83/entry.py diff --git a/plugins/wazo-yealink/v83/pkgs/pkgs.db b/plugins/wazo_yealink/v83/pkgs/pkgs.db similarity index 100% rename from plugins/wazo-yealink/v83/pkgs/pkgs.db rename to plugins/wazo_yealink/v83/pkgs/pkgs.db diff --git a/plugins/wazo-yealink/v83/plugin-info b/plugins/wazo_yealink/v83/plugin-info similarity index 99% rename from plugins/wazo-yealink/v83/plugin-info rename to plugins/wazo_yealink/v83/plugin-info index a714c26edba32b4c87976365f683a148394b03bd..dd6ce1ed678321ccad229e3aac51e5f23f356f33 100644 --- a/plugins/wazo-yealink/v83/plugin-info +++ b/plugins/wazo_yealink/v83/plugin-info @@ -1,5 +1,5 @@ { - "version": "1.4.3", + "version": "1.4.4", "description": "Plugin for Yealink for CP960, T2X, T4X, T5X, W60 and W80 series in version V83.", "description_fr": "Greffon pour Yealink pour les series CP960, T2X, T4X, T5X, W60 et W80 en version V83.", "vendor" : "Yealink", diff --git a/plugins/wazo-yealink/v83/templates/CP960.tpl b/plugins/wazo_yealink/v83/templates/CP960.tpl similarity index 100% rename from plugins/wazo-yealink/v83/templates/CP960.tpl rename to plugins/wazo_yealink/v83/templates/CP960.tpl diff --git a/plugins/wazo-yealink/v83/templates/T19P_E2.tpl b/plugins/wazo_yealink/v83/templates/T19P_E2.tpl similarity index 100% rename from plugins/wazo-yealink/v83/templates/T19P_E2.tpl rename to plugins/wazo_yealink/v83/templates/T19P_E2.tpl diff --git a/plugins/wazo-yealink/v83/templates/T21P_E2.tpl b/plugins/wazo_yealink/v83/templates/T21P_E2.tpl similarity index 100% rename from plugins/wazo-yealink/v83/templates/T21P_E2.tpl rename to plugins/wazo_yealink/v83/templates/T21P_E2.tpl diff --git a/plugins/wazo-yealink/v83/templates/T23G.tpl b/plugins/wazo_yealink/v83/templates/T23G.tpl similarity index 100% rename from plugins/wazo-yealink/v83/templates/T23G.tpl rename to plugins/wazo_yealink/v83/templates/T23G.tpl diff --git a/plugins/wazo-yealink/v83/templates/T23P.tpl b/plugins/wazo_yealink/v83/templates/T23P.tpl similarity index 100% rename from plugins/wazo-yealink/v83/templates/T23P.tpl rename to plugins/wazo_yealink/v83/templates/T23P.tpl diff --git a/plugins/wazo-yealink/v83/templates/T27G.tpl b/plugins/wazo_yealink/v83/templates/T27G.tpl similarity index 100% rename from plugins/wazo-yealink/v83/templates/T27G.tpl rename to plugins/wazo_yealink/v83/templates/T27G.tpl diff --git a/plugins/wazo-yealink/v83/templates/T29G.tpl b/plugins/wazo_yealink/v83/templates/T29G.tpl similarity index 100% rename from plugins/wazo-yealink/v83/templates/T29G.tpl rename to plugins/wazo_yealink/v83/templates/T29G.tpl diff --git a/plugins/wazo-yealink/v83/templates/T40G.tpl b/plugins/wazo_yealink/v83/templates/T40G.tpl similarity index 100% rename from plugins/wazo-yealink/v83/templates/T40G.tpl rename to plugins/wazo_yealink/v83/templates/T40G.tpl diff --git a/plugins/wazo-yealink/v83/templates/T40P.tpl b/plugins/wazo_yealink/v83/templates/T40P.tpl similarity index 100% rename from plugins/wazo-yealink/v83/templates/T40P.tpl rename to plugins/wazo_yealink/v83/templates/T40P.tpl diff --git a/plugins/wazo-yealink/v83/templates/T41P.tpl b/plugins/wazo_yealink/v83/templates/T41P.tpl similarity index 100% rename from plugins/wazo-yealink/v83/templates/T41P.tpl rename to plugins/wazo_yealink/v83/templates/T41P.tpl diff --git a/plugins/wazo-yealink/v83/templates/T41S.tpl b/plugins/wazo_yealink/v83/templates/T41S.tpl similarity index 100% rename from plugins/wazo-yealink/v83/templates/T41S.tpl rename to plugins/wazo_yealink/v83/templates/T41S.tpl diff --git a/plugins/wazo-yealink/v83/templates/T42G.tpl b/plugins/wazo_yealink/v83/templates/T42G.tpl similarity index 100% rename from plugins/wazo-yealink/v83/templates/T42G.tpl rename to plugins/wazo_yealink/v83/templates/T42G.tpl diff --git a/plugins/wazo-yealink/v83/templates/T42S.tpl b/plugins/wazo_yealink/v83/templates/T42S.tpl similarity index 100% rename from plugins/wazo-yealink/v83/templates/T42S.tpl rename to plugins/wazo_yealink/v83/templates/T42S.tpl diff --git a/plugins/wazo-yealink/v83/templates/T46G.tpl b/plugins/wazo_yealink/v83/templates/T46G.tpl similarity index 100% rename from plugins/wazo-yealink/v83/templates/T46G.tpl rename to plugins/wazo_yealink/v83/templates/T46G.tpl diff --git a/plugins/wazo-yealink/v83/templates/T46S.tpl b/plugins/wazo_yealink/v83/templates/T46S.tpl similarity index 100% rename from plugins/wazo-yealink/v83/templates/T46S.tpl rename to plugins/wazo_yealink/v83/templates/T46S.tpl diff --git a/plugins/wazo-yealink/v83/templates/T48G.tpl b/plugins/wazo_yealink/v83/templates/T48G.tpl similarity index 100% rename from plugins/wazo-yealink/v83/templates/T48G.tpl rename to plugins/wazo_yealink/v83/templates/T48G.tpl diff --git a/plugins/wazo-yealink/v83/templates/T48S.tpl b/plugins/wazo_yealink/v83/templates/T48S.tpl similarity index 100% rename from plugins/wazo-yealink/v83/templates/T48S.tpl rename to plugins/wazo_yealink/v83/templates/T48S.tpl diff --git a/plugins/wazo-yealink/v83/templates/T52S.tpl b/plugins/wazo_yealink/v83/templates/T52S.tpl similarity index 100% rename from plugins/wazo-yealink/v83/templates/T52S.tpl rename to plugins/wazo_yealink/v83/templates/T52S.tpl diff --git a/plugins/wazo-yealink/v83/templates/T54S.tpl b/plugins/wazo_yealink/v83/templates/T54S.tpl similarity index 100% rename from plugins/wazo-yealink/v83/templates/T54S.tpl rename to plugins/wazo_yealink/v83/templates/T54S.tpl diff --git a/plugins/wazo-yealink/v83/templates/T56A.tpl b/plugins/wazo_yealink/v83/templates/T56A.tpl similarity index 100% rename from plugins/wazo-yealink/v83/templates/T56A.tpl rename to plugins/wazo_yealink/v83/templates/T56A.tpl diff --git a/plugins/wazo-yealink/v83/templates/T58A.tpl b/plugins/wazo_yealink/v83/templates/T58A.tpl similarity index 100% rename from plugins/wazo-yealink/v83/templates/T58A.tpl rename to plugins/wazo_yealink/v83/templates/T58A.tpl diff --git a/plugins/wazo-yealink/v83/templates/T58V.tpl b/plugins/wazo_yealink/v83/templates/T58V.tpl similarity index 100% rename from plugins/wazo-yealink/v83/templates/T58V.tpl rename to plugins/wazo_yealink/v83/templates/T58V.tpl diff --git a/plugins/wazo-yealink/v83/templates/W60B.tpl b/plugins/wazo_yealink/v83/templates/W60B.tpl similarity index 100% rename from plugins/wazo-yealink/v83/templates/W60B.tpl rename to plugins/wazo_yealink/v83/templates/W60B.tpl diff --git a/plugins/wazo-yealink/v83/templates/W80B.tpl b/plugins/wazo_yealink/v83/templates/W80B.tpl similarity index 100% rename from plugins/wazo-yealink/v83/templates/W80B.tpl rename to plugins/wazo_yealink/v83/templates/W80B.tpl diff --git a/plugins/wazo-yealink/v83/templates/base.tpl b/plugins/wazo_yealink/v83/templates/base.tpl similarity index 100% rename from plugins/wazo-yealink/v83/templates/base.tpl rename to plugins/wazo_yealink/v83/templates/base.tpl diff --git a/plugins/wazo-yealink/v83/templates/common/dect_model.tpl b/plugins/wazo_yealink/v83/templates/common/dect_model.tpl similarity index 100% rename from plugins/wazo-yealink/v83/templates/common/dect_model.tpl rename to plugins/wazo_yealink/v83/templates/common/dect_model.tpl diff --git a/plugins/wazo-yealink/v83/templates/common/model.tpl b/plugins/wazo_yealink/v83/templates/common/model.tpl similarity index 100% rename from plugins/wazo-yealink/v83/templates/common/model.tpl rename to plugins/wazo_yealink/v83/templates/common/model.tpl diff --git a/plugins/wazo_yealink/v83/tests/__init__.py b/plugins/wazo_yealink/v83/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/plugins/wazo-yealink/v83/tests/conftest.py b/plugins/wazo_yealink/v83/tests/conftest.py similarity index 79% rename from plugins/wazo-yealink/v83/tests/conftest.py rename to plugins/wazo_yealink/v83/tests/conftest.py index cbea420ff091957314391b73ca863319d39d017d..3d28b2b57794b5477e2b625459d4cbff0c1382bd 100644 --- a/plugins/wazo-yealink/v83/tests/conftest.py +++ b/plugins/wazo_yealink/v83/tests/conftest.py @@ -15,7 +15,7 @@ def v83_entry(module_initializer): @pytest.fixture def v83_plugin(v83_entry): - with patch('v83.common.FetchfwPluginHelper'), patch( - 'v83.common.TemplatePluginHelper' + with patch('plugins.wazo_yealink.v83.common.FetchfwPluginHelper'), patch( + 'plugins.wazo_yealink.v83.common.TemplatePluginHelper' ): yield v83_entry.YealinkPlugin(MagicMock(), 'test_dir', MagicMock(), MagicMock()) diff --git a/plugins/wazo-yealink/v83/tests/test_common.py b/plugins/wazo_yealink/v83/tests/test_common.py similarity index 96% rename from plugins/wazo-yealink/v83/tests/test_common.py rename to plugins/wazo_yealink/v83/tests/test_common.py index 4bcd1d02e9f56d9d4ec5812dd6bf779ba80bcd42..efe9c4046318bface42ff972ed466017f7963f41 100644 --- a/plugins/wazo-yealink/v83/tests/test_common.py +++ b/plugins/wazo_yealink/v83/tests/test_common.py @@ -71,7 +71,7 @@ class TestInfoExtraction: def test_http_ua_extractor_when_no_info(self): assert self.http_info_extractor._extract_from_ua('') is None - @patch('v83.common.defer') + @patch('plugins.wazo_yealink.v83.common.defer') def test_extract(self, mocked_defer): self.http_info_extractor.extract( self._mock_request(b'Yealink SIP-T31G 124.85.257.55 80:5e:c0:d5:7d:72'), @@ -103,7 +103,7 @@ class TestInfoExtraction: self._mock_request(path=b'/y000000000025.cfg') ) == {'vendor': 'Yealink', 'model': 'W52P'} - @patch('v83.common.logger') + @patch('plugins.wazo_yealink.v83.common.logger') def test_invalid_mac(self, mocked_logger): self.http_info_extractor._extract_from_ua( 'Yealink SIP-T20P 9.72.0.30 00:15:6525ef16a7c' @@ -162,7 +162,7 @@ class TestPluginAssociation: class TestPlugin: - @patch('v83.common.FetchfwPluginHelper') + @patch('plugins.wazo_yealink.v83.common.FetchfwPluginHelper') def test_init(self, fetch_fw, v83_entry): fetch_fw.return_value.services.return_value = sentinel.fetchfw_services fetch_fw.new_downloaders.return_value = sentinel.fetchfw_downloaders @@ -173,7 +173,7 @@ class TestPlugin: fetch_fw.assert_called_once_with('test_dir', sentinel.fetchfw_downloaders) def test_common_configure(self, v83_plugin): - raw_config = {} + raw_config = {'http_base_url': 'http://localhost:8667'} v83_plugin._tpl_helper.get_template.return_value = 'template' v83_plugin.configure_common(raw_config) v83_plugin._tpl_helper.get_template.assert_called_with('common/dect_model.tpl') @@ -208,14 +208,14 @@ class TestPlugin: v83_plugin.deconfigure({'mac': '80:5e:c0:d5:7d:72'}) mocked_remove.assert_called_with('test_dir/var/tftpboot/805ec0d57d72.cfg') - @patch('v83.common.logger') + @patch('plugins.wazo_yealink.v83.common.logger') def test_deconfigure_no_file(self, mocked_logger, v83_plugin): v83_plugin.deconfigure({'mac': '00:00:00:00:00:00'}) message, exception = mocked_logger.info.call_args[0] assert message == 'error while removing file: %s' assert isinstance(exception, FileNotFoundError) - @patch('v83.common.synchronize') + @patch('plugins.wazo_yealink.v83.common.synchronize') def test_synchronize(self, provd_synchronize, v83_plugin): device = {'mac': '80:5e:c0:d5:7d:72'} v83_plugin.synchronize(device, {}) @@ -249,7 +249,7 @@ class TestPlugin: with pytest.raises(Exception): v83_plugin._check_device({}) - @patch('v83.common.plugins') + @patch('plugins.wazo_yealink.v83.common.plugins') def test_phonebook_url(self, provd_plugins, v83_plugin): raw_config = {'config_version': 1} v83_plugin._add_xivo_phonebook_url(raw_config) @@ -292,7 +292,7 @@ class TestPlugin: '3': None, } - @patch('v83.common.logger') + @patch('plugins.wazo_yealink.v83.common.logger') def test_timezones(self, mocked_logger, v83_plugin): raw_config = {'timezone': 'America/Montreal'} v83_plugin._add_timezone(raw_config) @@ -328,7 +328,7 @@ class TestPlugin: assert message == 'Unknown timezone: %s' assert isinstance(exception, TimezoneNotFoundError) - @patch('v83.common.logger') + @patch('plugins.wazo_yealink.v83.common.logger') def test_function_keys(self, mocked_logger, v83_plugin): raw_config = { 'funckeys': { diff --git a/plugins/wazo-yealink/v83/var/tftpboot/directory_setting.xml b/plugins/wazo_yealink/v83/var/tftpboot/directory_setting.xml similarity index 100% rename from plugins/wazo-yealink/v83/var/tftpboot/directory_setting.xml rename to plugins/wazo_yealink/v83/var/tftpboot/directory_setting.xml diff --git a/plugins/wazo-yealink/v83/var/tftpboot/lang/T19-T21-T23/000.GUI.English.lang b/plugins/wazo_yealink/v83/var/tftpboot/lang/T19-T21-T23/000.GUI.English.lang similarity index 100% rename from plugins/wazo-yealink/v83/var/tftpboot/lang/T19-T21-T23/000.GUI.English.lang rename to plugins/wazo_yealink/v83/var/tftpboot/lang/T19-T21-T23/000.GUI.English.lang diff --git a/plugins/wazo-yealink/v83/var/tftpboot/lang/T19-T21-T23/001.GUI.Chinese_S.lang b/plugins/wazo_yealink/v83/var/tftpboot/lang/T19-T21-T23/001.GUI.Chinese_S.lang similarity index 100% rename from plugins/wazo-yealink/v83/var/tftpboot/lang/T19-T21-T23/001.GUI.Chinese_S.lang rename to plugins/wazo_yealink/v83/var/tftpboot/lang/T19-T21-T23/001.GUI.Chinese_S.lang diff --git a/plugins/wazo-yealink/v83/var/tftpboot/lang/T19-T21-T23/002.GUI.Chinese_T.lang b/plugins/wazo_yealink/v83/var/tftpboot/lang/T19-T21-T23/002.GUI.Chinese_T.lang similarity index 100% rename from plugins/wazo-yealink/v83/var/tftpboot/lang/T19-T21-T23/002.GUI.Chinese_T.lang rename to plugins/wazo_yealink/v83/var/tftpboot/lang/T19-T21-T23/002.GUI.Chinese_T.lang diff --git a/plugins/wazo-yealink/v83/var/tftpboot/lang/T19-T21-T23/003.GUI.French_CA.lang b/plugins/wazo_yealink/v83/var/tftpboot/lang/T19-T21-T23/003.GUI.French_CA.lang similarity index 100% rename from plugins/wazo-yealink/v83/var/tftpboot/lang/T19-T21-T23/003.GUI.French_CA.lang rename to plugins/wazo_yealink/v83/var/tftpboot/lang/T19-T21-T23/003.GUI.French_CA.lang diff --git a/plugins/wazo-yealink/v83/var/tftpboot/lang/T19-T21-T23/004.GUI.French.lang b/plugins/wazo_yealink/v83/var/tftpboot/lang/T19-T21-T23/004.GUI.French.lang similarity index 100% rename from plugins/wazo-yealink/v83/var/tftpboot/lang/T19-T21-T23/004.GUI.French.lang rename to plugins/wazo_yealink/v83/var/tftpboot/lang/T19-T21-T23/004.GUI.French.lang diff --git a/plugins/wazo-yealink/v83/var/tftpboot/lang/T19-T21-T23/005.GUI.German.lang b/plugins/wazo_yealink/v83/var/tftpboot/lang/T19-T21-T23/005.GUI.German.lang similarity index 100% rename from plugins/wazo-yealink/v83/var/tftpboot/lang/T19-T21-T23/005.GUI.German.lang rename to plugins/wazo_yealink/v83/var/tftpboot/lang/T19-T21-T23/005.GUI.German.lang diff --git a/plugins/wazo-yealink/v83/var/tftpboot/lang/T19-T21-T23/006.GUI.Italian.lang b/plugins/wazo_yealink/v83/var/tftpboot/lang/T19-T21-T23/006.GUI.Italian.lang similarity index 100% rename from plugins/wazo-yealink/v83/var/tftpboot/lang/T19-T21-T23/006.GUI.Italian.lang rename to plugins/wazo_yealink/v83/var/tftpboot/lang/T19-T21-T23/006.GUI.Italian.lang diff --git a/plugins/wazo-yealink/v83/var/tftpboot/lang/T19-T21-T23/007.GUI.Polish.lang b/plugins/wazo_yealink/v83/var/tftpboot/lang/T19-T21-T23/007.GUI.Polish.lang similarity index 100% rename from plugins/wazo-yealink/v83/var/tftpboot/lang/T19-T21-T23/007.GUI.Polish.lang rename to plugins/wazo_yealink/v83/var/tftpboot/lang/T19-T21-T23/007.GUI.Polish.lang diff --git a/plugins/wazo-yealink/v83/var/tftpboot/lang/T19-T21-T23/008.GUI.Portuguese.lang b/plugins/wazo_yealink/v83/var/tftpboot/lang/T19-T21-T23/008.GUI.Portuguese.lang similarity index 100% rename from plugins/wazo-yealink/v83/var/tftpboot/lang/T19-T21-T23/008.GUI.Portuguese.lang rename to plugins/wazo_yealink/v83/var/tftpboot/lang/T19-T21-T23/008.GUI.Portuguese.lang diff --git a/plugins/wazo-yealink/v83/var/tftpboot/lang/T19-T21-T23/009.GUI.Portuguese_LA.lang b/plugins/wazo_yealink/v83/var/tftpboot/lang/T19-T21-T23/009.GUI.Portuguese_LA.lang similarity index 100% rename from plugins/wazo-yealink/v83/var/tftpboot/lang/T19-T21-T23/009.GUI.Portuguese_LA.lang rename to plugins/wazo_yealink/v83/var/tftpboot/lang/T19-T21-T23/009.GUI.Portuguese_LA.lang diff --git a/plugins/wazo-yealink/v83/var/tftpboot/lang/T19-T21-T23/010.GUI.Spanish.lang b/plugins/wazo_yealink/v83/var/tftpboot/lang/T19-T21-T23/010.GUI.Spanish.lang similarity index 100% rename from plugins/wazo-yealink/v83/var/tftpboot/lang/T19-T21-T23/010.GUI.Spanish.lang rename to plugins/wazo_yealink/v83/var/tftpboot/lang/T19-T21-T23/010.GUI.Spanish.lang diff --git a/plugins/wazo-yealink/v83/var/tftpboot/lang/T19-T21-T23/011.GUI.Spanish_LA.lang b/plugins/wazo_yealink/v83/var/tftpboot/lang/T19-T21-T23/011.GUI.Spanish_LA.lang similarity index 100% rename from plugins/wazo-yealink/v83/var/tftpboot/lang/T19-T21-T23/011.GUI.Spanish_LA.lang rename to plugins/wazo_yealink/v83/var/tftpboot/lang/T19-T21-T23/011.GUI.Spanish_LA.lang diff --git a/plugins/wazo-yealink/v83/var/tftpboot/lang/T19-T21-T23/012.GUI.Turkish.lang b/plugins/wazo_yealink/v83/var/tftpboot/lang/T19-T21-T23/012.GUI.Turkish.lang similarity index 100% rename from plugins/wazo-yealink/v83/var/tftpboot/lang/T19-T21-T23/012.GUI.Turkish.lang rename to plugins/wazo_yealink/v83/var/tftpboot/lang/T19-T21-T23/012.GUI.Turkish.lang diff --git a/plugins/wazo-yealink/v83/var/tftpboot/lang/T19-T21-T23/013.GUI.Russian.lang b/plugins/wazo_yealink/v83/var/tftpboot/lang/T19-T21-T23/013.GUI.Russian.lang similarity index 100% rename from plugins/wazo-yealink/v83/var/tftpboot/lang/T19-T21-T23/013.GUI.Russian.lang rename to plugins/wazo_yealink/v83/var/tftpboot/lang/T19-T21-T23/013.GUI.Russian.lang diff --git a/plugins/wazo-yealink/v83/var/tftpboot/lang/T27/000.GUI.English.lang b/plugins/wazo_yealink/v83/var/tftpboot/lang/T27/000.GUI.English.lang similarity index 100% rename from plugins/wazo-yealink/v83/var/tftpboot/lang/T27/000.GUI.English.lang rename to plugins/wazo_yealink/v83/var/tftpboot/lang/T27/000.GUI.English.lang diff --git a/plugins/wazo-yealink/v83/var/tftpboot/lang/T27/001.GUI.Chinese_S.lang b/plugins/wazo_yealink/v83/var/tftpboot/lang/T27/001.GUI.Chinese_S.lang similarity index 100% rename from plugins/wazo-yealink/v83/var/tftpboot/lang/T27/001.GUI.Chinese_S.lang rename to plugins/wazo_yealink/v83/var/tftpboot/lang/T27/001.GUI.Chinese_S.lang diff --git a/plugins/wazo-yealink/v83/var/tftpboot/lang/T27/002.GUI.Chinese_T.lang b/plugins/wazo_yealink/v83/var/tftpboot/lang/T27/002.GUI.Chinese_T.lang similarity index 100% rename from plugins/wazo-yealink/v83/var/tftpboot/lang/T27/002.GUI.Chinese_T.lang rename to plugins/wazo_yealink/v83/var/tftpboot/lang/T27/002.GUI.Chinese_T.lang diff --git a/plugins/wazo-yealink/v83/var/tftpboot/lang/T27/003.GUI.French_CA.lang b/plugins/wazo_yealink/v83/var/tftpboot/lang/T27/003.GUI.French_CA.lang similarity index 100% rename from plugins/wazo-yealink/v83/var/tftpboot/lang/T27/003.GUI.French_CA.lang rename to plugins/wazo_yealink/v83/var/tftpboot/lang/T27/003.GUI.French_CA.lang diff --git a/plugins/wazo-yealink/v83/var/tftpboot/lang/T27/004.GUI.French.lang b/plugins/wazo_yealink/v83/var/tftpboot/lang/T27/004.GUI.French.lang similarity index 100% rename from plugins/wazo-yealink/v83/var/tftpboot/lang/T27/004.GUI.French.lang rename to plugins/wazo_yealink/v83/var/tftpboot/lang/T27/004.GUI.French.lang diff --git a/plugins/wazo-yealink/v83/var/tftpboot/lang/T27/005.GUI.German.lang b/plugins/wazo_yealink/v83/var/tftpboot/lang/T27/005.GUI.German.lang similarity index 100% rename from plugins/wazo-yealink/v83/var/tftpboot/lang/T27/005.GUI.German.lang rename to plugins/wazo_yealink/v83/var/tftpboot/lang/T27/005.GUI.German.lang diff --git a/plugins/wazo-yealink/v83/var/tftpboot/lang/T27/006.GUI.Italian.lang b/plugins/wazo_yealink/v83/var/tftpboot/lang/T27/006.GUI.Italian.lang similarity index 100% rename from plugins/wazo-yealink/v83/var/tftpboot/lang/T27/006.GUI.Italian.lang rename to plugins/wazo_yealink/v83/var/tftpboot/lang/T27/006.GUI.Italian.lang diff --git a/plugins/wazo-yealink/v83/var/tftpboot/lang/T27/007.GUI.Polish.lang b/plugins/wazo_yealink/v83/var/tftpboot/lang/T27/007.GUI.Polish.lang similarity index 100% rename from plugins/wazo-yealink/v83/var/tftpboot/lang/T27/007.GUI.Polish.lang rename to plugins/wazo_yealink/v83/var/tftpboot/lang/T27/007.GUI.Polish.lang diff --git a/plugins/wazo-yealink/v83/var/tftpboot/lang/T27/008.GUI.Portuguese.lang b/plugins/wazo_yealink/v83/var/tftpboot/lang/T27/008.GUI.Portuguese.lang similarity index 100% rename from plugins/wazo-yealink/v83/var/tftpboot/lang/T27/008.GUI.Portuguese.lang rename to plugins/wazo_yealink/v83/var/tftpboot/lang/T27/008.GUI.Portuguese.lang diff --git a/plugins/wazo-yealink/v83/var/tftpboot/lang/T27/009.GUI.Portuguese_LA.lang b/plugins/wazo_yealink/v83/var/tftpboot/lang/T27/009.GUI.Portuguese_LA.lang similarity index 100% rename from plugins/wazo-yealink/v83/var/tftpboot/lang/T27/009.GUI.Portuguese_LA.lang rename to plugins/wazo_yealink/v83/var/tftpboot/lang/T27/009.GUI.Portuguese_LA.lang diff --git a/plugins/wazo-yealink/v83/var/tftpboot/lang/T27/010.GUI.Spanish.lang b/plugins/wazo_yealink/v83/var/tftpboot/lang/T27/010.GUI.Spanish.lang similarity index 100% rename from plugins/wazo-yealink/v83/var/tftpboot/lang/T27/010.GUI.Spanish.lang rename to plugins/wazo_yealink/v83/var/tftpboot/lang/T27/010.GUI.Spanish.lang diff --git a/plugins/wazo-yealink/v83/var/tftpboot/lang/T27/011.GUI.Spanish_LA.lang b/plugins/wazo_yealink/v83/var/tftpboot/lang/T27/011.GUI.Spanish_LA.lang similarity index 100% rename from plugins/wazo-yealink/v83/var/tftpboot/lang/T27/011.GUI.Spanish_LA.lang rename to plugins/wazo_yealink/v83/var/tftpboot/lang/T27/011.GUI.Spanish_LA.lang diff --git a/plugins/wazo-yealink/v83/var/tftpboot/lang/T27/012.GUI.Turkish.lang b/plugins/wazo_yealink/v83/var/tftpboot/lang/T27/012.GUI.Turkish.lang similarity index 100% rename from plugins/wazo-yealink/v83/var/tftpboot/lang/T27/012.GUI.Turkish.lang rename to plugins/wazo_yealink/v83/var/tftpboot/lang/T27/012.GUI.Turkish.lang diff --git a/plugins/wazo-yealink/v83/var/tftpboot/lang/T27/013.GUI.Russian.lang b/plugins/wazo_yealink/v83/var/tftpboot/lang/T27/013.GUI.Russian.lang similarity index 100% rename from plugins/wazo-yealink/v83/var/tftpboot/lang/T27/013.GUI.Russian.lang rename to plugins/wazo_yealink/v83/var/tftpboot/lang/T27/013.GUI.Russian.lang diff --git a/plugins/wazo-yealink/v83/var/tftpboot/lang/T29G/000.GUI.English.lang b/plugins/wazo_yealink/v83/var/tftpboot/lang/T29G/000.GUI.English.lang similarity index 100% rename from plugins/wazo-yealink/v83/var/tftpboot/lang/T29G/000.GUI.English.lang rename to plugins/wazo_yealink/v83/var/tftpboot/lang/T29G/000.GUI.English.lang diff --git a/plugins/wazo-yealink/v83/var/tftpboot/lang/T29G/001.GUI.Chinese_S.lang b/plugins/wazo_yealink/v83/var/tftpboot/lang/T29G/001.GUI.Chinese_S.lang similarity index 100% rename from plugins/wazo-yealink/v83/var/tftpboot/lang/T29G/001.GUI.Chinese_S.lang rename to plugins/wazo_yealink/v83/var/tftpboot/lang/T29G/001.GUI.Chinese_S.lang diff --git a/plugins/wazo-yealink/v83/var/tftpboot/lang/T29G/002.GUI.Chinese_T.lang b/plugins/wazo_yealink/v83/var/tftpboot/lang/T29G/002.GUI.Chinese_T.lang similarity index 100% rename from plugins/wazo-yealink/v83/var/tftpboot/lang/T29G/002.GUI.Chinese_T.lang rename to plugins/wazo_yealink/v83/var/tftpboot/lang/T29G/002.GUI.Chinese_T.lang diff --git a/plugins/wazo-yealink/v83/var/tftpboot/lang/T29G/003.GUI.French_CA.lang b/plugins/wazo_yealink/v83/var/tftpboot/lang/T29G/003.GUI.French_CA.lang similarity index 100% rename from plugins/wazo-yealink/v83/var/tftpboot/lang/T29G/003.GUI.French_CA.lang rename to plugins/wazo_yealink/v83/var/tftpboot/lang/T29G/003.GUI.French_CA.lang diff --git a/plugins/wazo-yealink/v83/var/tftpboot/lang/T29G/004.GUI.French.lang b/plugins/wazo_yealink/v83/var/tftpboot/lang/T29G/004.GUI.French.lang similarity index 100% rename from plugins/wazo-yealink/v83/var/tftpboot/lang/T29G/004.GUI.French.lang rename to plugins/wazo_yealink/v83/var/tftpboot/lang/T29G/004.GUI.French.lang diff --git a/plugins/wazo-yealink/v83/var/tftpboot/lang/T29G/005.GUI.German.lang b/plugins/wazo_yealink/v83/var/tftpboot/lang/T29G/005.GUI.German.lang similarity index 100% rename from plugins/wazo-yealink/v83/var/tftpboot/lang/T29G/005.GUI.German.lang rename to plugins/wazo_yealink/v83/var/tftpboot/lang/T29G/005.GUI.German.lang diff --git a/plugins/wazo-yealink/v83/var/tftpboot/lang/T29G/006.GUI.Italian.lang b/plugins/wazo_yealink/v83/var/tftpboot/lang/T29G/006.GUI.Italian.lang similarity index 100% rename from plugins/wazo-yealink/v83/var/tftpboot/lang/T29G/006.GUI.Italian.lang rename to plugins/wazo_yealink/v83/var/tftpboot/lang/T29G/006.GUI.Italian.lang diff --git a/plugins/wazo-yealink/v83/var/tftpboot/lang/T29G/007.GUI.Polish.lang b/plugins/wazo_yealink/v83/var/tftpboot/lang/T29G/007.GUI.Polish.lang similarity index 100% rename from plugins/wazo-yealink/v83/var/tftpboot/lang/T29G/007.GUI.Polish.lang rename to plugins/wazo_yealink/v83/var/tftpboot/lang/T29G/007.GUI.Polish.lang diff --git a/plugins/wazo-yealink/v83/var/tftpboot/lang/T29G/008.GUI.Portuguese.lang b/plugins/wazo_yealink/v83/var/tftpboot/lang/T29G/008.GUI.Portuguese.lang similarity index 100% rename from plugins/wazo-yealink/v83/var/tftpboot/lang/T29G/008.GUI.Portuguese.lang rename to plugins/wazo_yealink/v83/var/tftpboot/lang/T29G/008.GUI.Portuguese.lang diff --git a/plugins/wazo-yealink/v83/var/tftpboot/lang/T29G/009.GUI.Portuguese_LA.lang b/plugins/wazo_yealink/v83/var/tftpboot/lang/T29G/009.GUI.Portuguese_LA.lang similarity index 100% rename from plugins/wazo-yealink/v83/var/tftpboot/lang/T29G/009.GUI.Portuguese_LA.lang rename to plugins/wazo_yealink/v83/var/tftpboot/lang/T29G/009.GUI.Portuguese_LA.lang diff --git a/plugins/wazo-yealink/v83/var/tftpboot/lang/T29G/010.GUI.Spanish.lang b/plugins/wazo_yealink/v83/var/tftpboot/lang/T29G/010.GUI.Spanish.lang similarity index 100% rename from plugins/wazo-yealink/v83/var/tftpboot/lang/T29G/010.GUI.Spanish.lang rename to plugins/wazo_yealink/v83/var/tftpboot/lang/T29G/010.GUI.Spanish.lang diff --git a/plugins/wazo-yealink/v83/var/tftpboot/lang/T29G/011.GUI.Spanish_LA.lang b/plugins/wazo_yealink/v83/var/tftpboot/lang/T29G/011.GUI.Spanish_LA.lang similarity index 100% rename from plugins/wazo-yealink/v83/var/tftpboot/lang/T29G/011.GUI.Spanish_LA.lang rename to plugins/wazo_yealink/v83/var/tftpboot/lang/T29G/011.GUI.Spanish_LA.lang diff --git a/plugins/wazo-yealink/v83/var/tftpboot/lang/T29G/012.GUI.Turkish.lang b/plugins/wazo_yealink/v83/var/tftpboot/lang/T29G/012.GUI.Turkish.lang similarity index 100% rename from plugins/wazo-yealink/v83/var/tftpboot/lang/T29G/012.GUI.Turkish.lang rename to plugins/wazo_yealink/v83/var/tftpboot/lang/T29G/012.GUI.Turkish.lang diff --git a/plugins/wazo-yealink/v83/var/tftpboot/lang/T29G/013.GUI.Russian.lang b/plugins/wazo_yealink/v83/var/tftpboot/lang/T29G/013.GUI.Russian.lang similarity index 100% rename from plugins/wazo-yealink/v83/var/tftpboot/lang/T29G/013.GUI.Russian.lang rename to plugins/wazo_yealink/v83/var/tftpboot/lang/T29G/013.GUI.Russian.lang diff --git a/plugins/wazo-yealink/v83/var/tftpboot/lang/T40/000.GUI.English.lang b/plugins/wazo_yealink/v83/var/tftpboot/lang/T40/000.GUI.English.lang similarity index 100% rename from plugins/wazo-yealink/v83/var/tftpboot/lang/T40/000.GUI.English.lang rename to plugins/wazo_yealink/v83/var/tftpboot/lang/T40/000.GUI.English.lang diff --git a/plugins/wazo-yealink/v83/var/tftpboot/lang/T40/001.GUI.Chinese_S.lang b/plugins/wazo_yealink/v83/var/tftpboot/lang/T40/001.GUI.Chinese_S.lang similarity index 100% rename from plugins/wazo-yealink/v83/var/tftpboot/lang/T40/001.GUI.Chinese_S.lang rename to plugins/wazo_yealink/v83/var/tftpboot/lang/T40/001.GUI.Chinese_S.lang diff --git a/plugins/wazo-yealink/v83/var/tftpboot/lang/T40/002.GUI.Chinese_T.lang b/plugins/wazo_yealink/v83/var/tftpboot/lang/T40/002.GUI.Chinese_T.lang similarity index 100% rename from plugins/wazo-yealink/v83/var/tftpboot/lang/T40/002.GUI.Chinese_T.lang rename to plugins/wazo_yealink/v83/var/tftpboot/lang/T40/002.GUI.Chinese_T.lang diff --git a/plugins/wazo-yealink/v83/var/tftpboot/lang/T40/004.GUI.French.lang b/plugins/wazo_yealink/v83/var/tftpboot/lang/T40/004.GUI.French.lang similarity index 100% rename from plugins/wazo-yealink/v83/var/tftpboot/lang/T40/004.GUI.French.lang rename to plugins/wazo_yealink/v83/var/tftpboot/lang/T40/004.GUI.French.lang diff --git a/plugins/wazo-yealink/v83/var/tftpboot/lang/T40/005.GUI.German.lang b/plugins/wazo_yealink/v83/var/tftpboot/lang/T40/005.GUI.German.lang similarity index 100% rename from plugins/wazo-yealink/v83/var/tftpboot/lang/T40/005.GUI.German.lang rename to plugins/wazo_yealink/v83/var/tftpboot/lang/T40/005.GUI.German.lang diff --git a/plugins/wazo-yealink/v83/var/tftpboot/lang/T40/006.GUI.Italian.lang b/plugins/wazo_yealink/v83/var/tftpboot/lang/T40/006.GUI.Italian.lang similarity index 100% rename from plugins/wazo-yealink/v83/var/tftpboot/lang/T40/006.GUI.Italian.lang rename to plugins/wazo_yealink/v83/var/tftpboot/lang/T40/006.GUI.Italian.lang diff --git a/plugins/wazo-yealink/v83/var/tftpboot/lang/T40/007.GUI.Polish.lang b/plugins/wazo_yealink/v83/var/tftpboot/lang/T40/007.GUI.Polish.lang similarity index 100% rename from plugins/wazo-yealink/v83/var/tftpboot/lang/T40/007.GUI.Polish.lang rename to plugins/wazo_yealink/v83/var/tftpboot/lang/T40/007.GUI.Polish.lang diff --git a/plugins/wazo-yealink/v83/var/tftpboot/lang/T40/008.GUI.Portuguese.lang b/plugins/wazo_yealink/v83/var/tftpboot/lang/T40/008.GUI.Portuguese.lang similarity index 100% rename from plugins/wazo-yealink/v83/var/tftpboot/lang/T40/008.GUI.Portuguese.lang rename to plugins/wazo_yealink/v83/var/tftpboot/lang/T40/008.GUI.Portuguese.lang diff --git a/plugins/wazo-yealink/v83/var/tftpboot/lang/T40/010.GUI.Spanish.lang b/plugins/wazo_yealink/v83/var/tftpboot/lang/T40/010.GUI.Spanish.lang similarity index 100% rename from plugins/wazo-yealink/v83/var/tftpboot/lang/T40/010.GUI.Spanish.lang rename to plugins/wazo_yealink/v83/var/tftpboot/lang/T40/010.GUI.Spanish.lang diff --git a/plugins/wazo-yealink/v83/var/tftpboot/lang/T40/012.GUI.Turkish.lang b/plugins/wazo_yealink/v83/var/tftpboot/lang/T40/012.GUI.Turkish.lang similarity index 100% rename from plugins/wazo-yealink/v83/var/tftpboot/lang/T40/012.GUI.Turkish.lang rename to plugins/wazo_yealink/v83/var/tftpboot/lang/T40/012.GUI.Turkish.lang diff --git a/plugins/wazo-yealink/v83/var/tftpboot/lang/T40/013.GUI.Russian.lang b/plugins/wazo_yealink/v83/var/tftpboot/lang/T40/013.GUI.Russian.lang similarity index 100% rename from plugins/wazo-yealink/v83/var/tftpboot/lang/T40/013.GUI.Russian.lang rename to plugins/wazo_yealink/v83/var/tftpboot/lang/T40/013.GUI.Russian.lang diff --git a/plugins/wazo-yealink/v83/var/tftpboot/lang/T41P-T42G/000.GUI.English.lang b/plugins/wazo_yealink/v83/var/tftpboot/lang/T41P-T42G/000.GUI.English.lang similarity index 100% rename from plugins/wazo-yealink/v83/var/tftpboot/lang/T41P-T42G/000.GUI.English.lang rename to plugins/wazo_yealink/v83/var/tftpboot/lang/T41P-T42G/000.GUI.English.lang diff --git a/plugins/wazo-yealink/v83/var/tftpboot/lang/T41P-T42G/001.GUI.Chinese_S.lang b/plugins/wazo_yealink/v83/var/tftpboot/lang/T41P-T42G/001.GUI.Chinese_S.lang similarity index 100% rename from plugins/wazo-yealink/v83/var/tftpboot/lang/T41P-T42G/001.GUI.Chinese_S.lang rename to plugins/wazo_yealink/v83/var/tftpboot/lang/T41P-T42G/001.GUI.Chinese_S.lang diff --git a/plugins/wazo-yealink/v83/var/tftpboot/lang/T41P-T42G/002.GUI.Chinese_T.lang b/plugins/wazo_yealink/v83/var/tftpboot/lang/T41P-T42G/002.GUI.Chinese_T.lang similarity index 100% rename from plugins/wazo-yealink/v83/var/tftpboot/lang/T41P-T42G/002.GUI.Chinese_T.lang rename to plugins/wazo_yealink/v83/var/tftpboot/lang/T41P-T42G/002.GUI.Chinese_T.lang diff --git a/plugins/wazo-yealink/v83/var/tftpboot/lang/T41P-T42G/004.GUI.French.lang b/plugins/wazo_yealink/v83/var/tftpboot/lang/T41P-T42G/004.GUI.French.lang similarity index 100% rename from plugins/wazo-yealink/v83/var/tftpboot/lang/T41P-T42G/004.GUI.French.lang rename to plugins/wazo_yealink/v83/var/tftpboot/lang/T41P-T42G/004.GUI.French.lang diff --git a/plugins/wazo-yealink/v83/var/tftpboot/lang/T41P-T42G/005.GUI.German.lang b/plugins/wazo_yealink/v83/var/tftpboot/lang/T41P-T42G/005.GUI.German.lang similarity index 100% rename from plugins/wazo-yealink/v83/var/tftpboot/lang/T41P-T42G/005.GUI.German.lang rename to plugins/wazo_yealink/v83/var/tftpboot/lang/T41P-T42G/005.GUI.German.lang diff --git a/plugins/wazo-yealink/v83/var/tftpboot/lang/T41P-T42G/006.GUI.Italian.lang b/plugins/wazo_yealink/v83/var/tftpboot/lang/T41P-T42G/006.GUI.Italian.lang similarity index 100% rename from plugins/wazo-yealink/v83/var/tftpboot/lang/T41P-T42G/006.GUI.Italian.lang rename to plugins/wazo_yealink/v83/var/tftpboot/lang/T41P-T42G/006.GUI.Italian.lang diff --git a/plugins/wazo-yealink/v83/var/tftpboot/lang/T41P-T42G/007.GUI.Polish.lang b/plugins/wazo_yealink/v83/var/tftpboot/lang/T41P-T42G/007.GUI.Polish.lang similarity index 100% rename from plugins/wazo-yealink/v83/var/tftpboot/lang/T41P-T42G/007.GUI.Polish.lang rename to plugins/wazo_yealink/v83/var/tftpboot/lang/T41P-T42G/007.GUI.Polish.lang diff --git a/plugins/wazo-yealink/v83/var/tftpboot/lang/T41P-T42G/008.GUI.Portuguese.lang b/plugins/wazo_yealink/v83/var/tftpboot/lang/T41P-T42G/008.GUI.Portuguese.lang similarity index 100% rename from plugins/wazo-yealink/v83/var/tftpboot/lang/T41P-T42G/008.GUI.Portuguese.lang rename to plugins/wazo_yealink/v83/var/tftpboot/lang/T41P-T42G/008.GUI.Portuguese.lang diff --git a/plugins/wazo-yealink/v83/var/tftpboot/lang/T41P-T42G/010.GUI.Spanish.lang b/plugins/wazo_yealink/v83/var/tftpboot/lang/T41P-T42G/010.GUI.Spanish.lang similarity index 100% rename from plugins/wazo-yealink/v83/var/tftpboot/lang/T41P-T42G/010.GUI.Spanish.lang rename to plugins/wazo_yealink/v83/var/tftpboot/lang/T41P-T42G/010.GUI.Spanish.lang diff --git a/plugins/wazo-yealink/v83/var/tftpboot/lang/T41P-T42G/012.GUI.Turkish.lang b/plugins/wazo_yealink/v83/var/tftpboot/lang/T41P-T42G/012.GUI.Turkish.lang similarity index 100% rename from plugins/wazo-yealink/v83/var/tftpboot/lang/T41P-T42G/012.GUI.Turkish.lang rename to plugins/wazo_yealink/v83/var/tftpboot/lang/T41P-T42G/012.GUI.Turkish.lang diff --git a/plugins/wazo-yealink/v83/var/tftpboot/lang/T41P-T42G/013.GUI.Russian.lang b/plugins/wazo_yealink/v83/var/tftpboot/lang/T41P-T42G/013.GUI.Russian.lang similarity index 100% rename from plugins/wazo-yealink/v83/var/tftpboot/lang/T41P-T42G/013.GUI.Russian.lang rename to plugins/wazo_yealink/v83/var/tftpboot/lang/T41P-T42G/013.GUI.Russian.lang diff --git a/plugins/wazo-yealink/v83/var/tftpboot/lang/T41S-T42S/000.GUI.English.lang b/plugins/wazo_yealink/v83/var/tftpboot/lang/T41S-T42S/000.GUI.English.lang similarity index 100% rename from plugins/wazo-yealink/v83/var/tftpboot/lang/T41S-T42S/000.GUI.English.lang rename to plugins/wazo_yealink/v83/var/tftpboot/lang/T41S-T42S/000.GUI.English.lang diff --git a/plugins/wazo-yealink/v83/var/tftpboot/lang/T41S-T42S/001.GUI.Chinese_S.lang b/plugins/wazo_yealink/v83/var/tftpboot/lang/T41S-T42S/001.GUI.Chinese_S.lang similarity index 100% rename from plugins/wazo-yealink/v83/var/tftpboot/lang/T41S-T42S/001.GUI.Chinese_S.lang rename to plugins/wazo_yealink/v83/var/tftpboot/lang/T41S-T42S/001.GUI.Chinese_S.lang diff --git a/plugins/wazo-yealink/v83/var/tftpboot/lang/T41S-T42S/002.GUI.Chinese_T.lang b/plugins/wazo_yealink/v83/var/tftpboot/lang/T41S-T42S/002.GUI.Chinese_T.lang similarity index 100% rename from plugins/wazo-yealink/v83/var/tftpboot/lang/T41S-T42S/002.GUI.Chinese_T.lang rename to plugins/wazo_yealink/v83/var/tftpboot/lang/T41S-T42S/002.GUI.Chinese_T.lang diff --git a/plugins/wazo-yealink/v83/var/tftpboot/lang/T41S-T42S/003.GUI.French_CA.lang b/plugins/wazo_yealink/v83/var/tftpboot/lang/T41S-T42S/003.GUI.French_CA.lang similarity index 100% rename from plugins/wazo-yealink/v83/var/tftpboot/lang/T41S-T42S/003.GUI.French_CA.lang rename to plugins/wazo_yealink/v83/var/tftpboot/lang/T41S-T42S/003.GUI.French_CA.lang diff --git a/plugins/wazo-yealink/v83/var/tftpboot/lang/T41S-T42S/004.GUI.French.lang b/plugins/wazo_yealink/v83/var/tftpboot/lang/T41S-T42S/004.GUI.French.lang similarity index 100% rename from plugins/wazo-yealink/v83/var/tftpboot/lang/T41S-T42S/004.GUI.French.lang rename to plugins/wazo_yealink/v83/var/tftpboot/lang/T41S-T42S/004.GUI.French.lang diff --git a/plugins/wazo-yealink/v83/var/tftpboot/lang/T41S-T42S/005.GUI.German.lang b/plugins/wazo_yealink/v83/var/tftpboot/lang/T41S-T42S/005.GUI.German.lang similarity index 100% rename from plugins/wazo-yealink/v83/var/tftpboot/lang/T41S-T42S/005.GUI.German.lang rename to plugins/wazo_yealink/v83/var/tftpboot/lang/T41S-T42S/005.GUI.German.lang diff --git a/plugins/wazo-yealink/v83/var/tftpboot/lang/T41S-T42S/006.GUI.Italian.lang b/plugins/wazo_yealink/v83/var/tftpboot/lang/T41S-T42S/006.GUI.Italian.lang similarity index 100% rename from plugins/wazo-yealink/v83/var/tftpboot/lang/T41S-T42S/006.GUI.Italian.lang rename to plugins/wazo_yealink/v83/var/tftpboot/lang/T41S-T42S/006.GUI.Italian.lang diff --git a/plugins/wazo-yealink/v83/var/tftpboot/lang/T41S-T42S/007.GUI.Polish.lang b/plugins/wazo_yealink/v83/var/tftpboot/lang/T41S-T42S/007.GUI.Polish.lang similarity index 100% rename from plugins/wazo-yealink/v83/var/tftpboot/lang/T41S-T42S/007.GUI.Polish.lang rename to plugins/wazo_yealink/v83/var/tftpboot/lang/T41S-T42S/007.GUI.Polish.lang diff --git a/plugins/wazo-yealink/v83/var/tftpboot/lang/T41S-T42S/008.GUI.Portuguese.lang b/plugins/wazo_yealink/v83/var/tftpboot/lang/T41S-T42S/008.GUI.Portuguese.lang similarity index 100% rename from plugins/wazo-yealink/v83/var/tftpboot/lang/T41S-T42S/008.GUI.Portuguese.lang rename to plugins/wazo_yealink/v83/var/tftpboot/lang/T41S-T42S/008.GUI.Portuguese.lang diff --git a/plugins/wazo-yealink/v83/var/tftpboot/lang/T41S-T42S/009.GUI.Portuguese_LA.lang b/plugins/wazo_yealink/v83/var/tftpboot/lang/T41S-T42S/009.GUI.Portuguese_LA.lang similarity index 100% rename from plugins/wazo-yealink/v83/var/tftpboot/lang/T41S-T42S/009.GUI.Portuguese_LA.lang rename to plugins/wazo_yealink/v83/var/tftpboot/lang/T41S-T42S/009.GUI.Portuguese_LA.lang diff --git a/plugins/wazo-yealink/v83/var/tftpboot/lang/T41S-T42S/010.GUI.Spanish.lang b/plugins/wazo_yealink/v83/var/tftpboot/lang/T41S-T42S/010.GUI.Spanish.lang similarity index 100% rename from plugins/wazo-yealink/v83/var/tftpboot/lang/T41S-T42S/010.GUI.Spanish.lang rename to plugins/wazo_yealink/v83/var/tftpboot/lang/T41S-T42S/010.GUI.Spanish.lang diff --git a/plugins/wazo-yealink/v83/var/tftpboot/lang/T41S-T42S/011.GUI.Spanish_LA.lang b/plugins/wazo_yealink/v83/var/tftpboot/lang/T41S-T42S/011.GUI.Spanish_LA.lang similarity index 100% rename from plugins/wazo-yealink/v83/var/tftpboot/lang/T41S-T42S/011.GUI.Spanish_LA.lang rename to plugins/wazo_yealink/v83/var/tftpboot/lang/T41S-T42S/011.GUI.Spanish_LA.lang diff --git a/plugins/wazo_yealink/v84/__init__.py b/plugins/wazo_yealink/v84/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/plugins/wazo-yealink/v84/common.py b/plugins/wazo_yealink/v84/common.py similarity index 99% rename from plugins/wazo-yealink/v84/common.py rename to plugins/wazo_yealink/v84/common.py index 91a4f52db9ea361cb8a77b881dea6873862d500c..4a3d5cef577ec6d61551741d061663eed00889e3 100644 --- a/plugins/wazo-yealink/v84/common.py +++ b/plugins/wazo_yealink/v84/common.py @@ -352,6 +352,7 @@ class BaseYealinkPlugin(StandardPlugin): http_dev_info_extractor = BaseYealinkHTTPDeviceInfoExtractor() def configure_common(self, raw_config): + self._add_server_url(raw_config) for filename, fw_filename, tpl_filename in self._COMMON_FILES: tpl = self._tpl_helper.get_template(f'common/{tpl_filename}') dst = os.path.join(self._tftpboot_dir, filename) diff --git a/plugins/wazo-yealink/v84/entry.py b/plugins/wazo_yealink/v84/entry.py similarity index 100% rename from plugins/wazo-yealink/v84/entry.py rename to plugins/wazo_yealink/v84/entry.py diff --git a/plugins/wazo-yealink/v84/pkgs/pkgs.db b/plugins/wazo_yealink/v84/pkgs/pkgs.db similarity index 100% rename from plugins/wazo-yealink/v84/pkgs/pkgs.db rename to plugins/wazo_yealink/v84/pkgs/pkgs.db diff --git a/plugins/wazo-yealink/v84/plugin-info b/plugins/wazo_yealink/v84/plugin-info similarity index 99% rename from plugins/wazo-yealink/v84/plugin-info rename to plugins/wazo_yealink/v84/plugin-info index 827a07e28431d19153addaeab0164afa5fe073e7..16e4990e8dca23b628cc6bc5418aec02fff4a4b9 100644 --- a/plugins/wazo-yealink/v84/plugin-info +++ b/plugins/wazo_yealink/v84/plugin-info @@ -1,5 +1,5 @@ { - "version": "1.1.2", + "version": "1.1.3", "description": "Plugin for Yealink for CP920, CP960, T19P_E2, T21P_E2, T23P/G, T27G, T40P/G, T41S, T42S, T46S, T48S, T52S, T53(W), T54S/W, T57(W) and T58A in version V84.", "description_fr": "Greffon pour Yealink pour CP920, CP960, T19P_E2, T21P_E2, T23P/G, T27G, T40P/G, T41S, T42S, T46S, T48S, T52S, T53(W), T54S/W, T57(W) et T58A en version V84.", "vendor" : "Yealink", diff --git a/plugins/wazo-yealink/v84/templates/CP920.tpl b/plugins/wazo_yealink/v84/templates/CP920.tpl similarity index 100% rename from plugins/wazo-yealink/v84/templates/CP920.tpl rename to plugins/wazo_yealink/v84/templates/CP920.tpl diff --git a/plugins/wazo-yealink/v84/templates/CP960.tpl b/plugins/wazo_yealink/v84/templates/CP960.tpl similarity index 100% rename from plugins/wazo-yealink/v84/templates/CP960.tpl rename to plugins/wazo_yealink/v84/templates/CP960.tpl diff --git a/plugins/wazo-yealink/v84/templates/T19P_E2.tpl b/plugins/wazo_yealink/v84/templates/T19P_E2.tpl similarity index 100% rename from plugins/wazo-yealink/v84/templates/T19P_E2.tpl rename to plugins/wazo_yealink/v84/templates/T19P_E2.tpl diff --git a/plugins/wazo-yealink/v84/templates/T21P_E2.tpl b/plugins/wazo_yealink/v84/templates/T21P_E2.tpl similarity index 100% rename from plugins/wazo-yealink/v84/templates/T21P_E2.tpl rename to plugins/wazo_yealink/v84/templates/T21P_E2.tpl diff --git a/plugins/wazo-yealink/v84/templates/T23G.tpl b/plugins/wazo_yealink/v84/templates/T23G.tpl similarity index 100% rename from plugins/wazo-yealink/v84/templates/T23G.tpl rename to plugins/wazo_yealink/v84/templates/T23G.tpl diff --git a/plugins/wazo-yealink/v84/templates/T23P.tpl b/plugins/wazo_yealink/v84/templates/T23P.tpl similarity index 100% rename from plugins/wazo-yealink/v84/templates/T23P.tpl rename to plugins/wazo_yealink/v84/templates/T23P.tpl diff --git a/plugins/wazo-yealink/v84/templates/T27G.tpl b/plugins/wazo_yealink/v84/templates/T27G.tpl similarity index 100% rename from plugins/wazo-yealink/v84/templates/T27G.tpl rename to plugins/wazo_yealink/v84/templates/T27G.tpl diff --git a/plugins/wazo-yealink/v84/templates/T40G.tpl b/plugins/wazo_yealink/v84/templates/T40G.tpl similarity index 100% rename from plugins/wazo-yealink/v84/templates/T40G.tpl rename to plugins/wazo_yealink/v84/templates/T40G.tpl diff --git a/plugins/wazo-yealink/v84/templates/T40P.tpl b/plugins/wazo_yealink/v84/templates/T40P.tpl similarity index 100% rename from plugins/wazo-yealink/v84/templates/T40P.tpl rename to plugins/wazo_yealink/v84/templates/T40P.tpl diff --git a/plugins/wazo-yealink/v84/templates/T41S.tpl b/plugins/wazo_yealink/v84/templates/T41S.tpl similarity index 100% rename from plugins/wazo-yealink/v84/templates/T41S.tpl rename to plugins/wazo_yealink/v84/templates/T41S.tpl diff --git a/plugins/wazo-yealink/v84/templates/T42S.tpl b/plugins/wazo_yealink/v84/templates/T42S.tpl similarity index 100% rename from plugins/wazo-yealink/v84/templates/T42S.tpl rename to plugins/wazo_yealink/v84/templates/T42S.tpl diff --git a/plugins/wazo-yealink/v84/templates/T46S.tpl b/plugins/wazo_yealink/v84/templates/T46S.tpl similarity index 100% rename from plugins/wazo-yealink/v84/templates/T46S.tpl rename to plugins/wazo_yealink/v84/templates/T46S.tpl diff --git a/plugins/wazo-yealink/v84/templates/T48S.tpl b/plugins/wazo_yealink/v84/templates/T48S.tpl similarity index 100% rename from plugins/wazo-yealink/v84/templates/T48S.tpl rename to plugins/wazo_yealink/v84/templates/T48S.tpl diff --git a/plugins/wazo-yealink/v84/templates/T52S.tpl b/plugins/wazo_yealink/v84/templates/T52S.tpl similarity index 100% rename from plugins/wazo-yealink/v84/templates/T52S.tpl rename to plugins/wazo_yealink/v84/templates/T52S.tpl diff --git a/plugins/wazo-yealink/v84/templates/T53.tpl b/plugins/wazo_yealink/v84/templates/T53.tpl similarity index 100% rename from plugins/wazo-yealink/v84/templates/T53.tpl rename to plugins/wazo_yealink/v84/templates/T53.tpl diff --git a/plugins/wazo-yealink/v84/templates/T53W.tpl b/plugins/wazo_yealink/v84/templates/T53W.tpl similarity index 100% rename from plugins/wazo-yealink/v84/templates/T53W.tpl rename to plugins/wazo_yealink/v84/templates/T53W.tpl diff --git a/plugins/wazo-yealink/v84/templates/T54S.tpl b/plugins/wazo_yealink/v84/templates/T54S.tpl similarity index 100% rename from plugins/wazo-yealink/v84/templates/T54S.tpl rename to plugins/wazo_yealink/v84/templates/T54S.tpl diff --git a/plugins/wazo-yealink/v84/templates/T54W.tpl b/plugins/wazo_yealink/v84/templates/T54W.tpl similarity index 100% rename from plugins/wazo-yealink/v84/templates/T54W.tpl rename to plugins/wazo_yealink/v84/templates/T54W.tpl diff --git a/plugins/wazo-yealink/v84/templates/T57W.tpl b/plugins/wazo_yealink/v84/templates/T57W.tpl similarity index 100% rename from plugins/wazo-yealink/v84/templates/T57W.tpl rename to plugins/wazo_yealink/v84/templates/T57W.tpl diff --git a/plugins/wazo-yealink/v84/templates/T58.tpl b/plugins/wazo_yealink/v84/templates/T58.tpl similarity index 100% rename from plugins/wazo-yealink/v84/templates/T58.tpl rename to plugins/wazo_yealink/v84/templates/T58.tpl diff --git a/plugins/wazo-yealink/v84/templates/base.tpl b/plugins/wazo_yealink/v84/templates/base.tpl similarity index 100% rename from plugins/wazo-yealink/v84/templates/base.tpl rename to plugins/wazo_yealink/v84/templates/base.tpl diff --git a/plugins/wazo-yealink/v84/templates/common/model.tpl b/plugins/wazo_yealink/v84/templates/common/model.tpl similarity index 100% rename from plugins/wazo-yealink/v84/templates/common/model.tpl rename to plugins/wazo_yealink/v84/templates/common/model.tpl diff --git a/plugins/wazo_yealink/v84/tests/__init__.py b/plugins/wazo_yealink/v84/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/plugins/wazo-yealink/v84/tests/conftest.py b/plugins/wazo_yealink/v84/tests/conftest.py similarity index 79% rename from plugins/wazo-yealink/v84/tests/conftest.py rename to plugins/wazo_yealink/v84/tests/conftest.py index c1556e1a9a3ea6fe9d2d560e84588dd27a23b446..ab11e12f0cbae0bcec8b13c6afa3514dd9672368 100644 --- a/plugins/wazo-yealink/v84/tests/conftest.py +++ b/plugins/wazo_yealink/v84/tests/conftest.py @@ -15,7 +15,7 @@ def v84_entry(module_initializer): @pytest.fixture def v84_plugin(v84_entry): - with patch('v84.common.FetchfwPluginHelper'), patch( - 'v84.common.TemplatePluginHelper' + with patch('plugins.wazo_yealink.v84.common.FetchfwPluginHelper'), patch( + 'plugins.wazo_yealink.v84.common.TemplatePluginHelper' ): yield v84_entry.YealinkPlugin(MagicMock(), 'test_dir', MagicMock(), MagicMock()) diff --git a/plugins/wazo-yealink/v84/tests/test_common.py b/plugins/wazo_yealink/v84/tests/test_common.py similarity index 96% rename from plugins/wazo-yealink/v84/tests/test_common.py rename to plugins/wazo_yealink/v84/tests/test_common.py index 0e47dd86693717de48e90e92a036a8b485337fe2..821486126f7e1b7d61aa41ee10ad77d9a623e076 100644 --- a/plugins/wazo-yealink/v84/tests/test_common.py +++ b/plugins/wazo_yealink/v84/tests/test_common.py @@ -71,7 +71,7 @@ class TestInfoExtraction: def test_http_ua_extractor_when_no_info(self): assert self.http_info_extractor._extract_from_ua('') is None - @patch('v84.common.defer') + @patch('plugins.wazo_yealink.v84.common.defer') def test_extract(self, mocked_defer): self.http_info_extractor.extract( self._mock_request(b'Yealink SIP-T31G 124.85.257.55 80:5e:c0:d5:7d:72'), @@ -100,7 +100,7 @@ class TestInfoExtraction: self._mock_request(path=path) ) == {'mac': mac} - @patch('v84.common.logger') + @patch('plugins.wazo_yealink.v84.common.logger') def test_invalid_mac(self, mocked_logger): self.http_info_extractor._extract_from_ua( 'Yealink SIP-T20P 9.72.0.30 00:15:6525ef16a7c' @@ -159,7 +159,7 @@ class TestPluginAssociation: class TestPlugin: - @patch('v84.common.FetchfwPluginHelper') + @patch('plugins.wazo_yealink.v84.common.FetchfwPluginHelper') def test_init(self, fetch_fw, v84_entry): fetch_fw.return_value.services.return_value = sentinel.fetchfw_services fetch_fw.new_downloaders.return_value = sentinel.fetchfw_downloaders @@ -170,7 +170,7 @@ class TestPlugin: fetch_fw.assert_called_once_with('test_dir', sentinel.fetchfw_downloaders) def test_common_configure(self, v84_plugin): - raw_config = {} + raw_config = {'http_base_url': 'http://localhost:8667'} v84_plugin._tpl_helper.get_template.return_value = 'template' v84_plugin.configure_common(raw_config) v84_plugin._tpl_helper.get_template.assert_called_with('common/model.tpl') @@ -205,14 +205,14 @@ class TestPlugin: v84_plugin.deconfigure({'mac': '80:5e:c0:d5:7d:72'}) mocked_remove.assert_called_with('test_dir/var/tftpboot/805ec0d57d72.cfg') - @patch('v84.common.logger') + @patch('plugins.wazo_yealink.v84.common.logger') def test_deconfigure_no_file(self, mocked_logger, v84_plugin): v84_plugin.deconfigure({'mac': '00:00:00:00:00:00'}) message, exception = mocked_logger.info.call_args[0] assert message == 'error while removing file: %s' assert isinstance(exception, FileNotFoundError) - @patch('v84.common.synchronize') + @patch('plugins.wazo_yealink.v84.common.synchronize') def test_synchronize(self, provd_synchronize, v84_plugin): device = {'mac': '80:5e:c0:d5:7d:72'} v84_plugin.synchronize(device, {}) @@ -246,7 +246,7 @@ class TestPlugin: with pytest.raises(Exception): v84_plugin._check_device({}) - @patch('v84.common.plugins') + @patch('plugins.wazo_yealink.v84.common.plugins') def test_phonebook_url(self, provd_plugins, v84_plugin): raw_config = {'config_version': 1} v84_plugin._add_xivo_phonebook_url(raw_config) @@ -287,7 +287,7 @@ class TestPlugin: '3': None, } - @patch('v84.common.logger') + @patch('plugins.wazo_yealink.v84.common.logger') def test_timezones(self, mocked_logger, v84_plugin): raw_config = {'timezone': 'America/Montreal'} v84_plugin._add_timezone(raw_config) @@ -323,7 +323,7 @@ class TestPlugin: assert message == 'Unknown timezone: %s' assert isinstance(exception, TimezoneNotFoundError) - @patch('v84.common.logger') + @patch('plugins.wazo_yealink.v84.common.logger') def test_function_keys(self, mocked_logger, v84_plugin): raw_config = { 'funckeys': { diff --git a/plugins/wazo-yealink/v84/var/tftpboot/directory_setting.xml b/plugins/wazo_yealink/v84/var/tftpboot/directory_setting.xml similarity index 100% rename from plugins/wazo-yealink/v84/var/tftpboot/directory_setting.xml rename to plugins/wazo_yealink/v84/var/tftpboot/directory_setting.xml diff --git a/plugins/wazo_yealink/v85/__init__.py b/plugins/wazo_yealink/v85/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/plugins/wazo-yealink/v85/common.py b/plugins/wazo_yealink/v85/common.py similarity index 99% rename from plugins/wazo-yealink/v85/common.py rename to plugins/wazo_yealink/v85/common.py index b769bebc6541d96b60d539ca018ce8c768d2b2c8..32b53e230774094ec4e328fc7f9215f8d1e5875b 100644 --- a/plugins/wazo-yealink/v85/common.py +++ b/plugins/wazo_yealink/v85/common.py @@ -363,6 +363,7 @@ class BaseYealinkPlugin(StandardPlugin): http_dev_info_extractor = BaseYealinkHTTPDeviceInfoExtractor() def configure_common(self, raw_config): + self._add_server_url(raw_config) for filename, fw_filename, tpl_filename in self._COMMON_FILES: tpl = self._tpl_helper.get_template(f'common/{tpl_filename}') dst = os.path.join(self._tftpboot_dir, filename) diff --git a/plugins/wazo-yealink/v85/entry.py b/plugins/wazo_yealink/v85/entry.py similarity index 100% rename from plugins/wazo-yealink/v85/entry.py rename to plugins/wazo_yealink/v85/entry.py diff --git a/plugins/wazo-yealink/v85/pkgs/pkgs.db b/plugins/wazo_yealink/v85/pkgs/pkgs.db similarity index 100% rename from plugins/wazo-yealink/v85/pkgs/pkgs.db rename to plugins/wazo_yealink/v85/pkgs/pkgs.db diff --git a/plugins/wazo-yealink/v85/plugin-info b/plugins/wazo_yealink/v85/plugin-info similarity index 99% rename from plugins/wazo-yealink/v85/plugin-info rename to plugins/wazo_yealink/v85/plugin-info index 78f1ca0c4edd63ff8c9077df786dfc077479ba63..1962668e74204d729adaa25214df3fae5a386acd 100644 --- a/plugins/wazo-yealink/v85/plugin-info +++ b/plugins/wazo_yealink/v85/plugin-info @@ -1,5 +1,5 @@ { - "version": "1.1.3", + "version": "1.1.4", "description": "Plugin for Yealink for CP920, CP960, T2X, T3X, T4X, T5X, W60, W70 and W90 series in version V85.", "description_fr": "Greffon pour Yealink pour les series CP920, CP960, T2X, T3X, T4X, T5X, W60, W70 et W90 en version V85.", "vendor" : "Yealink", diff --git a/plugins/wazo-yealink/v85/templates/CP920.tpl b/plugins/wazo_yealink/v85/templates/CP920.tpl similarity index 100% rename from plugins/wazo-yealink/v85/templates/CP920.tpl rename to plugins/wazo_yealink/v85/templates/CP920.tpl diff --git a/plugins/wazo-yealink/v85/templates/CP960.tpl b/plugins/wazo_yealink/v85/templates/CP960.tpl similarity index 100% rename from plugins/wazo-yealink/v85/templates/CP960.tpl rename to plugins/wazo_yealink/v85/templates/CP960.tpl diff --git a/plugins/wazo-yealink/v85/templates/T27G.tpl b/plugins/wazo_yealink/v85/templates/T27G.tpl similarity index 100% rename from plugins/wazo-yealink/v85/templates/T27G.tpl rename to plugins/wazo_yealink/v85/templates/T27G.tpl diff --git a/plugins/wazo-yealink/v85/templates/T30.tpl b/plugins/wazo_yealink/v85/templates/T30.tpl similarity index 100% rename from plugins/wazo-yealink/v85/templates/T30.tpl rename to plugins/wazo_yealink/v85/templates/T30.tpl diff --git a/plugins/wazo-yealink/v85/templates/T30P.tpl b/plugins/wazo_yealink/v85/templates/T30P.tpl similarity index 100% rename from plugins/wazo-yealink/v85/templates/T30P.tpl rename to plugins/wazo_yealink/v85/templates/T30P.tpl diff --git a/plugins/wazo-yealink/v85/templates/T31.tpl b/plugins/wazo_yealink/v85/templates/T31.tpl similarity index 100% rename from plugins/wazo-yealink/v85/templates/T31.tpl rename to plugins/wazo_yealink/v85/templates/T31.tpl diff --git a/plugins/wazo-yealink/v85/templates/T31G.tpl b/plugins/wazo_yealink/v85/templates/T31G.tpl similarity index 100% rename from plugins/wazo-yealink/v85/templates/T31G.tpl rename to plugins/wazo_yealink/v85/templates/T31G.tpl diff --git a/plugins/wazo-yealink/v85/templates/T31P.tpl b/plugins/wazo_yealink/v85/templates/T31P.tpl similarity index 100% rename from plugins/wazo-yealink/v85/templates/T31P.tpl rename to plugins/wazo_yealink/v85/templates/T31P.tpl diff --git a/plugins/wazo-yealink/v85/templates/T33G.tpl b/plugins/wazo_yealink/v85/templates/T31W.tpl similarity index 100% rename from plugins/wazo-yealink/v85/templates/T33G.tpl rename to plugins/wazo_yealink/v85/templates/T31W.tpl diff --git a/plugins/wazo-yealink/v86/templates/T33G.tpl b/plugins/wazo_yealink/v85/templates/T33G.tpl similarity index 100% rename from plugins/wazo-yealink/v86/templates/T33G.tpl rename to plugins/wazo_yealink/v85/templates/T33G.tpl diff --git a/plugins/wazo-yealink/v85/templates/T33P.tpl b/plugins/wazo_yealink/v85/templates/T33P.tpl similarity index 100% rename from plugins/wazo-yealink/v85/templates/T33P.tpl rename to plugins/wazo_yealink/v85/templates/T33P.tpl diff --git a/plugins/wazo-yealink/v86/templates/T30.tpl b/plugins/wazo_yealink/v85/templates/T34W.tpl similarity index 100% rename from plugins/wazo-yealink/v86/templates/T30.tpl rename to plugins/wazo_yealink/v85/templates/T34W.tpl diff --git a/plugins/wazo-yealink/v85/templates/T41S.tpl b/plugins/wazo_yealink/v85/templates/T41S.tpl similarity index 100% rename from plugins/wazo-yealink/v85/templates/T41S.tpl rename to plugins/wazo_yealink/v85/templates/T41S.tpl diff --git a/plugins/wazo-yealink/v85/templates/T42S.tpl b/plugins/wazo_yealink/v85/templates/T42S.tpl similarity index 100% rename from plugins/wazo-yealink/v85/templates/T42S.tpl rename to plugins/wazo_yealink/v85/templates/T42S.tpl diff --git a/plugins/wazo-yealink/v85/templates/T46S.tpl b/plugins/wazo_yealink/v85/templates/T46S.tpl similarity index 100% rename from plugins/wazo-yealink/v85/templates/T46S.tpl rename to plugins/wazo_yealink/v85/templates/T46S.tpl diff --git a/plugins/wazo-yealink/v85/templates/T48S.tpl b/plugins/wazo_yealink/v85/templates/T48S.tpl similarity index 100% rename from plugins/wazo-yealink/v85/templates/T48S.tpl rename to plugins/wazo_yealink/v85/templates/T48S.tpl diff --git a/plugins/wazo-yealink/v85/templates/T53.tpl b/plugins/wazo_yealink/v85/templates/T53.tpl similarity index 100% rename from plugins/wazo-yealink/v85/templates/T53.tpl rename to plugins/wazo_yealink/v85/templates/T53.tpl diff --git a/plugins/wazo-yealink/v85/templates/T53W.tpl b/plugins/wazo_yealink/v85/templates/T53W.tpl similarity index 100% rename from plugins/wazo-yealink/v85/templates/T53W.tpl rename to plugins/wazo_yealink/v85/templates/T53W.tpl diff --git a/plugins/wazo-yealink/v85/templates/T54W.tpl b/plugins/wazo_yealink/v85/templates/T54W.tpl similarity index 100% rename from plugins/wazo-yealink/v85/templates/T54W.tpl rename to plugins/wazo_yealink/v85/templates/T54W.tpl diff --git a/plugins/wazo-yealink/v85/templates/T57W.tpl b/plugins/wazo_yealink/v85/templates/T57W.tpl similarity index 100% rename from plugins/wazo-yealink/v85/templates/T57W.tpl rename to plugins/wazo_yealink/v85/templates/T57W.tpl diff --git a/plugins/wazo-yealink/v85/templates/T58.tpl b/plugins/wazo_yealink/v85/templates/T58.tpl similarity index 100% rename from plugins/wazo-yealink/v85/templates/T58.tpl rename to plugins/wazo_yealink/v85/templates/T58.tpl diff --git a/plugins/wazo-yealink/v85/templates/W60B.tpl b/plugins/wazo_yealink/v85/templates/W60B.tpl similarity index 100% rename from plugins/wazo-yealink/v85/templates/W60B.tpl rename to plugins/wazo_yealink/v85/templates/W60B.tpl diff --git a/plugins/wazo-yealink/v85/templates/W70B.tpl b/plugins/wazo_yealink/v85/templates/W70B.tpl similarity index 100% rename from plugins/wazo-yealink/v85/templates/W70B.tpl rename to plugins/wazo_yealink/v85/templates/W70B.tpl diff --git a/plugins/wazo-yealink/v85/templates/W90B.tpl b/plugins/wazo_yealink/v85/templates/W90B.tpl similarity index 100% rename from plugins/wazo-yealink/v85/templates/W90B.tpl rename to plugins/wazo_yealink/v85/templates/W90B.tpl diff --git a/plugins/wazo-yealink/v85/templates/W90DM.tpl b/plugins/wazo_yealink/v85/templates/W90DM.tpl similarity index 100% rename from plugins/wazo-yealink/v85/templates/W90DM.tpl rename to plugins/wazo_yealink/v85/templates/W90DM.tpl diff --git a/plugins/wazo-yealink/v85/templates/base.tpl b/plugins/wazo_yealink/v85/templates/base.tpl similarity index 100% rename from plugins/wazo-yealink/v85/templates/base.tpl rename to plugins/wazo_yealink/v85/templates/base.tpl diff --git a/plugins/wazo-yealink/v85/templates/common/dect_model.tpl b/plugins/wazo_yealink/v85/templates/common/dect_model.tpl similarity index 100% rename from plugins/wazo-yealink/v85/templates/common/dect_model.tpl rename to plugins/wazo_yealink/v85/templates/common/dect_model.tpl diff --git a/plugins/wazo-yealink/v85/templates/common/model.tpl b/plugins/wazo_yealink/v85/templates/common/model.tpl similarity index 100% rename from plugins/wazo-yealink/v85/templates/common/model.tpl rename to plugins/wazo_yealink/v85/templates/common/model.tpl diff --git a/plugins/wazo_yealink/v85/tests/__init__.py b/plugins/wazo_yealink/v85/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/plugins/wazo-yealink/v85/tests/conftest.py b/plugins/wazo_yealink/v85/tests/conftest.py similarity index 79% rename from plugins/wazo-yealink/v85/tests/conftest.py rename to plugins/wazo_yealink/v85/tests/conftest.py index 7211cd7c6b5fd619ecb1e78d0cccbe6c03cedbe4..e999a0959ba79307c50ddb359893510b89a892e0 100644 --- a/plugins/wazo-yealink/v85/tests/conftest.py +++ b/plugins/wazo_yealink/v85/tests/conftest.py @@ -15,7 +15,7 @@ def v85_entry(module_initializer): @pytest.fixture def v85_plugin(v85_entry): - with patch('v85.common.FetchfwPluginHelper'), patch( - 'v85.common.TemplatePluginHelper' + with patch('plugins.wazo_yealink.v85.common.FetchfwPluginHelper'), patch( + 'plugins.wazo_yealink.v85.common.TemplatePluginHelper' ): yield v85_entry.YealinkPlugin(MagicMock(), 'test_dir', MagicMock(), MagicMock()) diff --git a/plugins/wazo-yealink/v85/tests/test_common.py b/plugins/wazo_yealink/v85/tests/test_common.py similarity index 96% rename from plugins/wazo-yealink/v85/tests/test_common.py rename to plugins/wazo_yealink/v85/tests/test_common.py index aeba38c7a39a32c373f4028563ad52b9c08d4038..548c72c6c9957d5116c2d488aba68f135adbb0b1 100644 --- a/plugins/wazo-yealink/v85/tests/test_common.py +++ b/plugins/wazo_yealink/v85/tests/test_common.py @@ -66,7 +66,7 @@ class TestInfoExtraction: def test_http_ua_extractor_when_no_info(self): assert self.http_info_extractor._extract_from_ua('') is None - @patch('v85.common.defer') + @patch('plugins.wazo_yealink.v85.common.defer') def test_extract(self, mocked_defer): self.http_info_extractor.extract( self._mock_request(b'Yealink SIP-T31G 124.85.257.55 80:5e:c0:d5:7d:72'), @@ -94,7 +94,7 @@ class TestInfoExtraction: self._mock_request(path=path) ) == {'mac': mac} - @patch('v85.common.logger') + @patch('plugins.wazo_yealink.v85.common.logger') def test_invalid_mac(self, mocked_logger): self.http_info_extractor._extract_from_ua( 'Yealink SIP-T20P 9.72.0.30 00:15:6525ef16a7c' @@ -153,7 +153,7 @@ class TestPluginAssociation: class TestPlugin: - @patch('v85.common.FetchfwPluginHelper') + @patch('plugins.wazo_yealink.v85.common.FetchfwPluginHelper') def test_init(self, fetch_fw, v85_entry): fetch_fw.return_value.services.return_value = sentinel.fetchfw_services fetch_fw.new_downloaders.return_value = sentinel.fetchfw_downloaders @@ -164,7 +164,7 @@ class TestPlugin: fetch_fw.assert_called_once_with('test_dir', sentinel.fetchfw_downloaders) def test_common_configure(self, v85_plugin): - raw_config = {} + raw_config = {'http_base_url': 'http://localhost:8667'} v85_plugin._tpl_helper.get_template.return_value = 'template' v85_plugin.configure_common(raw_config) v85_plugin._tpl_helper.get_template.assert_called_with('common/dect_model.tpl') @@ -199,14 +199,14 @@ class TestPlugin: v85_plugin.deconfigure({'mac': '80:5e:c0:d5:7d:72'}) mocked_remove.assert_called_with('test_dir/var/tftpboot/805ec0d57d72.cfg') - @patch('v85.common.logger') + @patch('plugins.wazo_yealink.v85.common.logger') def test_deconfigure_no_file(self, mocked_logger, v85_plugin): v85_plugin.deconfigure({'mac': '00:00:00:00:00:00'}) message, exception = mocked_logger.info.call_args[0] assert message == 'error while removing file: %s' assert isinstance(exception, FileNotFoundError) - @patch('v85.common.synchronize') + @patch('plugins.wazo_yealink.v85.common.synchronize') def test_synchronize(self, provd_synchronize, v85_plugin): device = {'mac': '80:5e:c0:d5:7d:72'} v85_plugin.synchronize(device, {}) @@ -240,7 +240,7 @@ class TestPlugin: with pytest.raises(Exception): v85_plugin._check_device({}) - @patch('v85.common.plugins') + @patch('plugins.wazo_yealink.v85.common.plugins') def test_phonebook_url(self, provd_plugins, v85_plugin): raw_config = {'config_version': 1} v85_plugin._add_xivo_phonebook_url(raw_config) @@ -284,7 +284,7 @@ class TestPlugin: '4': None, } - @patch('v85.common.logger') + @patch('plugins.wazo_yealink.v85.common.logger') def test_timezones(self, mocked_logger, v85_plugin): raw_config = {'timezone': 'America/Montreal'} v85_plugin._add_timezone(raw_config) @@ -320,7 +320,7 @@ class TestPlugin: assert message == 'Unknown timezone: %s' assert isinstance(exception, TimezoneNotFoundError) - @patch('v85.common.logger') + @patch('plugins.wazo_yealink.v85.common.logger') def test_function_keys(self, mocked_logger, v85_plugin): raw_config = { 'funckeys': { diff --git a/plugins/wazo-yealink/v85/var/tftpboot/directory_setting.xml b/plugins/wazo_yealink/v85/var/tftpboot/directory_setting.xml similarity index 100% rename from plugins/wazo-yealink/v85/var/tftpboot/directory_setting.xml rename to plugins/wazo_yealink/v85/var/tftpboot/directory_setting.xml diff --git a/plugins/wazo_yealink/v86/__init__.py b/plugins/wazo_yealink/v86/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/plugins/wazo-yealink/v86/common.py b/plugins/wazo_yealink/v86/common.py similarity index 99% rename from plugins/wazo-yealink/v86/common.py rename to plugins/wazo_yealink/v86/common.py index 07a2f2b315fbe24ef71e38ea3d23f87c91d9f0b6..fc75fc64266611a8026351537fe6cd091d65f316 100644 --- a/plugins/wazo-yealink/v86/common.py +++ b/plugins/wazo_yealink/v86/common.py @@ -362,6 +362,7 @@ class BaseYealinkPlugin(StandardPlugin): http_dev_info_extractor = BaseYealinkHTTPDeviceInfoExtractor() def configure_common(self, raw_config): + self._add_server_url(raw_config) for filename, fw_filename, tpl_filename in self._COMMON_FILES: tpl = self._tpl_helper.get_template(f'common/{tpl_filename}') dst = os.path.join(self._tftpboot_dir, filename) diff --git a/plugins/wazo-yealink/v86/entry.py b/plugins/wazo_yealink/v86/entry.py similarity index 100% rename from plugins/wazo-yealink/v86/entry.py rename to plugins/wazo_yealink/v86/entry.py diff --git a/plugins/wazo-yealink/v86/pkgs/pkgs.db b/plugins/wazo_yealink/v86/pkgs/pkgs.db similarity index 100% rename from plugins/wazo-yealink/v86/pkgs/pkgs.db rename to plugins/wazo_yealink/v86/pkgs/pkgs.db diff --git a/plugins/wazo-yealink/v86/plugin-info b/plugins/wazo_yealink/v86/plugin-info similarity index 100% rename from plugins/wazo-yealink/v86/plugin-info rename to plugins/wazo_yealink/v86/plugin-info diff --git a/plugins/wazo-yealink/v86/templates/CP920.tpl b/plugins/wazo_yealink/v86/templates/CP920.tpl similarity index 100% rename from plugins/wazo-yealink/v86/templates/CP920.tpl rename to plugins/wazo_yealink/v86/templates/CP920.tpl diff --git a/plugins/wazo-yealink/v86/templates/CP925.tpl b/plugins/wazo_yealink/v86/templates/CP925.tpl similarity index 100% rename from plugins/wazo-yealink/v86/templates/CP925.tpl rename to plugins/wazo_yealink/v86/templates/CP925.tpl diff --git a/plugins/wazo-yealink/v86/templates/T27G.tpl b/plugins/wazo_yealink/v86/templates/T27G.tpl similarity index 100% rename from plugins/wazo-yealink/v86/templates/T27G.tpl rename to plugins/wazo_yealink/v86/templates/T27G.tpl diff --git a/plugins/wazo-yealink/v86/templates/T30P.tpl b/plugins/wazo_yealink/v86/templates/T30.tpl similarity index 100% rename from plugins/wazo-yealink/v86/templates/T30P.tpl rename to plugins/wazo_yealink/v86/templates/T30.tpl diff --git a/plugins/wazo-yealink/v86/templates/T31.tpl b/plugins/wazo_yealink/v86/templates/T30P.tpl similarity index 100% rename from plugins/wazo-yealink/v86/templates/T31.tpl rename to plugins/wazo_yealink/v86/templates/T30P.tpl diff --git a/plugins/wazo-yealink/v86/templates/T31G.tpl b/plugins/wazo_yealink/v86/templates/T31.tpl similarity index 100% rename from plugins/wazo-yealink/v86/templates/T31G.tpl rename to plugins/wazo_yealink/v86/templates/T31.tpl diff --git a/plugins/wazo-yealink/v86/templates/T31P.tpl b/plugins/wazo_yealink/v86/templates/T31G.tpl similarity index 100% rename from plugins/wazo-yealink/v86/templates/T31P.tpl rename to plugins/wazo_yealink/v86/templates/T31G.tpl diff --git a/plugins/wazo-yealink/v86/templates/T33P.tpl b/plugins/wazo_yealink/v86/templates/T31P.tpl similarity index 100% rename from plugins/wazo-yealink/v86/templates/T33P.tpl rename to plugins/wazo_yealink/v86/templates/T31P.tpl diff --git a/plugins/wazo-yealink/v86/templates/T41U.tpl b/plugins/wazo_yealink/v86/templates/T33G.tpl similarity index 100% rename from plugins/wazo-yealink/v86/templates/T41U.tpl rename to plugins/wazo_yealink/v86/templates/T33G.tpl diff --git a/plugins/wazo-yealink/v86/templates/T42U.tpl b/plugins/wazo_yealink/v86/templates/T33P.tpl similarity index 100% rename from plugins/wazo-yealink/v86/templates/T42U.tpl rename to plugins/wazo_yealink/v86/templates/T33P.tpl diff --git a/plugins/wazo-yealink/v86/templates/T41S.tpl b/plugins/wazo_yealink/v86/templates/T41S.tpl similarity index 100% rename from plugins/wazo-yealink/v86/templates/T41S.tpl rename to plugins/wazo_yealink/v86/templates/T41S.tpl diff --git a/plugins/wazo-yealink/v86/templates/T43U.tpl b/plugins/wazo_yealink/v86/templates/T41U.tpl similarity index 100% rename from plugins/wazo-yealink/v86/templates/T43U.tpl rename to plugins/wazo_yealink/v86/templates/T41U.tpl diff --git a/plugins/wazo-yealink/v86/templates/T42S.tpl b/plugins/wazo_yealink/v86/templates/T42S.tpl similarity index 100% rename from plugins/wazo-yealink/v86/templates/T42S.tpl rename to plugins/wazo_yealink/v86/templates/T42S.tpl diff --git a/plugins/wazo-yealink/v86/templates/T46U.tpl b/plugins/wazo_yealink/v86/templates/T42U.tpl similarity index 100% rename from plugins/wazo-yealink/v86/templates/T46U.tpl rename to plugins/wazo_yealink/v86/templates/T42U.tpl diff --git a/plugins/wazo-yealink/v86/templates/T48U.tpl b/plugins/wazo_yealink/v86/templates/T43U.tpl similarity index 100% rename from plugins/wazo-yealink/v86/templates/T48U.tpl rename to plugins/wazo_yealink/v86/templates/T43U.tpl diff --git a/plugins/wazo-yealink/v86/templates/T46S.tpl b/plugins/wazo_yealink/v86/templates/T46S.tpl similarity index 100% rename from plugins/wazo-yealink/v86/templates/T46S.tpl rename to plugins/wazo_yealink/v86/templates/T46S.tpl diff --git a/plugins/wazo_yealink/v86/templates/T46U.tpl b/plugins/wazo_yealink/v86/templates/T46U.tpl new file mode 100644 index 0000000000000000000000000000000000000000..ca6e018a212fe939427d3378e7091caef0448427 --- /dev/null +++ b/plugins/wazo_yealink/v86/templates/T46U.tpl @@ -0,0 +1 @@ +{% extends 'base.tpl' -%} diff --git a/plugins/wazo-yealink/v86/templates/T48S.tpl b/plugins/wazo_yealink/v86/templates/T48S.tpl similarity index 100% rename from plugins/wazo-yealink/v86/templates/T48S.tpl rename to plugins/wazo_yealink/v86/templates/T48S.tpl diff --git a/plugins/wazo_yealink/v86/templates/T48U.tpl b/plugins/wazo_yealink/v86/templates/T48U.tpl new file mode 100644 index 0000000000000000000000000000000000000000..ca6e018a212fe939427d3378e7091caef0448427 --- /dev/null +++ b/plugins/wazo_yealink/v86/templates/T48U.tpl @@ -0,0 +1 @@ +{% extends 'base.tpl' -%} diff --git a/plugins/wazo-yealink/v86/templates/T53.tpl b/plugins/wazo_yealink/v86/templates/T53.tpl similarity index 100% rename from plugins/wazo-yealink/v86/templates/T53.tpl rename to plugins/wazo_yealink/v86/templates/T53.tpl diff --git a/plugins/wazo-yealink/v86/templates/T53W.tpl b/plugins/wazo_yealink/v86/templates/T53W.tpl similarity index 100% rename from plugins/wazo-yealink/v86/templates/T53W.tpl rename to plugins/wazo_yealink/v86/templates/T53W.tpl diff --git a/plugins/wazo-yealink/v86/templates/T54W.tpl b/plugins/wazo_yealink/v86/templates/T54W.tpl similarity index 100% rename from plugins/wazo-yealink/v86/templates/T54W.tpl rename to plugins/wazo_yealink/v86/templates/T54W.tpl diff --git a/plugins/wazo-yealink/v86/templates/T57W.tpl b/plugins/wazo_yealink/v86/templates/T57W.tpl similarity index 100% rename from plugins/wazo-yealink/v86/templates/T57W.tpl rename to plugins/wazo_yealink/v86/templates/T57W.tpl diff --git a/plugins/wazo-yealink/v86/templates/T58.tpl b/plugins/wazo_yealink/v86/templates/T58.tpl similarity index 100% rename from plugins/wazo-yealink/v86/templates/T58.tpl rename to plugins/wazo_yealink/v86/templates/T58.tpl diff --git a/plugins/wazo-yealink/v86/templates/T58W.tpl b/plugins/wazo_yealink/v86/templates/T58W.tpl similarity index 100% rename from plugins/wazo-yealink/v86/templates/T58W.tpl rename to plugins/wazo_yealink/v86/templates/T58W.tpl diff --git a/plugins/wazo-yealink/v86/templates/base.tpl b/plugins/wazo_yealink/v86/templates/base.tpl similarity index 100% rename from plugins/wazo-yealink/v86/templates/base.tpl rename to plugins/wazo_yealink/v86/templates/base.tpl diff --git a/plugins/wazo-yealink/v86/templates/common/dect_model.tpl b/plugins/wazo_yealink/v86/templates/common/dect_model.tpl similarity index 100% rename from plugins/wazo-yealink/v86/templates/common/dect_model.tpl rename to plugins/wazo_yealink/v86/templates/common/dect_model.tpl diff --git a/plugins/wazo-yealink/v86/templates/common/model.tpl b/plugins/wazo_yealink/v86/templates/common/model.tpl similarity index 100% rename from plugins/wazo-yealink/v86/templates/common/model.tpl rename to plugins/wazo_yealink/v86/templates/common/model.tpl diff --git a/plugins/wazo_yealink/v86/tests/__init__.py b/plugins/wazo_yealink/v86/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/plugins/wazo-yealink/v86/tests/conftest.py b/plugins/wazo_yealink/v86/tests/conftest.py similarity index 79% rename from plugins/wazo-yealink/v86/tests/conftest.py rename to plugins/wazo_yealink/v86/tests/conftest.py index 13fbf7c20b89021bc12bcb68d8097bad0fae7f27..3fade25e92daa4caaf31b8bf8ae337a69de10f68 100644 --- a/plugins/wazo-yealink/v86/tests/conftest.py +++ b/plugins/wazo_yealink/v86/tests/conftest.py @@ -15,7 +15,7 @@ def v86_entry(module_initializer): @pytest.fixture def v86_plugin(v86_entry): - with patch('v86.common.FetchfwPluginHelper'), patch( - 'v86.common.TemplatePluginHelper' + with patch('plugins.wazo_yealink.v86.common.FetchfwPluginHelper'), patch( + 'plugins.wazo_yealink.v86.common.TemplatePluginHelper' ): yield v86_entry.YealinkPlugin(MagicMock(), 'test_dir', MagicMock(), MagicMock()) diff --git a/plugins/wazo-yealink/v86/tests/test_common.py b/plugins/wazo_yealink/v86/tests/test_common.py similarity index 96% rename from plugins/wazo-yealink/v86/tests/test_common.py rename to plugins/wazo_yealink/v86/tests/test_common.py index 6358f91a9f41fb09d3de354718041ddd287be263..9d676e001e1121f8b107bb126ea7f0f19004583e 100644 --- a/plugins/wazo-yealink/v86/tests/test_common.py +++ b/plugins/wazo_yealink/v86/tests/test_common.py @@ -66,7 +66,7 @@ class TestInfoExtraction: def test_http_ua_extractor_when_no_info(self): assert self.http_info_extractor._extract_from_ua('') is None - @patch('v86.common.defer') + @patch('plugins.wazo_yealink.v86.common.defer') def test_extract(self, mocked_defer): self.http_info_extractor.extract( self._mock_request(b'Yealink SIP-T31G 124.85.257.55 80:5e:c0:d5:7d:72'), @@ -96,7 +96,7 @@ class TestInfoExtraction: raise Exception(path, mac) assert {'vendor': 'Yealink', 'mac': mac}.items() <= result.items() - @patch('v86.common.logger') + @patch('plugins.wazo_yealink.v86.common.logger') def test_invalid_mac(self, mocked_logger): self.http_info_extractor._extract_from_ua( 'Yealink SIP-T20P 9.72.0.30 00:15:6525ef16a7c' @@ -149,7 +149,7 @@ class TestPluginAssociation: class TestPlugin: - @patch('v86.common.FetchfwPluginHelper') + @patch('plugins.wazo_yealink.v86.common.FetchfwPluginHelper') def test_init(self, fetch_fw, v86_entry): fetch_fw.return_value.services.return_value = sentinel.fetchfw_services fetch_fw.new_downloaders.return_value = sentinel.fetchfw_downloaders @@ -160,7 +160,7 @@ class TestPlugin: fetch_fw.assert_called_once_with('test_dir', sentinel.fetchfw_downloaders) def test_common_configure(self, v86_plugin): - raw_config = {} + raw_config = {'http_base_url': 'http://localhost:8667'} v86_plugin._tpl_helper.get_template.return_value = 'template' v86_plugin.configure_common(raw_config) v86_plugin._tpl_helper.get_template.assert_called_with('common/dect_model.tpl') @@ -195,14 +195,14 @@ class TestPlugin: v86_plugin.deconfigure({'mac': '80:5e:c0:d5:7d:72'}) mocked_remove.assert_called_with('test_dir/var/tftpboot/805ec0d57d72.cfg') - @patch('v86.common.logger') + @patch('plugins.wazo_yealink.v86.common.logger') def test_deconfigure_no_file(self, mocked_logger, v86_plugin): v86_plugin.deconfigure({'mac': '00:00:00:00:00:00'}) message, exception = mocked_logger.info.call_args[0] assert message == 'error while removing file: %s' assert isinstance(exception, FileNotFoundError) - @patch('v86.common.synchronize') + @patch('plugins.wazo_yealink.v86.common.synchronize') def test_synchronize(self, provd_synchronize, v86_plugin): device = {'mac': '80:5e:c0:d5:7d:72'} v86_plugin.synchronize(device, {}) @@ -236,7 +236,7 @@ class TestPlugin: with pytest.raises(Exception): v86_plugin._check_device({}) - @patch('v86.common.plugins') + @patch('plugins.wazo_yealink.v86.common.plugins') def test_phonebook_url(self, provd_plugins, v86_plugin): raw_config = {'config_version': 1} v86_plugin._add_xivo_phonebook_url(raw_config) @@ -280,7 +280,7 @@ class TestPlugin: '4': None, } - @patch('v86.common.logger') + @patch('plugins.wazo_yealink.v86.common.logger') def test_timezones(self, mocked_logger, v86_plugin): raw_config = {'timezone': 'America/Montreal'} v86_plugin._add_timezone(raw_config) @@ -316,7 +316,7 @@ class TestPlugin: assert message == 'Unknown timezone: %s' assert isinstance(exception, TimezoneNotFoundError) - @patch('v86.common.logger') + @patch('plugins.wazo_yealink.v86.common.logger') def test_function_keys(self, mocked_logger, v86_plugin): raw_config = { 'funckeys': { diff --git a/plugins/wazo-yealink/v86/var/tftpboot/directory_setting.xml b/plugins/wazo_yealink/v86/var/tftpboot/directory_setting.xml similarity index 100% rename from plugins/wazo-yealink/v86/var/tftpboot/directory_setting.xml rename to plugins/wazo_yealink/v86/var/tftpboot/directory_setting.xml diff --git a/plugins/wazo-zenitel/build.py b/plugins/wazo_zenitel/build.py similarity index 65% rename from plugins/wazo-zenitel/build.py rename to plugins/wazo_zenitel/build.py index cd11cc9e58c6051da382e1ca5bfa52129defc296..18513d33887c023b62a8530b20c938d5de925e9e 100644 --- a/plugins/wazo-zenitel/build.py +++ b/plugins/wazo_zenitel/build.py @@ -1,4 +1,4 @@ -# Copyright (C) 2013-2022 The Wazo Authors (see the AUTHORS file) +# Copyright 2013-2023 The Wazo Authors (see the AUTHORS file) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -15,12 +15,21 @@ # Depends on the following external programs: # -rsync +from __future__ import annotations +from typing import TYPE_CHECKING, Callable from subprocess import check_call +if TYPE_CHECKING: + + def target( + target_id: str, plugin_id: str, std_dirs: bool = True + ) -> Callable[[str], None]: + """The `target` method is injected in `exec` call by the build script.""" + return lambda x: None + @target('01.11.3.2', 'wazo-zenitel-01.11.3.2') def build_01_11_3_2(path): check_call(['rsync', '-rlp', '--exclude', '.*', 'common/', path]) - - check_call(['rsync', '-rlp', '--exclude', '.*', '01.11.3.2/', path]) + check_call(['rsync', '-rlp', '--exclude', '.*', 'v01_11_3_2/', path]) diff --git a/plugins/wazo-zenitel/common/common.py b/plugins/wazo_zenitel/common/common.py similarity index 100% rename from plugins/wazo-zenitel/common/common.py rename to plugins/wazo_zenitel/common/common.py diff --git a/plugins/wazo-zenitel/common/templates/base.tpl b/plugins/wazo_zenitel/common/templates/base.tpl similarity index 100% rename from plugins/wazo-zenitel/common/templates/base.tpl rename to plugins/wazo_zenitel/common/templates/base.tpl diff --git a/plugins/wazo-zenitel/common/var/tftpboot/tftp_test.txt b/plugins/wazo_zenitel/common/var/tftpboot/tftp_test.txt similarity index 100% rename from plugins/wazo-zenitel/common/var/tftpboot/tftp_test.txt rename to plugins/wazo_zenitel/common/var/tftpboot/tftp_test.txt diff --git a/plugins/wazo-zenitel/01.11.3.2/entry.py b/plugins/wazo_zenitel/v01_11_3_2/entry.py similarity index 100% rename from plugins/wazo-zenitel/01.11.3.2/entry.py rename to plugins/wazo_zenitel/v01_11_3_2/entry.py diff --git a/plugins/wazo-zenitel/01.11.3.2/pkgs/pkgs.db b/plugins/wazo_zenitel/v01_11_3_2/pkgs/pkgs.db similarity index 100% rename from plugins/wazo-zenitel/01.11.3.2/pkgs/pkgs.db rename to plugins/wazo_zenitel/v01_11_3_2/pkgs/pkgs.db diff --git a/plugins/wazo-zenitel/01.11.3.2/plugin-info b/plugins/wazo_zenitel/v01_11_3_2/plugin-info similarity index 100% rename from plugins/wazo-zenitel/01.11.3.2/plugin-info rename to plugins/wazo_zenitel/v01_11_3_2/plugin-info diff --git a/plugins/wazo-zenitel/01.11.3.2/var/tftpboot/ipst_config.cfg b/plugins/wazo_zenitel/v01_11_3_2/var/tftpboot/ipst_config.cfg similarity index 100% rename from plugins/wazo-zenitel/01.11.3.2/var/tftpboot/ipst_config.cfg rename to plugins/wazo_zenitel/v01_11_3_2/var/tftpboot/ipst_config.cfg diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000000000000000000000000000000000000..0a3c58b673fb25dc5f99be71b80a6ea3600e000c --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,27 @@ +[tool.black] +skip-string-normalization = true + +[tool.flake8] +show-source = true +max-line-length = 99 +application-import-names = "plugins" +ignore = [ + "E203", # whitespace before ':' + "F821", # undefined. Because of injected _execfiles, target, etc. + "W503", # line break before binary operator +] +exclude = [ + ".tox", + ".eggs", + "plugins/_build", +] + +[tool.coverage.run] +# entry.py is not loaded directly and thus coverage cannot be ascertained +omit = ["**/entry.py"] + +[tool.coverage.report] +exclude_lines = [ + "FileNotFoundError = OSError", +] + diff --git a/tox.ini b/tox.ini index 7a297b88fc85b537d15ee566d37552d26ab2fe13..a44f9a3b3a38fd89616959ff2154278fe4b45dee 100644 --- a/tox.ini +++ b/tox.ini @@ -5,17 +5,9 @@ [tox] basepython = python3.9 -envlist = py39, black, linters +envlist = py39, linters skipsdist = true -[coverage:run] -# entry.py is not loaded directly and thus coverage cannot be ascertained -omit = **/entry.py - -[coverage:report] -exclude_lines = - FileNotFoundError = OSError - [testenv] basepython = python3.9 commands = @@ -26,31 +18,8 @@ deps = exclude = plugins/_build -[testenv:black] -skip_install = true -deps = black -commands = black --skip-string-normalization . - -[flake8] -exclude = - .tox - .eggs - plugins/_build -show-source = true -max-line-length = 99 -application-import-names = plugins -# W503: line break before binary operator -# E203: whitespace before ':' warnings -# F821: undefined. Because of injected _execfiles, target, etc. -ignore = E203, W503, F821 - [testenv:linters] basepython = python3.10 skip_install = true -deps = - flake8 - flake8-colors - black -commands = - black --skip-string-normalization --check . - flake8 . +deps = pre-commit +commands = pre-commit run --all-files