tis-cudatext icon

CudaText

Paquet d’installation silencieuse pour CudaText

1.177.1.0-5

  • package: tis-cudatext
  • name: CudaText
  • version: 1.177.1.0-5
  • categories: Development
  • maintainer: WAPT Team, Tranquil IT, Jimmy PELÉ
  • editor: Alexey Torgashin (alexey_t), Andrey Kvichanskiy (kvichans)
  • licence: MPL 2.0
  • locale: all
  • target_os: windows
  • impacted_process: cudatext
  • architecture: x64
  • signature_date:
  • size: 15.76 Mo
  • installed_size: 28.18 Mo
  • homepage : http://uvviewsoft.com/cudatext/

package           : tis-cudatext
version           : 1.177.1.0-5
architecture      : x64
section           : base
priority          : optional
name              : CudaText
categories        : Development
maintainer        : WAPT Team, Tranquil IT, Jimmy PELÉ
description       : CudaText is a free open source cross-platform native GUI text and source code editor
depends           : 
conflicts         : 
maturity          : PROD
locale            : all
target_os         : windows
min_wapt_version  : 2.0
sources           : https://www.fosshub.com/CudaText.html
installed_size    : 28180480
impacted_process  : cudatext
description_fr    : CudaText est un éditeur de texte et de code source libre et ouvert, à interface graphique native et multiplateforme
description_pl    : CudaText jest darmowym, otwartym, międzyplatformowym, natywnym edytorem tekstu i kodu źródłowego GUI
description_de    : CudaText ist ein freier, plattformübergreifender, nativer GUI-Text- und Quellcode-Editor
description_es    : CudaText es un editor de texto y código fuente nativo de código abierto y multiplataforma
description_pt    : CudaText é um editor de código fonte e texto GUI nativo de código fonte de código aberto gratuito
description_it    : CudaText è un editor di testo e di codice sorgente open source multipiattaforma con interfaccia grafica nativa
description_nl    : CudaText is een gratis open source cross-platform native GUI tekst en broncode editor
description_ru    : CudaText - это бесплатный кроссплатформенный кроссплатформенный редактор текста и исходного кода с графическим интерфейсом с открытым исходным кодом
audit_schedule    : 
editor            : Alexey Torgashin (alexey_t), Andrey Kvichanskiy (kvichans)
keywords          : 
licence           : MPL 2.0
homepage          : http://uvviewsoft.com/cudatext/
package_uuid      : 8d7e87c2-f7dc-4b88-956f-1e8d4c214660
valid_from        : 
valid_until       : 
forced_install_on : 
changelog         : http://uvviewsoft.com/cudatext/history.txt
min_os_version    : 5.1
max_os_version    : 
icon_sha256sum    : ea2383e906352851706a5f4f96ee2947ce3a3aa9a9811bb519da7957af26dd8c
signer            : Tranquil IT
signer_fingerprint: 8c5127a75392be9cc9afd0dbae1222a673072c308c14d88ab246e23832e8c6bb
signature_date    : 2024-10-26T11:00:39.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         : YXmyMse+kJAQiWPKTZdwzzX1DVesXyyOu9buolKk3NQCpbRogZPjpws2iICgq0EWFW5mGeAgaxSRCaO8W+CLxThhWugGeDswS+8f1g4WxzE1LPqR4i9XihQSOo+jGd12k/TVi19rC8+xkuB5gk6nawojSFKkzRwgJTehO1b4+0LB7FHnFP+WHOnsl5CCswCvQOxoc009/ao8twhP2sM2QBzv8XDNJhIgjvYvnb7aTgEshHImWbNjq/H0jr0VpperaKNzlhh/wVSWsZ4OAs4zq2wO86kBcyuDchwurkXQyBCuZUp9hD1njSnTa2RMiw06SRvNyv24wsUtudJ7AI/5oA==

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

# Defining variables
app_name = "CudaText"
app_dir = makepath(programfiles, app_name)
app_settings = makepath(app_dir, "settings")


def install():
    # Initializing variables
    package_version = control.version.split("-", 1)[0]
    bin_name = "cudatext-win-x64-%s.zip" % package_version
    processes_to_kill = control.impacted_process.split(",")

    # Installing the package
    print("Installing: %s" % bin_name)
    killalltasks(processes_to_kill)
    if isdir(app_dir):
        remove_tree(app_dir)
    unzip(bin_name, target=app_dir)
    mkdirs(app_settings)
    run(f'icacls "{app_settings}" /grant *S-1-5-32-545:(OI)(CI)(RX,W)')
    create_programs_menu_shortcut(app_name, makepath(app_dir, "cudatext.exe"))


def uninstall():
    # Uninstalling the package
    remove_tree(app_dir)
    remove_programs_menu_shortcut(app_name)

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

def update_package():
    print("Downloading/Updating package content from upstream binary sources")

    # Initializing variables
    proxies = get_proxies()
    if not proxies:
        proxies = get_proxies_from_wapt_console()

    app_name = control.name
    url = control.sources

    # Getting latest version from official website
    print("URL used is: " + url)
    url_dl = get_download_url_from_fosshub(url, file_type="win x64", proxies=proxies)
    version = bs_find(url, "dd", "itemprop", "softwareVersion", proxies=proxies).text
    latest_bin = "cudatext-win-x64-%s.zip" % version

    print("Latest %s version is: %s" % (app_name, version))
    print("Download url is: %s" % url_dl)

    # Downloading latest binaries
    if not isfile(latest_bin):
        print("Downloading: %s" % latest_bin)
        wget(url_dl, latest_bin, proxies=proxies)

        # Changing version of the package
        control.version = "%s-%s" % (version, int(control.version.split("-")[-1]) + 1)
        control.save_control_to_wapt()
        print("Changing version to: %s in WAPT\\control" % control.version)

    # Deleting outdated binaries
    remove_outdated_binaries(version)


def get_download_url_from_fosshub(url, file_type="64-bit Windows Installer", proxies=None):
    import json
    import requests

    url_api_fosshub = "https://university.fosshub.com/projects.json"

    for script in bs_find_all(url, "script", proxies=proxies):
        if (len(script.contents) >= 1) and ("var settings" in script.contents[0]):
            var_settings = script.contents[0].replace("\n  var settings =", "").replace("\n", "")
            break

    for readapifosshub in json.loads(wgets(url_api_fosshub, proxies=proxies))["projects"]:
        if readapifosshub["url"].endswith(url.split("//")[-1]):
            for filename in readapifosshub["files"]:
                if filename["type"] == file_type:
                    file_name = filename["name"]

    settings = json.loads(var_settings)

    apiUrl = "https://api." + settings["domain"]
    downloadUrl = apiUrl + "/download/"

    def forming_fosshub_url(a, b, c, d, e):
        params = {"projectId": a, "releaseId": b, "projectUri": c, "fileName": d, "source": e}
        r = requests.post(downloadUrl, data=params, proxies=proxies)
        return r

    pool = settings["pool"]
    f = pool["f"]

    for c in f:
        r = forming_fosshub_url(pool["p"], c["r"], pool["u"], file_name, pool["c"])

    r = forming_fosshub_url(pool["p"], c["r"], pool["u"], file_name, pool["c"])
    rj = r.json()
    time.sleep(5)
    return rj["data"]["url"]

38d056ab130f7bf7c481c12636a4e9959de36561d3dfcbe54c6e3571bc0c1dc3 : WAPT/certificate.crt
1eb745b3ef328f40aee9a135fdeea6584ce67f91ac980ff78b79315124b3fd99 : WAPT/control
ea2383e906352851706a5f4f96ee2947ce3a3aa9a9811bb519da7957af26dd8c : WAPT/icon.png
797643ca1ca7b5a8207b80f8754f266eaca34acc3b07d846d14e0e5232cb21cc : cudatext-win-x64-1.177.1.0.zip
a7c5681c7efdf7547d67dc55fa187465392266155ba8cb0ab60a2c746865ece2 : luti.json
d58bbdfa75c7f3b8148d2fd57d709dd3e75705e55bab3fa500d930dff230648f : setup.py
0369dc289f2c1b6edd3da61fdfa52e09da82fa0cb4792960b466b50116c5e8ea : update_package.py