tis-vscode-lp-fr
1.87.2024030609-28
Module linguistique français pour Visual Studio Code
12932 téléchargements
Voir le résultat de la construction Voir l'analyse de VirusTotal
Description
- package : tis-vscode-lp-fr
- name : French Language Pack VSCode Extension
- version : 1.87.2024030609-28
- categories : Development
- maintainer : WAPT Team,Tranquil IT,Jimmy PELÉ
- installed_size : 2107328
- editor : Microsoft
- licence : opensource_free,cpe:/a:mit:x11_license,wapt_public
- signature_date : 2024-03-11T10:00:07.450938
- size : 412.24 Ko
- locale : all
- target_os : windows(>=10.0),mac,debian(>=10),ubuntu(>=18),centos(>=8),almalinux(>=8)
- impacted_process :
- architecture : x64,x86
- Cela dépend :
control
package : tis-vscode-lp-fr
version : 1.87.2024030609-28
architecture : x64,x86
section : base
priority : optional
name : French Language Pack VSCode Extension
categories : Development
maintainer : WAPT Team,Tranquil IT,Jimmy PELÉ
description : French Language Pack for Visual Studio Code
depends : tis-vscode
conflicts :
maturity : PROD
locale : all
target_os : windows(>=10.0),mac,debian(>=10),ubuntu(>=18),centos(>=8),almalinux(>=8)
min_wapt_version : 2.1
sources : https://marketplace.visualstudio.com/items/MS-CEINTL.vscode-language-pack-fr
installed_size : 2107328
impacted_process :
description_fr : Module linguistique français pour Visual Studio Code
description_pl : Francuski pakiet językowy dla Visual Studio Code
description_de : Französisches Sprachpaket für Visual Studio Code
description_es : Paquete de idiomas en francés para Visual Studio Code
description_pt : Pacote de Língua Francesa para Visual Studio Code
description_it : Pacchetto lingua francese per Visual Studio Code
description_nl : Frans taalpakket voor Visual Studio Code
description_ru : Французский языковой пакет для Visual Studio Code
audit_schedule :
editor : Microsoft
keywords :
licence : opensource_free,cpe:/a:mit:x11_license,wapt_public
homepage :
package_uuid : ccdf91b4-8cae-489e-ba7a-ad0d1b8128c4
valid_from :
valid_until :
forced_install_on :
changelog : https://marketplace.visualstudio.com/items/MS-CEINTL.vscode-language-pack-fr/changelog
min_os_version :
max_os_version :
icon_sha256sum : c06a48019e54ea94522a1d5e425360d5b4d3b947fd6259183e48264369418e8e
signer : Tranquil IT
signer_fingerprint: 8c5127a75392be9cc9afd0dbae1222a673072c308c14d88ab246e23832e8c6bb
signature : tqoM9G52zipxelRp+wjfDH5pIGHhtHCigOLwaWviSfUSSfSijr9IzOW05hQNYwVQVMyhIaPNZjqyc0BvlhAbvsqkCQtm8OHsXA+HtXmVF6GT7EQf0kTaAs8OHowWrY0wawL1pdrKt7wufGiRb+FKkT4gXFIc/6ezHvTYX0kIkY5JN3yNPV1BoM0xA1dcOZyFOjjcDNeehLi4UkeC/LPALMFDHsPzDCnVL2wxMVhX7YHgcG47+DTW1cKCeLqLJrojw3tDDgi97UDX2YD5goTMsqVJmU6cHSaAmIQOxmJIRFnHovLRqk85VvevNwldGSm6gDRvV9zpwyJ3EKc4C8Ypvw==
signature_date : 2024-03-11T10:00:07.450938
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
Setup.py
# -*- coding: utf-8 -*-
from setuphelpers import *
import subprocess
import chardet
import re
import json
import time
import sys
import os
import glob
from shutil import rmtree
ext_uid_name = "MS-CEINTL.vscode-language-pack-fr"
locale_dict = {"locale": "fr"}
def install():
# Initializing variables
package_version = control.get_software_version()
ext_file_name = glob.glob("*%s*.vsix" % ext_uid_name)[0]
if get_os_name() == "Windows":
app_dir = makepath(programfiles, "Microsoft VS Code")
app_bin_path = makepath(app_dir, "bin", "code")
elif get_os_name() == "Linux":
app_dir = makepath("/", "usr", "share", "code")
app_bin_path = makepath(app_dir, "bin", "code")
elif get_os_name() == "Darwin":
app_dir = makepath("/", "Applications", "Visual Studio Code.app")
app_bin_path = makepath(app_dir, "Contents", "Resources", "app", "bin", "code")
ext_path = makepath(app_dir, ext_file_name)
# Removing old extensions from app_dir
for ext in glob.glob(makepath(app_dir, "*%s*.vsix" % ext_uid_name)):
print("Removing: %s" % ext)
remove_file(ext)
# Copying extension to app_dir
print("Copying: %s to: %s" % (ext_file_name, app_dir))
filecopyto(ext_file_name, app_dir)
def session_setup():
# Initializing variables
package_version = control.get_software_version()
if get_os_name() == "Windows":
app_dir = makepath(programfiles, "Microsoft VS Code")
app_bin_path = makepath(app_dir, "bin", "code")
elif get_os_name() == "Linux":
app_dir = makepath("/", "usr", "share", "code")
app_bin_path = makepath(app_dir, "bin", "code")
elif get_os_name() == "Darwin":
app_dir = makepath("/", "Applications", "Visual Studio Code.app")
app_bin_path = makepath(app_dir, "Contents", "Resources", "app", "bin", "code")
ext_path = glob.glob(makepath(app_dir, "*%s*.vsix" % ext_uid_name))[0]
user_app_dir = makepath(user_home_directory, ".vscode")
user_argv_conf_file = makepath(user_app_dir, "argv.json")
# Installing extension in user env
print("Installing: %s extension in user env" % (ext_path))
result = run_notfatal('"%s" --install-extension "%s"' % (app_bin_path, ext_path)) # code extension always return exit status 0 for now
print(result)
if "Failed Installing Extensions" in result:
print("Unable to install extension with: %s" % ext_path)
print("Force install: %s extension in user env" % (ext_uid_name))
result_force = run_notfatal('"%s" --install-extension "%s" --force' % (app_bin_path, ext_uid_name))
print(result_force)
if "Failed Installing Extensions" in result_force:
print("Unable to force install %s extension" % ext_uid_name)
# Editing argv.json once
if not registry_readstring(HKEY_CURRENT_USER, r"Software\WAPT\Visual Studio Code", "ApplyLocaleOnce") == "Done" or force:
mkdirs(user_app_dir)
if isfile(user_argv_conf_file):
user_argv_dict = json_load_file_with_comments(user_argv_conf_file)
user_argv_dict.update(locale_dict)
json_write_file(user_argv_conf_file, user_argv_dict)
else:
json_write_file(user_argv_conf_file, locale_dict)
registry_setstring(HKEY_CURRENT_USER, r"Software\WAPT\Visual Studio Code", "ApplyLocaleOnce", "Done")
# Rerun vscode
if isrunning("code"):
if not params.get("running_as_luti"):
try:
import waptguihelper
except:
pass
if "waptguihelper" in sys.modules:
waptguihelper.message_dialog(control.package, f"Visual Studio Code will be killed and rerun to apply: {control.package}")
killalltasks(["Code", "code"])
subprocess.Popen([app_bin_path if get_os_name() != "Windows" else makepath(app_dir, "Code.exe")])
else:
rerun_delay = 10
if "waptguihelper" in sys.modules and not params.get("running_as_luti"):
waptguihelper.message_dialog(
control.package, f"Visual Studio Code will be launched and killed in {rerun_delay} seconds to apply: {control.package}"
)
subprocess.Popen([app_bin_path if get_os_name() != "Windows" else makepath(app_dir, "Code.exe")])
time.sleep(rerun_delay)
killalltasks(["Code", "code"])
def audit():
# Initializing variables
package_version = control.get_software_version()
if get_os_name() == "Windows":
app_dir = makepath(programfiles, "Microsoft VS Code")
app_bin_path = makepath(app_dir, "bin", "code")
elif get_os_name() == "Linux":
app_dir = makepath("/", "usr", "share", "code")
app_bin_path = makepath(app_dir, "bin", "code")
elif get_os_name() == "Darwin":
app_dir = makepath("/", "Applications", "Visual Studio Code.app")
app_bin_path = makepath(app_dir, "Contents", "Resources", "app", "bin", "code")
try:
ext_path = glob.glob(makepath(app_dir, "*%s*.vsix" % ext_uid_name))[0]
print("OK: %s extension present" % ext_uid_name)
return "OK"
except:
print("ERROR: %s extension absent" % ext_uid_name)
return "ERROR"
def uninstall():
# Initializing variables
package_version = control.get_software_version()
if get_os_name() == "Windows":
app_dir = makepath(programfiles, "Microsoft VS Code")
app_bin_path = makepath(app_dir, "bin", "code")
elif get_os_name() == "Linux":
app_dir = makepath("/", "usr", "share", "code")
app_bin_path = makepath(app_dir, "bin", "code")
elif get_os_name() == "Darwin":
app_dir = makepath("/", "Applications", "Visual Studio Code.app")
app_bin_path = makepath(app_dir, "Contents", "Resources", "app", "bin", "code")
# Removing extensions from app_dir
for ext in glob.glob(makepath(app_dir, "*%s*.vsix" % ext_uid_name)):
print("Removing: %s" % ext)
remove_file(ext)
# Removing extension from user profiles
killalltasks(["Code", "code"])
print("Removed user folders: ")
print(remove_tree_for_all_users(makepath(".vscode", "extensions", "%s-*" % ext_uid_name)))
def json_load_file_with_comments(file_path):
"""
Load a JSON file with comments removed.
Args:
file_path (str): Path to the JSON file.
Returns:
dict: JSON data without comments.
"""
contents = ""
with open(file_path) as fh:
for line in fh:
cleaned_line = line.split("//", 1)[0]
if len(cleaned_line) > 0 and line.endswith("\n") and "\n" not in cleaned_line:
cleaned_line += "\n"
contents += cleaned_line
while "/*" in contents:
pre_comment, post_comment = contents.split("/*", 1)
contents = pre_comment + post_comment.split("*/", 1)[1]
cleaned_json = json.loads(contents)
return cleaned_json
def remove_tree_for_all_users(user_folder_relative_path, ignored_users=None, ignore_system_users=True):
r"""Remove a specific folder or folders for all user's profiles
Args:
user_folder_relative_path (str): relative path to user folder, glob patterns can be used
ignored_users (str or list of str): ignore specified users
ignore_system_users (bool): ignore default, public, all users, etc. True by default
Returns:
list: list of deleted folders
>>> print(remove_tree_for_all_users(makepath(".vscode", "extensions", "ms-toolsai.jupyter-*")))
['C:\\Users\\username\\.vscode\\extensions\\ms-toolsai.jupyter-2022.2.1001817079', 'C:\\Users\\username\\.vscode\\extensions\\ms-toolsai.jupyter-keymap-1.0.0', 'C:\\Users\\username\\.vscode\\extensions\\ms-toolsai.jupyter-renderers-1.0.6']
>>> print(remove_tree_for_all_users(makepath(".vscode", "extensions", "ms-toolsai.jupyter-")))
[]
>>> print(remove_tree_for_all_users(makepath(".vscode", "extensions", "ms-toolsai.jupyter-[a-z]*")))
['C:\\Users\\username\\.vscode\\extensions\\ms-toolsai.jupyter-keymap-1.0.0', 'C:\\Users\\username\\.vscode\\extensions\\ms-toolsai.jupyter-renderers-1.0.6']
>>> print(remove_tree_for_all_users(makepath(".vscode", "extensions", "ms-toolsai.jupyter-1.0.0")))
['/home/username/.vscode/extensions/ms-toolsai.jupyter-keymap-1.0.0']
.. versionadded:: 2.3
"""
skipped_users = get_skipped_users_list(ignored_users, ignore_system_users)
deleted_folders = []
if get_os_name() == "Windows":
users_dir = makepath(systemdrive, "Users")
elif get_os_name() == "Linux":
users_dir = "/home"
elif get_os_name() == "Darwin":
users_dir = "/Users"
for user_profile in glob.glob("%s/*/" % users_dir):
skip = False
for skipped_user in skipped_users:
if user_profile.rstrip(os.path.sep).split(os.path.sep)[-1] == skipped_user:
skip = True
if not skip:
for user_folder_to_delete in glob.glob(makepath(user_profile, user_folder_relative_path)):
deleted_folders.append(user_folder_to_delete)
remove_tree(user_folder_to_delete)
return deleted_folders
def get_skipped_users_list(ignored_users=None, ignore_system_users=True):
system_users_list = ["All Users", "Default", "Default User", "Public", "Shared"]
if ignored_users is None:
ignored_users = []
if type(ignored_users) != list:
ignored_users = [ignored_users]
skipped_users = []
if ignored_users:
skipped_users.extend(ignored_users)
if ignore_system_users:
skipped_users.extend(system_users_list)
return skipped_users
update_package.py
# -*- coding: utf-8 -*-
from setuphelpers import *
from setupdevhelpers import *
import json
import requests
import time
# Declaring global variables - Warnings: 1) WAPT context is only available in package functions; 2) Global variables are not persistent between calls
ext_uid_name = "MS-CEINTL.vscode-language-pack-fr"
ext_publisher = ext_uid_name.split(".")[0]
def update_package():
# Declaring local variables
result = False
proxies = get_proxies()
if not proxies:
proxies = get_proxies_from_wapt_console()
app_name = control.name
url = "https://marketplace.visualstudio.com/items?itemName=%s" % ext_uid_name
# Getting latest version from official sources
api_url = "https://api.github.com/repos/microsoft/vscode/releases/latest"
# Getting latest version information from official sources
print("API used is: %s" % api_url)
json_load = json.loads(wgets(api_url, proxies=proxies))
vscode_version = json_load["tag_name"]
short_vscode_version = ".".join(vscode_version.split(".")[:2])
print("URL used is %s" % url)
version = ""
for bs_search in bs_find(url, "script", "class", "jiContent", proxies=proxies):
json_data = json.loads(bs_search.string)
for v in json_data["Versions"]:
if short_vscode_version in v["version"]:
version = v["version"]
break
break
if not version:
highest_version = json_data["Versions"][0]["version"]
if Version(highest_version) < Version(vscode_version):
version = highest_version
else:
error("no releasable version found")
download_url = "https://marketplace.visualstudio.com/_apis/public/gallery/publishers/%s/vsextensions/%s/%s/vspackage" % (
ext_publisher,
json_data["Resources"]["ExtensionName"],
version,
)
latest_bin = ext_uid_name + "-%s.vsix" % version
print("Latest %s version is: %s" % (app_name, version))
print("Download URL is: %s" % download_url)
# Downloading latest binaries
if not isfile(latest_bin):
print("Downloading: %s" % latest_bin)
content = requests.get(download_url, stream=True)
nb_wait = 0
max_wait = 3600
while str(content.status_code) == "429":
timewait = int(content.headers["Retry-After"])
print("Wait %s" % timewait)
nb_wait = nb_wait + timewait
if nb_wait > max_wait:
error("Max wait ...")
time.sleep(timewait)
content = requests.get(download_url, stream=True)
with open(latest_bin, "wb") as f:
for chunk in content.iter_content(chunk_size=1024 * 1024):
f.write(chunk)
# Changing version of the package
if Version(version) > Version(control.get_software_version()):
print("Software version updated (from: %s to: %s)" % (control.get_software_version(), Version(version)))
result = True
else:
print("Software version up-to-date (%s)" % Version(version))
control.version = "%s-%s" % (Version(version), control.version.split("-", 1)[-1])
# control.set_software_version(version)
control.save_control_to_wapt()
# Deleting outdated binaries
remove_outdated_binaries(version, "vsix")
# Validating or not update-package-sources
return result
1fa662fa02082512342031984abf68b7dc9528e912f1e7468e5d95851de4983f : setup.py
: __pycache__
8c2763f40c8740da15f81c7ad186807df1db5ccd64a33dcb5582d8559fab8595 : MS-CEINTL.vscode-language-pack-fr-1.87.2024030609.vsix
e001cf1a529c55c11345ec0de67219750e2a566056d35a25c6505a3dcf956bdf : update_package.py
c06a48019e54ea94522a1d5e425360d5b4d3b947fd6259183e48264369418e8e : WAPT/icon.png
a5a97261381e1d0ad46ee15916abec9c2631d0201f5cc50ceb0197a165a0bbbf : WAPT/certificate.crt
50b743dd54efc37aa3e59fd099e9ff2e06a01b19e924a2d92ae27c4c1e314c86 : WAPT/changelog.txt
11e659ad4263efe282accfd58d851da1dc7bf0ea9faeee912262e4622f1bd3ad : luti.json
fb3323374d00c0fb310697051bc1a1d2714ad794a1b78cd49169ec2c1610300a : WAPT/control