tis-grammalecte-libreoffice-extension icon

Grammalecte LibreOffice Extension

Silent install package for Grammalecte LibreOffice Extension

2.1.2-1

  • package: tis-grammalecte-libreoffice-extension
  • name: Grammalecte LibreOffice Extension
  • version: 2.1.2-1
  • categories: Utilities
  • maintainer: WAPT Team,Tranquil IT,Clément BAZIRET
  • licence: opensource_free,cpe:/a:gnu:gpl_v3,wapt_private
  • target_os: windows
  • architecture: all
  • signature_date:
  • size: 8.12 Mo
  • installed_size: 32.65 Mo
  • homepage : https://grammalecte.net/

package           : tis-grammalecte-libreoffice-extension
version           : 2.1.2-1
architecture      : all
section           : base
priority          : optional
name              : Grammalecte LibreOffice Extension
categories        : Utilities
maintainer        : WAPT Team,Tranquil IT,Clément BAZIRET
description       : Grammalecte is a grammar checker distributed as an extension for the LibreOffice office suite
depends           : 
conflicts         : 
maturity          : PROD
locale            : 
target_os         : windows
min_wapt_version  : 2.3
sources           : https://grammalecte.net/#download
installed_size    : 32652881
impacted_process  : 
description_fr    : Grammalecte est un correcteur grammatical distribué sous forme d'extension pour la suite bureautique LibreOffice
description_pl    : Grammalecte to narzędzie do sprawdzania gramatyki dystrybuowane jako rozszerzenie pakietu biurowego LibreOffice
description_de    : Grammalecte ist eine Grammatikprüfung, die als Erweiterung für die Bürosuite LibreOffice vertrieben wird
description_es    : Grammalecte es un corrector gramatical distribuido como extensión de la suite ofimática LibreOffice
description_pt    : O Grammalecte é um corretor gramatical distribuído como uma extensão do pacote de escritório LibreOffice
description_it    : Grammalecte è un correttore grammaticale distribuito come estensione della suite per ufficio LibreOffice
description_nl    : Grammalecte is een grammaticacontrole die wordt gedistribueerd als uitbreiding voor de LibreOffice Office-suite
description_ru    : Grammalecte - это программа проверки грамматики, распространяемая в качестве расширения для офисного пакета LibreOffice
audit_schedule    : 
editor            : 
keywords          : grammalecte,grammar,checker,extension,libreoffice,office,suite
licence           : opensource_free,cpe:/a:gnu:gpl_v3,wapt_private
homepage          : https://grammalecte.net/
package_uuid      : 89fd205c-ade2-424f-ad1a-bb1094fd719c
valid_from        : 
valid_until       : 
forced_install_on : 
changelog         : 
min_os_version    : 
max_os_version    : 
icon_sha256sum    : ad98d0fb586786cc99d09f1191c23365d91ad0e27ec64e9b136e6dfe994ccc26
signer            : Tranquil IT
signer_fingerprint: 8c5127a75392be9cc9afd0dbae1222a673072c308c14d88ab246e23832e8c6bb
signature_date    : 2024-09-24T15:03:04.000000
signed_attributes : package,version,architecture,section,priority,name,categories,maintainer,description,depends,conflicts,maturity,locale,target_os,min_wapt_version,sources,installed_size,impacted_process,description_fr,description_pl,description_de,description_es,description_pt,description_it,description_nl,description_ru,audit_schedule,editor,keywords,licence,homepage,package_uuid,valid_from,valid_until,forced_install_on,changelog,min_os_version,max_os_version,icon_sha256sum,signer,signer_fingerprint,signature_date,signed_attributes
signature         : M/GSt5K3QLkRmIXMPN4cshTcfHXZL1cVCLVDUsRWdZXEt4iUJS6q6z2889/Id2cM1bKCkt7PinNzH1WSwmU/rm1W3q08iCZaxcXizDK27R8uFXKqZ8YSZZSbSRGhYagvqxZbBMp6zHNTo0Jj8LbqkJeWHG9a+De+36dnwe2tzzTsu1fCX/fRI/Gy3Mor+qydcjEVPmM78qmpPu6qPJzEWVh0vd8g2OngcIAz6rvGyTF020FMmANSPq/a1F/Udpmjb/wC/4Kal01yCPgLa2M77bjI/7vnoqnv3AQqziwFqG7m4gBaNAeIybG2NtiwMs/wCMuomTg1mrZYSjEqpF89Lw==

# -*- coding: utf-8 -*-
from setuphelpers import *


def get_unopkg_path():
    unopkg_path = makepath(programfiles, "LibreOffice", "program", "unopkg.com")

    if not isfile(unopkg_path):
        unopkg_path = makepath(programfiles, "Collabora Office", "program", "unopkg.com")

    if not isfile(unopkg_path):
        error("ERROR: Couldn't find path to unopkg.com, verify your LibreOffice installation")

    return unopkg_path

def install():

    if params.get("install_with_luti", False):
        WAPT.install("tis-libreoffice-still")

    extension_name = glob.glob(f"Grammalecte-fr-v{control.get_software_version()}.oxt")[0]
    install_path = get_unopkg_path().split("\\")[:-1]
    install_path = "\\".join(install_path)
    # run(f'"{get_unopkg_path()}" --help') for further information
    print(f"Install path : {install_path}")
    run(f'"{get_unopkg_path()}" add --shared "{extension_name}"')



def audit():
    extension_name = f"Grammalecte-fr-v{control.get_software_version()}.oxt"

    result = run(f'"{get_unopkg_path()}" list --shared "{extension_name}"')
    if extension_name in result:
        return "OK"
    else:
        return "ERROR"


def uninstall():
    extension_name = f"Grammalecte-fr-v{control.get_software_version()}.oxt"

    run(f'"{get_unopkg_path()}" remove --shared "{extension_name}"')

# -*- coding: utf-8 -*-
from setuphelpers import *
from setupdevhelpers import *


def update_package():
    # Declaring local variables
    package_updated = False
    proxies = get_proxies()
    if not proxies:
        proxies = get_proxies_from_wapt_console()

    # https://extensions.libreoffice.org/assets/downloads/50/Grammalecte-fr-v2.1.2.oxt
    download_url_part = "https://extensions.libreoffice.org"
    url = "https://extensions.libreoffice.org/en/extensions/show/grammalecte"

    # Getting latest version from official sources
    print("URL used is: %s" % url)
    for bs_search in bs_find_all(url, "a", "class", "btn install-latest direct-download matomo_download", proxies=proxies):
        if "Download latest" in bs_search.text:
            download_url = download_url_part + bs_search["href"]
            latest_bin = bs_search["href"].split("/")[-1]
            version = latest_bin.split("fr-v")[-1].split(".oxt")[0]
            break

    # Downloading latest binaries
    print("Latest %s version is: %s" % (control.name, version))
    print("Download URL is: %s" % download_url)
    if not isfile(latest_bin):
        print("Downloading: %s" % latest_bin)
        wget(download_url, latest_bin, proxies=proxies)
    else:
        print("Binary is present: %s" % latest_bin)

    # Deleting outdated binaries
    remove_outdated_binaries(latest_bin)

    # Checking version from file
    # if get_os_name() == "Windows" and "windows" in control.target_os.lower():
    #     version_from_file = get_version_from_binary(latest_bin)
    #     if Version(version_from_file, 4) == Version(version, 4):
    #         print(f"INFO: Binary file version ({version_from_file}) corresponds to online version ({version})")
    #     else:
    #         error(f"ERROR: Binary file version ({version_from_file}) do NOT corresponds to online version ({version})")

    # Changing version of the package
    if Version(version, 4) > Version(control.get_software_version(), 4):
        print("Software version updated (from: %s to: %s)" % (control.get_software_version(), Version(version)))
        package_updated = True
    else:
        print("Software version up-to-date (%s)" % Version(version))
    control.set_software_version(version)
    control.save_control_to_wapt()

    # Validating or not update-package-sources
    return package_updated

3bb2e879eb480085bf09717a1f1d34c599d48b8056885ff3db9c40c9b303b298 : Grammalecte-fr-v2.1.2.oxt
38d056ab130f7bf7c481c12636a4e9959de36561d3dfcbe54c6e3571bc0c1dc3 : WAPT/certificate.crt
3714020984f1d1c884152266d43273fb59e1ae52d63aed6e25f2d04edc809558 : WAPT/control
ad98d0fb586786cc99d09f1191c23365d91ad0e27ec64e9b136e6dfe994ccc26 : WAPT/icon.png
9c14edd6affe2064da464ab11bf34238aa648db3f5473044fda2680755dc88b4 : luti.json
ab9dcbf422141277d35d0caa84bd503ef5a9d7b59d278092cb60fd89351f6ca8 : setup.py
38e1e9c9fee4970c5c562dc93896b86679c5e7191c55d976d194d3c89721b50c : update_package.py