__  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

[email protected]: ~ $
#!/usr/bin/python3

import apt
import os
import subprocess

DEFAULT_DEPENDS_FILE='/usr/share/language-selector/data/pkg_depends'

class LanguageSupport:
    lang_country_map = None

    def __init__(self, apt_cache=None, depends_file=None):
        if apt_cache is None:
            self.apt_cache = apt.Cache()
        else:
            self.apt_cache = apt_cache

        self.pkg_depends = self._parse_pkg_depends(depends_file or
                DEFAULT_DEPENDS_FILE)

    def by_package_and_locale(self, package, locale, installed=False):
        '''Get language support packages for a package and locale.

        Note that this does not include support packages which are not specific
        to a particular trigger package, e. g. general language packs. To get
        those, call this with package==''.

        By default, only return packages which are not installed. If installed
        is True, return all packages instead.
        '''
        packages = []
        depmap = self.pkg_depends.get(package, {})

        # check explicit entries for that locale
        for pkglist in depmap.get(self._langcode_from_locale(locale), {}).values():
            for p in pkglist:
                if p in self.apt_cache:
                    packages.append(p)

        # check patterns for empty locale string (i. e. applies to any locale)
        for pattern_list in depmap.get('', {}).values():
            for pattern in pattern_list:
                for pkg_candidate in self._expand_pkg_pattern(pattern, locale):
                    if pkg_candidate in self.apt_cache:
                        packages.append(pkg_candidate)

        if not installed:
            # filter out installed packages
            packages = [p for p in packages if not self.apt_cache[p].installed]

        # exclude Fcitx packages if GNOME desktop
        desktop = os.environ.get('XDG_CURRENT_DESKTOP')
        if desktop and 'GNOME' in desktop.split(':'):
            for p in list(packages):
                if p.startswith('fcitx'):
                    packages.remove(p)

        # exclude hunspell-de-XX since they conflict with -frami
        for country in ['de', 'at', 'ch']:
            if 'hunspell-de-' + country in packages:
                packages.remove('hunspell-de-' + country)

        return packages

    def by_locale(self, locale, installed=False):
        '''Get language support packages for a locale.

        Return all packages which need to be installed in order to provide
        language support for the given locale for all already installed
        packages. This should be called after adding a new locale to the
        system.

        By default, only return packages which are not installed. If installed
        is True, return all packages instead.
        '''
        packages = []

        for trigger in self.pkg_depends:
            try:
                if trigger == '' or self.apt_cache[trigger].installed:
                    packages += self.by_package_and_locale(trigger, locale, installed)
            except KeyError:
                continue

        return packages

    def by_package(self, package, installed=False):
        '''Get language support packages for a package.

        This will install language support for that package for all available
        system languages. This is a wrapper around available_languages() and
        by_package_and_locale().

        Note that this does not include support packages which are not specific
        to a particular trigger package, e. g. general language packs. To get
        those, call this with package==''.

        By default, only return packages which are not installed. If installed
        is True, return all packages instead.
        '''
        packages = set()
        for lang in self.available_languages():
            packages.update(self.by_package_and_locale(package, lang, installed))
        return packages

    def missing(self, installed=False):
        '''Get language support packages for current system.

        Return all packages which need to be installed in order to provide
        language support all system locales for all already installed
        packages. This should be called after installing the system without
        language support packages (perhaps because there was no network
        available to download them).

        This is a wrapper around available_languages() and by_locale().

        By default, only return packages which are not installed. If installed
        is True, return all packages instead.
        '''
        packages = set()
        for lang in self.available_languages():
                packages.update(self.by_locale(lang, installed))

        return packages

    def available_languages(self):
        '''List available languages in the system.

        The list items can be passed as the "locale" argument of by_locale(),
        by_package_and_locale(), etc.
        '''
        languages = set()

        lang_string = subprocess.check_output(
            ['/usr/share/language-tools/language-options'],
            universal_newlines=True)

        for lang in lang_string.split():
            languages.add(lang)
            if not lang.startswith('zh_'):
                languages.add(lang.split('_')[0])
        if os.path.isdir('/usr/share/locale-langpack/en') == False:
            languages.discard('en')

        return languages

    def _parse_pkg_depends(self, filename):
        '''Parse pkg_depends file.

        Return trigger_package -> langcode -> category -> [dependency,...] map.
        '''
        map = {}
        with open(filename) as f:
            for line in f:
                line = line.strip()
                if not line or line.startswith('#'):
                    continue

                (cat, lc, trigger, dep) = line.split(':')
                map.setdefault(trigger, {}).setdefault(lc, {}).setdefault(cat,
                        []).append(dep)

        return map

    @classmethod
    def _langcode_from_locale(klass, locale):
        '''Turn a locale name into a language code as in pkg_depends.'''

        # special-case Chinese locales, as they are split between -hans and
        # -hant
        if locale.startswith('zh_CN') or locale.startswith('zh_SG'):
            return 'zh-hans'
        # Hong Kong and Taiwan use traditional
        if locale.startswith('zh_'):
            return 'zh-hant'

        return locale.split('_', 1)[0]

    @classmethod
    def _expand_pkg_pattern(klass, pattern, locale):
        '''Return all possible suffixes for given pattern and locale'''

        # people might call this with the pseudo-locales "zh-han[st]", support
        # these as well; we can only guess the country here.
        if locale == 'zh-hans':
            locale = 'zh_CN'
        elif locale == 'zh-hant':
            locale = 'zh_TW'

        locale = locale.split('.', 1)[0].lower()
        variant = None
        country = None
        try:
            (lang, country) = locale.split('_', 1)
            if '@' in country:
                (country, variant) = country.split('@', 1)
        except ValueError:
            lang = locale

        pkgs = [pattern,
                '%s%s' % (pattern, lang)]

        if country:
            pkgs.append('%s%s%s' % (pattern, lang, country))
            pkgs.append('%s%s-%s' % (pattern, lang, country))
        else:
            for country in klass._countries_for_lang(lang):
                pkgs.append('%s%s%s' % (pattern, lang, country))
                pkgs.append('%s%s-%s' % (pattern, lang, country))

        if variant:
            pkgs.append('%s%s-%s' % (pattern, lang, variant))

        if country and variant:
            pkgs.append('%s%s-%s-%s' % (pattern, lang, country, variant))

        # special-case Chinese
        if lang == 'zh':
            if country in ['cn', 'sg']:
                pkgs.append(pattern + 'zh-hans')
            else:
                pkgs.append(pattern + 'zh-hant')

        return pkgs

    @classmethod
    def _countries_for_lang(klass, lang):
        '''Return a list of countries for given language'''

        if klass.lang_country_map is None:
            klass.lang_country_map = {}
            # fill cache
            with open('/usr/share/i18n/SUPPORTED') as f:
                for line in f:
                    line = line.split('#', 1)[0].split(' ')[0]
                    if not line:
                        continue
                    line = line.split('.', 1)[0].split('@')[0]
                    try:
                        (l, c) = line.split('_')
                    except ValueError:
                        continue
                    c = c.lower()
                    klass.lang_country_map.setdefault(l, set()).add(c)

        return klass.lang_country_map.get(lang, [])

def apt_cache_add_language_packs(resolver, cache, depends_file=None):
    '''Add language support for packages marked for installation.
    
    For all packages which are marked for installation in the given apt.Cache()
    object, mark the corresponding language packs and support packages for
    installation as well.

    This function can be used as an aptdaemon modify_cache_after plugin.
    '''
    ls = LanguageSupport(cache, depends_file)
    support_pkgs = set()
    for pkg in cache.get_changes():
        if pkg.marked_install:
            support_pkgs.update(ls.by_package(pkg.name))

    for pkg in support_pkgs:
        cache[pkg].mark_install(from_user=False)

def packagekit_what_provides_locale(cache, type, search, depends_file=None):
    '''PackageKit WhatProvides plugin for locale().'''

    if not search.startswith('locale('):
        raise NotImplementedError('cannot handle query type ' + search)

    locale = search.split('(', 1)[1][:-1]
    ls = LanguageSupport(cache, depends_file)
    pkgs = ls.by_locale(locale, installed=True)
    return [cache[p] for p in pkgs]


Filemanager

Name Type Size Permission Actions
Brlapi-0.8.6.egg-info Folder 0755
CommandNotFound Folder 0755
DistUpgrade Folder 0755
HweSupportStatus Folder 0755
LanguageSelector Folder 0755
Mako-1.3.8.dev0.egg-info Folder 0755
MarkupSafe-2.1.5.egg-info Folder 0755
NvidiaDetector Folder 0755
PIL Folder 0755
PyGObject-3.50.0.dist-info Folder 0755
PyJWT-2.10.1.dist-info Folder 0755
PyNaCl-1.5.0.dist-info Folder 0755
PyYAML-6.0.2.dist-info Folder 0755
Quirks Folder 0755
SSSDConfig Folder 0755
UbuntuDrivers Folder 0755
UpdateManager Folder 0755
__pycache__ Folder 0755
_yaml Folder 0755
apport Folder 0755
apt Folder 0755
apt_inst-stubs Folder 0755
apt_pkg-stubs Folder 0755
aptdaemon Folder 0755
aptdaemon-2.0.2.egg-info Folder 0755
aptsources Folder 0755
attr Folder 0755
attrs Folder 0755
attrs-25.1.0.dist-info Folder 0755
autocommand Folder 0755
autocommand-2.2.2.dist-info Folder 0755
babel Folder 0755
babel-2.17.0.egg-info Folder 0755
bcc Folder 0755
bcc-0.30.0.egg-info Folder 0755
bcrypt Folder 0755
bcrypt-4.2.0.dist-info Folder 0755
beautifulsoup4-4.13.3.dist-info Folder 0755
blinker Folder 0755
blinker-1.9.0.dist-info Folder 0755
bs4 Folder 0755
cairo Folder 0755
certifi Folder 0755
certifi-2025.1.31.egg-info Folder 0755
chardet Folder 0755
chardet-5.2.0.dist-info Folder 0755
click Folder 0755
click-8.1.8.dist-info Folder 0755
cloud_init-25.1.4.egg-info Folder 0755
cloudinit Folder 0755
configobj Folder 0755
configobj-5.0.9.dist-info Folder 0755
cryptography Folder 0755
cryptography-43.0.0.dist-info Folder 0755
cssselect Folder 0755
cssselect-1.3.0.egg-info Folder 0755
cupshelpers Folder 0755
cupshelpers-1.0.egg-info Folder 0755
dateutil Folder 0755
dbus Folder 0755
dbus_python-1.3.2.egg-info Folder 0755
debian Folder 0755
defer Folder 0755
defer-1.0.6.egg-info Folder 0755
distro Folder 0755
distro-1.9.0.dist-info Folder 0755
distro_info Folder 0755
distro_info-1.13.egg-info Folder 0755
duplicity Folder 0755
duplicity-3.0.4.egg-info Folder 0755
fasteners Folder 0755
fasteners-0.18.dist-info Folder 0755
gi Folder 0755
html5lib Folder 0755
html5lib_modern-1.2.egg-info Folder 0755
httplib2 Folder 0755
httplib2-0.22.0.dist-info Folder 0755
idna Folder 0755
idna-3.10.dist-info Folder 0755
inflect Folder 0755
inflect-7.3.1.dist-info Folder 0755
janitor Folder 0755
jaraco Folder 0755
jaraco.context-6.0.1.dist-info Folder 0755
jaraco.functools-4.1.0.dist-info Folder 0755
jinja2 Folder 0755
jinja2-3.1.5.dist-info Folder 0755
jsonpatch-1.32.egg-info Folder 0755
jsonpointer-2.4.egg-info Folder 0755
jsonschema Folder 0755
jsonschema-4.19.2.dist-info Folder 0755
jsonschema_specifications Folder 0755
jsonschema_specifications-2023.12.1.dist-info Folder 0755
jwt Folder 0755
language_selector-0.1.egg-info Folder 0755
launchpadlib Folder 0755
launchpadlib-2.1.0.dist-info Folder 0755
lazr Folder 0755
lazr.restfulclient-0.14.6.dist-info Folder 0755
lazr.uri-1.0.6.dist-info Folder 0755
louis Folder 0755
louis-3.32.0.egg-info Folder 0755
lxml Folder 0755
lxml-5.3.2.egg-info Folder 0755
mako Folder 0755
markdown_it Folder 0755
markdown_it_py-3.0.0.dist-info Folder 0755
markupsafe Folder 0755
mdurl Folder 0755
mdurl-0.1.2.dist-info Folder 0755
monotonic-1.6.egg-info Folder 0755
more_itertools Folder 0755
more_itertools-10.6.0.dist-info Folder 0755
nacl Folder 0755
netaddr Folder 0755
netaddr-1.3.0.dist-info Folder 0755
netifaces-0.11.0.egg-info Folder 0755
netplan Folder 0755
oauthlib Folder 0755
oauthlib-3.2.2.dist-info Folder 0755
olefile Folder 0755
olefile-0.47.egg-info Folder 0755
orca Folder 0755
paramiko Folder 0755
paramiko-3.5.1.egg-info Folder 0755
passlib Folder 0755
passlib-1.7.4.egg-info Folder 0755
pexpect Folder 0755
pexpect-4.9.0.egg-info Folder 0755
pillow-11.1.0.egg-info Folder 0755
pkg_resources Folder 0755
problem_report Folder 0755
psutil Folder 0755
psutil-5.9.8.dist-info Folder 0755
ptyprocess Folder 0755
ptyprocess-0.7.0.dist-info Folder 0755
pycairo-1.27.0.dist-info Folder 0755
pycups-2.0.4.dist-info Folder 0755
pygments Folder 0755
pygments-2.18.0.dist-info Folder 0755
pygtkcompat Folder 0755
pyparsing Folder 0755
pyparsing-3.1.2.dist-info Folder 0755
pyserial-3.5.egg-info Folder 0755
python_apt-3.0.0+ubuntu0.25.4.1.egg-info Folder 0755
python_dateutil-2.9.0.dist-info Folder 0755
python_debian-1.0.1+ubuntu1.dist-info Folder 0755
pyxdg-0.28.dist-info Folder 0755
referencing Folder 0755
referencing-0.35.1.dist-info Folder 0755
requests Folder 0755
requests-2.32.3.dist-info Folder 0755
rich Folder 0755
rich-13.9.4.dist-info Folder 0755
rpds Folder 0755
rpds_py-0.21.0.dist-info Folder 0755
serial Folder 0755
setuptools Folder 0755
softwareproperties Folder 0755
soupsieve Folder 0755
soupsieve-2.6.dist-info Folder 0755
speechd Folder 0755
speechd_config Folder 0755
ssh_import_id Folder 0755
ssh_import_id-5.11.egg-info Folder 0755
systemd Folder 0755
systemd_python-235.egg-info Folder 0755
typeguard Folder 0755
typeguard-4.4.2.dist-info Folder 0755
typing_extensions-4.12.2.dist-info Folder 0755
uaclient Folder 0755
ubuntu_drivers_common-0.0.0.egg-info Folder 0755
ubuntu_pro_client-8001.egg-info Folder 0755
ufw Folder 0755
ufw-0.36.2.egg-info Folder 0755
unattended_upgrades-0.1.egg-info Folder 0755
urllib3 Folder 0755
urllib3-2.3.0.dist-info Folder 0755
usb_creator-0.3.16.egg-info Folder 0755
usbcreator Folder 0755
validate Folder 0755
wadllib Folder 0755
wadllib-2.0.0.dist-info Folder 0755
webencodings Folder 0755
webencodings-0.5.1.egg-info Folder 0755
xdg Folder 0755
xkit Folder 0755
xkit-0.0.0.egg-info Folder 0755
yaml Folder 0755
_cffi_backend.cpython-313-x86_64-linux-gnu.so File 238.02 KB 0644
_dbus_bindings.cpython-313-x86_64-linux-gnu.so File 168.35 KB 0644
_dbus_glib_bindings.cpython-313-x86_64-linux-gnu.so File 22.57 KB 0644
apport_python_hook.py File 8.76 KB 0644
apt_inst.cpython-313-x86_64-linux-gnu.so File 58.74 KB 0644
apt_pkg.cpython-313-x86_64-linux-gnu.so File 355.67 KB 0644
brlapi.cpython-313-x86_64-linux-gnu.so File 341.15 KB 0644
command_not_found-0.3.egg-info File 189 B 0644
cups.cpython-313-x86_64-linux-gnu.so File 224.25 KB 0644
cupsext.cpython-313-x86_64-linux-gnu.so File 45.27 KB 0644
debconf.py File 7.87 KB 0644
distro_info.py File 20.54 KB 0644
hpmudext.cpython-313-x86_64-linux-gnu.so File 18.91 KB 0644
jsonpatch.py File 28.14 KB 0644
jsonpointer.py File 10.71 KB 0644
language_support_pkgs.py File 9.7 KB 0644
monotonic.py File 7 KB 0644
netifaces.cpython-313-x86_64-linux-gnu.so File 26.77 KB 0644
pcardext.cpython-313-x86_64-linux-gnu.so File 22.72 KB 0644
perf.cpython-313-x86_64-linux-gnu.so File 9.42 MB 0644
problem_report.py File 33.37 KB 0644
pysss.cpython-313-x86_64-linux-gnu.so File 35.82 KB 0644
pysss_murmur.cpython-313-x86_64-linux-gnu.so File 14.57 KB 0644
scanext.cpython-313-x86_64-linux-gnu.so File 27.43 KB 0644
typing_extensions.py File 131.3 KB 0644
uno.py File 16.84 KB 0644
unohelper.py File 10.7 KB 0644
xdg-5.egg-info File 201 B 0644
Filemanager