tis-kate

24.8-2
Kate is a programmer's text editor by KDE. It features stuff like codefolding, syntaxhighlighting, dynamic word wrap, an embedded console, an extensive plugin interface and some prelimentary scripting support
701 downloads
Download
See build result See VirusTotal scan
tis-kate icon
  • package : tis-kate
  • name : Kate
  • version : 24.8-2
  • categories :
  • maintainer : Jordan Arnaud
  • editor :
  • licence : GNU LIBRARY GENERAL PUBLIC LICENSE
  • locale :
  • target_os : linux
  • impacted_process :
  • architecture : x64
  • signature_date : 2024-09-11 13:39
  • size : 217.77 Mo
  • homepage : https://kate-editor.org/
package           : tis-kate
version           : 24.8-2
architecture      : x64
section           : base
priority          : optional
name              : Kate
categories        : 
maintainer        : Jordan Arnaud
description       : Kate is a programmer's text editor by KDE. It features stuff like codefolding, syntaxhighlighting, dynamic word wrap, an embedded console, an extensive plugin interface and some prelimentary scripting support
depends           : 
conflicts         : 
maturity          : PROD
locale            : 
target_os         : linux
min_wapt_version  : 
sources           : https://cdn.kde.org/ci-builds/utilities/kate/
installed_size    : 
impacted_process  : 
description_fr    : Kate est un éditeur de texte pour programmeurs créé par KDE. Il propose des fonctionnalités telles que le pliage de code, la mise en évidence de la syntaxe, l'habillage dynamique des mots, une console intégrée, une interface de plugin étendue et un support de script prélimentaire
description_pl    : Kate to edytor tekstu dla programistów stworzony przez KDE. Oferuje takie funkcje jak składanie kodu, podświetlanie składni, dynamiczne zawijanie słów, wbudowaną konsolę, rozbudowany interfejs wtyczek i wstępną obsługę skryptów
description_de    : Kate ist ein Texteditor für Programmierer von KDE. Er bietet Funktionen wie Codefolding, Syntaxhighlighting, dynamischen Zeilenumbruch, eine eingebettete Konsole, eine umfangreiche Plugin-Schnittstelle und einige zusätzliche Skriptunterstützung
description_es    : Kate es un editor de texto para programadores de KDE. Cuenta con cosas como codefolding, syntaxhighlighting, dynamic word wrap, una consola incrustada, una extensa interfaz de plugins y algún soporte de scripting preliminar
description_pt    : Kate é um editor de texto para programadores do KDE. Possui funcionalidades como codefolding, syntaxhighlighting, word wrap dinâmico, uma consola incorporada, uma extensa interface de plugins e algum suporte de scripting preliminar
description_it    : Kate è un editor di testo per programmatori di KDE. Presenta elementi come il codefolding, l'evidenziazione della sintassi, il word wrap dinamico, una console integrata, un'ampia interfaccia di plugin e un supporto prelimentare per lo scripting
description_nl    : Kate is een teksteditor voor programmeurs van KDE. Het heeft dingen zoals codefolding, syntaxishighlighting, dynamische woordomloop, een ingebedde console, een uitgebreide plugin-interface en wat aanvullende ondersteuning voor scripts
description_ru    : Kate - это текстовый редактор для программистов от KDE. В нем есть такие функции, как сворачивание кода, подсветка синтаксиса, динамическое обертывание слов, встроенная консоль, обширный интерфейс плагинов и предварительная поддержка скриптов
audit_schedule    : 
editor            : 
keywords          : 
licence           : GNU LIBRARY GENERAL PUBLIC LICENSE
homepage          : https://kate-editor.org/
package_uuid      : 36973b98-5909-4e66-8dd2-9502b6752349
valid_from        : 
valid_until       : 
forced_install_on : 
changelog         : 
min_os_version    : 
max_os_version    : 
icon_sha256sum    : 0ffe006104cc5ea9983eddbaa1eb6a9c4b0d485fad5de738764cef0624cf767b
signer            : Tranquil IT
signer_fingerprint: 8c5127a75392be9cc9afd0dbae1222a673072c308c14d88ab246e23832e8c6bb
signature_date    : 2024-09-11T13:39:01.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         : SW38dcYlO9V4sR3KJUXD0nmnXY5K9hxkSwksyFOiJkrkAnLSkTc8ESXCPbCH4CcBgnauwBXJdCdsAFtbto2s5M6Ck34Nhdwc+IMsqOdU0cHHjQO1axk20KBgVht7fuw1vBhULAAo6+Gg8isnhqB7S5D5B/4OdlN+5Sxu2x5FNqV1D6VvHMG2WJ/UL+q7bPC+ex8MRjUNsqwGppPRvoIctq+hwXm3vmr2fT1GWDYp3RTIl4imcurk9k2aq6CYXgyJ/xVu9z3QPNzkbjdQEJ5efvLEpsuXVdbvyGBFD/VRdapsreyssd5HcTdtcPJCmOQH9aquPO1BBxPMRedJQlljfg==
# -*- coding: utf-8 -*-
##################################################
# This file is part of WAPT Enterprise
# All right reserved, (c) Tranquil IT Systems 2024
# For more information please refer to
# https://wapt.tranquil.it/store/licences.html
##################################################
from setuphelpers import *
from iniparse import ConfigParser
import os


def install():
    install_dir = makepath('/','opt',control.package.split('-',1)[1])
    appimage = glob.glob("*.AppImage")[0]
    install_appimage(appimage,install_dir)

def uninstall():
    install_dir = makepath('/','opt',control.package.split('-',1)[1])
    uninstall_appimage(install_dir)

def install_appimage(appimage,install_dir,binaliasname=None):
    run('chmod a+x ./' + appimage)

    if isdir(install_dir):
        uninstall_appimage(install_dir)

    mkdirs(install_dir)

    name_appimage = appimage.split('/')[-1]
    filecopyto(appimage, makepath(install_dir, name_appimage))
    run('"./%s" --appimage-extract' % appimage)
    

    for desktop in glob.glob(makepath('squashfs-root','*.desktop')):
 
        desktop_cp = ConfigParser()
        desktop_cp.optionxform = str
        desktop_file = open(desktop, encoding="utf-8")
        desktop_cp.readfp(desktop_file)
        bin_path = desktop_cp.get('Desktop Entry',"Exec")

        newbin_path = install_dir + '/' + name_appimage
        if ' %' in bin_path:
            newbin_path = newbin_path + ' %' + bin_path.split(' %',1)[1]

        icon_path = desktop_cp.get('Desktop Entry',"Icon")

        srcicon = makepath('squashfs-root',icon_path +'.svg')
        if not isfile(srcicon):
            srcicon = makepath('squashfs-root',icon_path +'.png')

        if not isfile(srcicon):
            lstglob = glob.glob(makepath('squashfs-root','*.svg'))
            if lstglob :
                srcicon=lstglob[0]

        if not isfile(srcicon):
            lstglob = glob.glob(makepath('squashfs-root','*.png'))
            if lstglob :
                srcicon=lstglob[0]
            else:
                srcicon = None

        if srcicon:            
            new_icon = install_dir + '/' + srcicon.split('/')[-1]
            filecopyto(srcicon,new_icon)
            desktop_cp.set('Desktop Entry',"Icon",new_icon) 

        desktop_cp.set('Desktop Entry',"Exec",newbin_path)
       
        with open(desktop, 'w', encoding="utf-8") as f:
            desktop_cp.write(f)

        pathdesk = makepath(install_dir,desktop.split('/')[-1])
        filecopyto(desktop, pathdesk)
        run('chown root:root "%s" ' % pathdesk)

    for f in glob.glob(makepath(install_dir,'*.desktop')):
        run('ln -sf "%s" "/usr/share/applications/%s"' % (f,f.split('/')[-1]))

    if binaliasname :
        run(f"ln -sf {install_dir}/{name_appimage} /usr/bin/{binaliasname}")

    remove_tree('squashfs-root')

def uninstall_appimage(install_dir):

    if not glob.glob(makepath(install_dir,'*.desktop')):
        error('.desktop not found')

    for f in glob.glob(makepath(install_dir,'*.desktop')):
        deskfile = f.split('/')[-1]
        system_desktop = makepath("/","usr","share","applications",deskfile)
        if isfile(system_desktop):
            remove_file(system_desktop)
    remove_tree(install_dir)
from setuphelpers import *
import json
import re
import requests



def update_package():
    # Déclaration des variables locales
    package_updated = False
    proxies = get_proxies()
    if not proxies:
        proxies = get_proxies_from_wapt_console()
    app_name = control.name

    # Récupération du contenu de l'index principal
    main_index = wgets("https://cdn.kde.org/ci-builds/utilities/kate/", proxies=proxies)

    # Expression régulière pour trouver les dossiers de release
    re_release_folders = re.compile(r'release-(\d+\.\d+)/')

    # Trouver les versions de release disponibles
    release_folders = sorted(re_release_folders.findall(main_index), key=lambda p: Version(p), reverse=True)

    # Si aucune version n'est trouvée
    if not release_folders:
        print("No valid version found.")
        return

    # Prendre le dernier dossier de release
    latest_release = release_folders[0]
    latest_release_url = f"https://cdn.kde.org/ci-builds/utilities/kate/release-{latest_release}/linux/"

    print(f"Last URL release : {latest_release_url}")

    # Récupération de la dernière version à partir des sources officielles
    re_versions = re.compile(r'kate-release_(\d+\.\d+)-(\d+)-linux-gcc-x86_64\.AppImage')

    index = wgets(latest_release_url, proxies=proxies)
    print(f"Last Index found :\n{index}")

    # Extraction des versions trouvées dans l'index
    versions_found = re_versions.findall(index)
    print(f"Versions found : {versions_found}")

    for version_kate, build_number in sorted(versions_found, key=lambda p: Version(p[0]), reverse=True):
        latest_bin = f"kate-release_{version_kate}-{build_number}-linux-gcc-x86_64.AppImage"
        download_url = f"{latest_release_url}{latest_bin}"

        if requests.head(download_url, proxies=proxies).status_code != 404:
            version = version_kate
            print(f"Downloading {version} with {download_url}")
            break
    else:
        print("No valid download found.")

    if not isfile(latest_bin):
        package_updated = True
        wget(download_url, latest_bin, proxies=proxies)

    # nettoyer les fichiers temporaires
    for f in glob.glob("*.AppImage"):
        if f != latest_bin:
            remove_file(f)


    control.set_software_version(version)
    control.save_control_to_wapt()
38d056ab130f7bf7c481c12636a4e9959de36561d3dfcbe54c6e3571bc0c1dc3 : WAPT/certificate.crt
4e4901693039156b3a12f57f11c050b9939b689907a7f5b4887e1ad995887a76 : WAPT/control
0ffe006104cc5ea9983eddbaa1eb6a9c4b0d485fad5de738764cef0624cf767b : WAPT/icon.png
ac14569c21d0a5144d4b31126479848f0d1c0067f1761ba853d7597f070561d2 : kate-release_24.08-7822-linux-gcc-x86_64.AppImage
f6aa810f56e0cd264dffb7cca9c0195d9f041ae16deea944dd261b4aaa23ca1c : luti.json
223fa6ca0b4ed15f7d1a2e29893619511e043c7907d145e8c8991405677bb4e1 : setup.py
303e6e39e15ac17bd0b20faaa48aa08af1ca20aabac81e35c4e76b47fb127548 : update_package.py