This commit is contained in:
El Mau 2022-02-04 21:29:23 -06:00
commit c940f6fcc6
15 changed files with 342 additions and 154 deletions

View File

@ -1,3 +1,8 @@
v 0.9.0 [04-feb-2022]
- Fix - Add minimal version required, issue #5
- Fix - Corrections to english messages, issue #6
- Fix - Update and complete spanish translation, thanks to me, :)
v 0.8.0 [13-jun-2021] v 0.8.0 [13-jun-2021]
- Update easymacro.py - Update easymacro.py
- Add proxy config - Add proxy config

View File

@ -8,22 +8,25 @@ Thanks!
https://git.cuates.net/elmau/zaz https://git.cuates.net/elmau/zaz
### Software libre, no gratis ### Free Software, not gratis software
This extension have a cost of maintenance of 1 euro every year. This extension have a cost of maintenance of 1 euro every year.
BCH: `qztd3l00xle5tffdqvh2snvadkuau2ml0uqm4n875d` G1: `A5DdXxCKPw3QKWVdDVs7CzkNugNUW1sHu5zDJFWxCU2h`
BTC: `3FhiXcXmAesmQzrNEngjHFnvaJRhU1AGWV` ```
Euros
IBAN: BE60 9671 0556 5870
SWIFT / BIC: TRWIBEB1XXX
```
You have others cryptos, welcome too! * [Look the wiki](https://git.cuates.net/elmau/zaz-pip/wiki/home)
* [Mira la wiki](https://git.cuates.net/elmau/zaz-pip/wiki/home_es)
* [Look the wiki](https://gitlab.com/mauriciobaeza/zaz-pip/wikis/home)
* [Mira la wiki](https://gitlab.com/mauriciobaeza/zaz-pip/wikis/home_es)
Thanks for translations: Thanks for translations:
English - @LibreOfficiant
* Help Us * Help Us

View File

@ -1 +1 @@
0.8.0 0.9.0

View File

@ -26,7 +26,7 @@ import logging
TYPE_EXTENSION = 1 TYPE_EXTENSION = 1
# ~ https://semver.org/ # ~ https://semver.org/
VERSION = '0.8.0' VERSION = '0.9.0'
# ~ Your great extension name, not used spaces # ~ Your great extension name, not used spaces
NAME = 'ZAZPip' NAME = 'ZAZPip'
@ -41,7 +41,7 @@ ID = 'net.elmau.zaz.pip'
USE_LOCALES = True USE_LOCALES = True
DOMAIN = 'base' DOMAIN = 'base'
PATH_LOCALES = 'locales' PATH_LOCALES = 'locales'
PATH_PYGETTEXT = '/usr/lib/python3.8/Tools/i18n/pygettext.py' PATH_PYGETTEXT = '/usr/lib/python3.10/Tools/i18n/pygettext.py'
PATH_MSGMERGE = 'msgmerge' PATH_MSGMERGE = 'msgmerge'
@ -57,9 +57,7 @@ ICON = 'images/logo.png'
# ~ Name inside extensions # ~ Name inside extensions
ICON_EXT = f'{NAME.lower()}.png' ICON_EXT = f'{NAME.lower()}.png'
# ~ For example DEPENDENCIES_MINIMAL = '7.0'
# ~ DEPENDENCIES_MINIMAL = '6.0'
DEPENDENCIES_MINIMAL = ''
# ~ Change for you favorite license # ~ Change for you favorite license
LICENSE_EN = f"""This file is part of {NAME}. LICENSE_EN = f"""This file is part of {NAME}.
@ -398,6 +396,7 @@ DATA_DESCRIPTION = {
'icon': ICON_EXT, 'icon': ICON_EXT,
'publisher': PUBLISHER, 'publisher': PUBLISHER,
'update': URL_XML_UPDATE, 'update': URL_XML_UPDATE,
'minimal': DEPENDENCIES_MINIMAL,
} }
DATA_ADDONS = { DATA_ADDONS = {

View File

@ -13,9 +13,9 @@ class ZAZPip(unohelper.Base, XJobExecutor):
def __init__(self, ctx): def __init__(self, ctx):
self.ctx = ctx self.ctx = ctx
def trigger(self, args): def trigger(self, option):
main.ID_EXTENSION = ID_EXTENSION main.ID_EXTENSION = ID_EXTENSION
main.run(args, __file__) main.run(__file__)
return return

View File

@ -1,7 +1,10 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<description xmlns="http://openoffice.org/extensions/description/2006" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:d="http://openoffice.org/extensions/description/2006"> <description xmlns="http://openoffice.org/extensions/description/2006" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:d="http://openoffice.org/extensions/description/2006" xmlns:l="http://libreoffice.org/extensions/description/2011">
<identifier value="net.elmau.zaz.pip"/> <identifier value="net.elmau.zaz.pip"/>
<version value="0.8.0"/> <version value="0.9.0"/>
<dependencies>
<l:LibreOffice-minimal-version value="7.0"/>
</dependencies>
<display-name> <display-name>
<name lang="en">ZAZ Pip</name> <name lang="en">ZAZ Pip</name>
<name lang="es">ZAZ Pip</name> <name lang="es">ZAZ Pip</name>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 9.0 KiB

View File

@ -5,7 +5,7 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2019-10-19 15:19-0500\n" "POT-Creation-Date: 2022-01-28 13:40-0600\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -15,73 +15,121 @@ msgstr ""
"Generated-By: pygettext.py 1.5\n" "Generated-By: pygettext.py 1.5\n"
#: source/ZAZPip.py:49 #: source/pythonpath/main.py:81
msgid "Do you want install PIP?" msgid "Do you want to install 'Python installer package' (PIP)?"
msgstr "" msgstr ""
#: source/ZAZPip.py:67 #: source/pythonpath/main.py:93
msgid "Do you have internet connection?" msgid "Downloading PIP…"
msgstr "" msgstr ""
#: source/ZAZPip.py:73 #: source/pythonpath/main.py:96
msgid "File PIP not save" msgid "Unable to connect to internet"
msgstr "" msgstr ""
#: source/ZAZPip.py:76 #: source/pythonpath/main.py:102
msgid "PIP save correctly..." msgid "Unable to copy PIP installation file"
msgstr "" msgstr ""
#: source/ZAZPip.py:80 #: source/pythonpath/main.py:105
msgid "Start installing PIP..." msgid "PIP installation file has been saved"
msgstr "" msgstr ""
#: source/ZAZPip.py:94 #: source/pythonpath/main.py:108
msgid "PIP installed sucesfully" msgid "Starting PIP installation…"
msgstr "" msgstr ""
#: source/ZAZPip.py:97 #: source/pythonpath/main.py:122
msgid "PIP not installed, see log" msgid "PIP was installed sucessfully"
msgstr "" msgstr ""
#: source/ZAZPip.py:173 #: source/pythonpath/main.py:125
msgid "Not found..." msgid "PIP installation has failed, see log"
msgstr "" msgstr ""
#: source/ZAZPip.py:209 #: source/pythonpath/main.py:198
msgid "Package not found…"
msgstr ""
#: source/pythonpath/main.py:213
msgid "Enter the package name to install"
msgstr ""
#: source/pythonpath/main.py:252
msgid "" msgid ""
"Do you want {}:\n" "Do you want to {}:\n"
"\n" "\n"
"{} ?" "{}?"
msgstr "" msgstr ""
#: source/ZAZPip.py:235 #: source/pythonpath/main.py:278
msgid "Select installed package" msgid "Select installed package"
msgstr "" msgstr ""
#: source/ZAZPip.py:240 #: source/pythonpath/main.py:283
msgid "" msgid ""
"Do you want uninstall:\n" "Do you want to uninstall:\n"
"\n" "\n"
"{} ?" "{}?"
msgstr "" msgstr ""
#: source/ZAZPip.py:327 #: source/pythonpath/main.py:337
msgid "PIP not installed" msgid "Do you want to save this Proxy settings?"
msgstr "" msgstr ""
#: source/ZAZPip.py:346 #: source/pythonpath/main.py:343
msgid "Proxy settings saved sucessfully"
msgstr ""
#: source/pythonpath/main.py:349
msgid "Do you want to remove Proxy settings?"
msgstr ""
#: source/pythonpath/main.py:355
msgid "Proxy settings deleted sucessfully"
msgstr ""
#: source/pythonpath/main.py:413
msgid "'Python installer package' (PIP) is not installed"
msgstr ""
#: source/pythonpath/main.py:432
msgid "Admin PIP" msgid "Admin PIP"
msgstr "" msgstr ""
#: source/ZAZPip.py:359 #: source/pythonpath/main.py:445
msgid "Install PIP" msgid "Install PIP"
msgstr "" msgstr ""
#: source/ZAZPip.py:397 #: source/pythonpath/main.py:494
msgid "Packages" msgid "Packages"
msgstr "" msgstr ""
#: source/ZAZPip.py:429 #: source/pythonpath/main.py:536
msgid "~Close" msgid "~Close"
msgstr "" msgstr ""
#: source/pythonpath/main.py:646
msgid "Host: "
msgstr ""
#: source/pythonpath/main.py:669
msgid "Port: "
msgstr ""
#: source/pythonpath/main.py:690
msgid "User: "
msgstr ""
#: source/pythonpath/main.py:711
msgid "Password: "
msgstr ""
#: source/pythonpath/main.py:733
msgid "Save"
msgstr ""
#: source/pythonpath/main.py:745
msgid "Delete"
msgstr ""

View File

@ -5,84 +5,132 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: \n" "Project-Id-Version: \n"
"POT-Creation-Date: 2019-10-19 15:19-0500\n" "POT-Creation-Date: 2022-01-28 13:40-0600\n"
"PO-Revision-Date: 2019-10-19 15:20-0500\n" "PO-Revision-Date: 2021-01-21 16:32-0500\n"
"Last-Translator: \n"
"Language-Team: \n" "Language-Team: \n"
"Language: en\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Generated-By: pygettext.py 1.5\n" "Generated-By: pygettext.py 1.5\n"
"X-Generator: Poedit 2.2.4\n" "X-Generator: Poedit 2.2.4\n"
"Last-Translator: \n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n"
"Language: en\n"
#: source/ZAZPip.py:49 #: source/pythonpath/main.py:81
msgid "Do you want install PIP?" msgid "Do you want to install 'Python installer package' (PIP)?"
msgstr "" msgstr ""
#: source/ZAZPip.py:67 #: source/pythonpath/main.py:93
msgid "Do you have internet connection?" msgid "Downloading PIP…"
msgstr "" msgstr ""
#: source/ZAZPip.py:73 #: source/pythonpath/main.py:96
msgid "File PIP not save" msgid "Unable to connect to internet"
msgstr "" msgstr ""
#: source/ZAZPip.py:76 #: source/pythonpath/main.py:102
msgid "PIP save correctly..." msgid "Unable to copy PIP installation file"
msgstr "" msgstr ""
#: source/ZAZPip.py:80 #: source/pythonpath/main.py:105
msgid "Start installing PIP..." msgid "PIP installation file has been saved"
msgstr "" msgstr ""
#: source/ZAZPip.py:94 #: source/pythonpath/main.py:108
msgid "PIP installed sucesfully" msgid "Starting PIP installation…"
msgstr "" msgstr ""
#: source/ZAZPip.py:97 #: source/pythonpath/main.py:122
msgid "PIP not installed, see log" msgid "PIP was installed sucessfully"
msgstr "" msgstr ""
#: source/ZAZPip.py:173 #: source/pythonpath/main.py:125
msgid "Not found..." msgid "PIP installation has failed, see log"
msgstr "" msgstr ""
#: source/ZAZPip.py:209 #: source/pythonpath/main.py:198
msgid "Package not found…"
msgstr ""
#: source/pythonpath/main.py:213
msgid "Enter the package name to install"
msgstr ""
#: source/pythonpath/main.py:252
msgid "" msgid ""
"Do you want {}:\n" "Do you want to {}:\n"
"\n" "\n"
"{} ?" "{}?"
msgstr "" msgstr ""
#: source/ZAZPip.py:235 #: source/pythonpath/main.py:278
msgid "Select installed package" msgid "Select installed package"
msgstr "" msgstr ""
#: source/ZAZPip.py:240 #: source/pythonpath/main.py:283
msgid "" msgid ""
"Do you want uninstall:\n" "Do you want to uninstall:\n"
"\n" "\n"
"{} ?" "{}?"
msgstr "" msgstr ""
#: source/ZAZPip.py:327 #: source/pythonpath/main.py:337
msgid "PIP not installed" msgid "Do you want to save this Proxy settings?"
msgstr "" msgstr ""
#: source/ZAZPip.py:346 #: source/pythonpath/main.py:343
msgid "Proxy settings saved sucessfully"
msgstr ""
#: source/pythonpath/main.py:349
msgid "Do you want to remove Proxy settings?"
msgstr ""
#: source/pythonpath/main.py:355
msgid "Proxy settings deleted sucessfully"
msgstr ""
#: source/pythonpath/main.py:413
msgid "'Python installer package' (PIP) is not installed"
msgstr ""
#: source/pythonpath/main.py:432
msgid "Admin PIP" msgid "Admin PIP"
msgstr "" msgstr ""
#: source/ZAZPip.py:359 #: source/pythonpath/main.py:445
msgid "Install PIP" msgid "Install PIP"
msgstr "" msgstr ""
#: source/ZAZPip.py:397 #: source/pythonpath/main.py:494
msgid "Packages" msgid "Packages"
msgstr "" msgstr ""
#: source/ZAZPip.py:429 #: source/pythonpath/main.py:536
msgid "~Close" msgid "~Close"
msgstr "" msgstr ""
#: source/pythonpath/main.py:646
msgid "Host: "
msgstr ""
#: source/pythonpath/main.py:669
msgid "Port: "
msgstr ""
#: source/pythonpath/main.py:690
msgid "User: "
msgstr ""
#: source/pythonpath/main.py:711
msgid "Password: "
msgstr ""
#: source/pythonpath/main.py:733
msgid "Save"
msgstr ""
#: source/pythonpath/main.py:745
msgid "Delete"
msgstr ""

View File

@ -5,8 +5,8 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: \n" "Project-Id-Version: \n"
"POT-Creation-Date: 2019-10-19 15:19-0500\n" "POT-Creation-Date: 2022-01-28 13:40-0600\n"
"PO-Revision-Date: 2019-10-19 15:24-0500\n" "PO-Revision-Date: 2022-01-28 13:43-0600\n"
"Last-Translator: \n" "Last-Translator: \n"
"Language-Team: \n" "Language-Team: \n"
"Language: es\n" "Language: es\n"
@ -14,81 +14,147 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Generated-By: pygettext.py 1.5\n" "Generated-By: pygettext.py 1.5\n"
"X-Generator: Poedit 2.2.4\n" "X-Generator: Poedit 3.0\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: source/ZAZPip.py:49 #: source/pythonpath/main.py:81
msgid "Do you want install PIP?" msgid "Do you want to install 'Python installer package' (PIP)?"
msgstr "¿Desea instalar PIP?" msgstr "¿Desea instalar el instalador de paquetes Python (PIP)?"
#: source/ZAZPip.py:67 #: source/pythonpath/main.py:93
msgid "Do you have internet connection?" msgid "Downloading PIP…"
msgstr "¿Tiene conexión a Internet?" msgstr "Descargando PIP..."
#: source/ZAZPip.py:73 #: source/pythonpath/main.py:96
msgid "File PIP not save" msgid "Unable to connect to internet"
msgstr "No se guardo el archivo PIP" msgstr "No se puede conectar a Internet"
#: source/ZAZPip.py:76 #: source/pythonpath/main.py:102
msgid "PIP save correctly..." msgid "Unable to copy PIP installation file"
msgstr "Archivo PIP guardado correctamente..." msgstr "No se puede copiar el archivo de instalación de PIP"
#: source/ZAZPip.py:80 #: source/pythonpath/main.py:105
msgid "Start installing PIP..." msgid "PIP installation file has been saved"
msgstr "Iniciando instalación de PIP..." msgstr "Se ha guardado el archivo de instalación de PIP"
#: source/ZAZPip.py:94 #: source/pythonpath/main.py:108
msgid "PIP installed sucesfully" msgid "Starting PIP installation…"
msgstr "Iniciando la instalación de PIP..."
#: source/pythonpath/main.py:122
msgid "PIP was installed sucessfully"
msgstr "PIP instalado correctamente" msgstr "PIP instalado correctamente"
#: source/ZAZPip.py:97 #: source/pythonpath/main.py:125
msgid "PIP not installed, see log" msgid "PIP installation has failed, see log"
msgstr "PIP no fue instalado, vea el registro" msgstr "Ha fallado la instalación de PIP, vea el registro"
#: source/ZAZPip.py:173 #: source/pythonpath/main.py:198
msgid "Not found..." msgid "Package not found…"
msgstr "No encontrado..." msgstr "Paquete no encontrado..."
#: source/ZAZPip.py:209 #: source/pythonpath/main.py:213
msgid "Enter the package name to install"
msgstr "Introduzca el nombre del paquete a instalar"
#: source/pythonpath/main.py:252
msgid "" msgid ""
"Do you want {}:\n" "Do you want to {}:\n"
"\n" "\n"
"{} ?" "{}?"
msgstr "" msgstr ""
"¿Desea {}:\n" "¿Desea {}:\n"
"\n" "\n"
"{} ?" "{} ?"
#: source/ZAZPip.py:235 #: source/pythonpath/main.py:278
msgid "Select installed package" msgid "Select installed package"
msgstr "Seleccione un paquete instalado" msgstr "Seleccione un paquete instalado"
#: source/ZAZPip.py:240 #: source/pythonpath/main.py:283
msgid "" msgid ""
"Do you want uninstall:\n" "Do you want to uninstall:\n"
"\n" "\n"
"{} ?" "{}?"
msgstr "" msgstr ""
"¿Desea desinstalar:\n" "¿Desea desinstalar:\n"
"\n" "\n"
"{} ?" "{} ?"
#: source/ZAZPip.py:327 #: source/pythonpath/main.py:337
msgid "PIP not installed" msgid "Do you want to save this Proxy settings?"
msgstr "PIP no esta instalado" msgstr "¿Desea guardar la configuración del Proxy?"
#: source/ZAZPip.py:346 #: source/pythonpath/main.py:343
msgid "Proxy settings saved sucessfully"
msgstr "PIP instalado correctamente"
#: source/pythonpath/main.py:349
msgid "Do you want to remove Proxy settings?"
msgstr "¿Desea eliminar la configuración del Proxy?"
#: source/pythonpath/main.py:355
msgid "Proxy settings deleted sucessfully"
msgstr "PIP instalado correctamente"
#: source/pythonpath/main.py:413
msgid "'Python installer package' (PIP) is not installed"
msgstr "El \"instalador de paquetes de Python\" (PIP) no está instalado"
#: source/pythonpath/main.py:432
msgid "Admin PIP" msgid "Admin PIP"
msgstr "Administrar PIP" msgstr "Administrar PIP"
#: source/ZAZPip.py:359 #: source/pythonpath/main.py:445
msgid "Install PIP" msgid "Install PIP"
msgstr "Instalar PIP" msgstr "Instalar PIP"
#: source/ZAZPip.py:397 #: source/pythonpath/main.py:494
msgid "Packages" msgid "Packages"
msgstr "Paquetes" msgstr "Paquetes"
#: source/ZAZPip.py:429 #: source/pythonpath/main.py:536
msgid "~Close" msgid "~Close"
msgstr "~Cerrar" msgstr "~Cerrar"
#: source/pythonpath/main.py:646
msgid "Host: "
msgstr "Host: "
#: source/pythonpath/main.py:669
msgid "Port: "
msgstr "Puerto: "
#: source/pythonpath/main.py:690
msgid "User: "
msgstr "Usuario: "
#: source/pythonpath/main.py:711
msgid "Password: "
msgstr "Contraseña: "
#: source/pythonpath/main.py:733
msgid "Save"
msgstr "Guardar"
#: source/pythonpath/main.py:745
msgid "Delete"
msgstr "Eliminar"
#~ msgid "Do you have internet connection?"
#~ msgstr "¿Tiene conexión a Internet?"
#~ msgid "File PIP not save"
#~ msgstr "No se guardo el archivo PIP"
#~ msgid "PIP save correctly..."
#~ msgstr "Archivo PIP guardado correctamente..."
#~ msgid "Start installing PIP..."
#~ msgstr "Iniciando instalación de PIP..."
#~ msgid "Not found..."
#~ msgstr "No encontrado..."
#~ msgid "PIP not installed"
#~ msgstr "PIP no esta instalado"

View File

@ -48,10 +48,13 @@ def open_dialog_pip():
return return
def run(args, path_locales): def run(path_locales):
global _ global _
_ = app.install_locales(path_locales) _ = app.install_locales(path_locales)
globals()[args]()
open_dialog_pip()
return return
@ -75,7 +78,7 @@ class Controllers(object):
return return
def cmd_install_pip_action(self, event): def cmd_install_pip_action(self, event):
msg = _('Do you want install PIP?') msg = _("Do you want to install 'Python installer package' (PIP)?")
if not app.question(msg, TITLE): if not app.question(msg, TITLE):
return return
@ -87,22 +90,22 @@ class Controllers(object):
self.d.link_proyect.visible = False self.d.link_proyect.visible = False
self.d.lst_log.visible = True self.d.lst_log.visible = True
path_pip = app.paths.tmp() path_pip = app.paths.tmp()
self.d.lst_log.insert(_('Download PIP...')) self.d.lst_log.insert(_('Downloading PIP…'))
data, h, err = app.url_open(URL_PIP, verify=False) data, h, err = app.url_open(URL_PIP, verify=False)
if err: if err:
msg = _('Do you have internet connection?') msg = _('Unable to connect to internet')
app.errorbox('{}\n\n{}'.format(msg, err)) app.errorbox('{}\n\n{}'.format(msg, err))
return return
app.paths.save_bin(path_pip, data) app.paths.save_bin(path_pip, data)
if not app.paths.exists(path_pip): if not app.paths.exists(path_pip):
msg = _('File PIP not save') msg = _('Unable to copy PIP installation file')
app.errorbox(msg) app.errorbox(msg)
return return
self.d.lst_log.insert(_('PIP save correctly...')) self.d.lst_log.insert(_('PIP installation file has been saved'))
try: try:
self.d.lst_log.insert(_('Start installing PIP...')) self.d.lst_log.insert(_("Starting PIP installation…"))
cmd = f'"{self.path_python}" "{path_pip}" --user' cmd = f'"{self.path_python}" "{path_pip}" --user'
for line in app.popen(cmd): for line in app.popen(cmd):
if isinstance(line, tuple): if isinstance(line, tuple):
@ -116,10 +119,10 @@ class Controllers(object):
self.d.lbl_pip.value = label self.d.lbl_pip.value = label
self.d.cmd_install_pip.visible = False self.d.cmd_install_pip.visible = False
self.d.cmd_admin_pip.visible = True self.d.cmd_admin_pip.visible = True
msg = _('PIP installed sucesfully') msg = _('PIP was installed sucessfully')
app.msgbox(msg) app.msgbox(msg)
else: else:
msg = _('PIP not installed, see log') msg = _('PIP installation has failed, see log')
app.warning(msg) app.warning(msg)
except Exception as e: except Exception as e:
app.errorbox(e) app.errorbox(e)
@ -192,7 +195,7 @@ class Controllers(object):
if line: if line:
self.d.lst_package.select() self.d.lst_package.select()
else: else:
self.d.lst_package.insert(_('Not found...'), 'error.png', show=False) self.d.lst_package.insert(_('Package not found…'), 'error.png', show=False)
return return
def cmd_search_action(self, event): def cmd_search_action(self, event):
@ -207,12 +210,12 @@ class Controllers(object):
def cmd_install_action(self, event): def cmd_install_action(self, event):
name = self.d.txt_search.value.strip() name = self.d.txt_search.value.strip()
if not name: if not name:
msg = _('Enter package name to install') msg = _('Enter the package name to install')
app.warning(msg) app.warning(msg)
self.d.txt_search.set_focus() self.d.txt_search.set_focus()
return return
msg = _(f'Install package: {name} ?') msg = _(f'Do you really want to install package: {name}?')
if not app.question(msg): if not app.question(msg):
return return
@ -246,7 +249,7 @@ class Controllers(object):
opt = 'upgrade' opt = 'upgrade'
name = self.d.lst_package.value name = self.d.lst_package.value
msg = _('Do you want {}:\n\n{} ?').format(opt, name) msg = _('Do you want to {}:\n\n{}?').format(opt, name)
if not app.question(msg, TITLE): if not app.question(msg, TITLE):
return return
@ -277,7 +280,7 @@ class Controllers(object):
return return
name = self.d.lst_package.value name = self.d.lst_package.value
msg = _('Do you want uninstall:\n\n{} ?').format(name) msg = _('Do you want to uninstall:\n\n{}?').format(name)
if not app.question(msg): if not app.question(msg):
return return
@ -304,7 +307,7 @@ class Controllers(object):
if not path: if not path:
return return
msg = _(f'Confirm install from:\n\n{path}') msg = _(f'Do you want to install from:\n\n{path}')
if not app.question(msg): if not app.question(msg):
return return
@ -331,25 +334,25 @@ class ControllersProxy(object):
txt_proxy_user = self.d.txt_proxy_user.value, txt_proxy_user = self.d.txt_proxy_user.value,
txt_proxy_pass = self.d.txt_proxy_pass.value, txt_proxy_pass = self.d.txt_proxy_pass.value,
) )
msg = _('Are you shure save data?') msg = _('Do you want to save this Proxy settings?')
if not app.question(msg): if not app.question(msg):
return return
app.set_config('proxy', data, TITLE) app.set_config('proxy', data, TITLE)
msg = _('Save data sucesfully') msg = _('Proxy settings saved sucessfully')
app.msgbox(msg) app.msgbox(msg)
self.d.close() self.d.close()
return return
def cmd_proxy_delete_action(self, event): def cmd_proxy_delete_action(self, event):
msg = _("Are you shure delete data?") msg = _("Do you want to remove Proxy settings?")
if not app.question(msg): if not app.question(msg):
return return
app.set_config('proxy', {}, TITLE) app.set_config('proxy', {}, TITLE)
msg = _('Delete data sucesfully') msg = _('Proxy settings deleted sucessfully')
app.msgbox(msg) app.msgbox(msg)
self.d.close() self.d.close()
return return
@ -407,7 +410,7 @@ def _create_dialog():
exists_pip = True exists_pip = True
if not label: if not label:
exists_pip = False exists_pip = False
label = _('PIP not installed') label = _("'Python installer package' (PIP) is not installed")
args = { args = {
'Type': 'Label', 'Type': 'Label',
'Name': 'lbl_pip', 'Name': 'lbl_pip',
@ -629,7 +632,7 @@ def _create_dialog():
def _create_dialog_proxy(): def _create_dialog_proxy():
args= { args= {
'Name': 'dlg_proxy', 'Name': 'dlg_proxy',
'Title': 'Zaz-Pip - Config Proxy', 'Title': 'Zaz-Pip - Proxy settings',
'Width': 150, 'Width': 150,
'Height': 100, 'Height': 100,
} }
@ -640,7 +643,7 @@ def _create_dialog_proxy():
args = { args = {
'Type': 'Label', 'Type': 'Label',
'Name': 'lbl_proxy_host', 'Name': 'lbl_proxy_host',
'Label': 'Host: ', 'Label': _('Host: '),
'Width': 40, 'Width': 40,
'Height': 12, 'Height': 12,
'Border': 1, 'Border': 1,
@ -663,7 +666,7 @@ def _create_dialog_proxy():
args = { args = {
'Type': 'Label', 'Type': 'Label',
'Name': 'lbl_proxy_port', 'Name': 'lbl_proxy_port',
'Label': 'Port: ', 'Label': _('Port: '),
'Width': 40, 'Width': 40,
'Height': 12, 'Height': 12,
'Border': 1, 'Border': 1,
@ -684,7 +687,7 @@ def _create_dialog_proxy():
args = { args = {
'Type': 'Label', 'Type': 'Label',
'Name': 'lbl_proxy_user', 'Name': 'lbl_proxy_user',
'Label': 'User: ', 'Label': _('User: '),
'Width': 40, 'Width': 40,
'Height': 12, 'Height': 12,
'Border': 1, 'Border': 1,
@ -705,7 +708,7 @@ def _create_dialog_proxy():
args = { args = {
'Type': 'Label', 'Type': 'Label',
'Name': 'lbl_proxy_pass', 'Name': 'lbl_proxy_pass',
'Label': 'Password: ', 'Label': _('Password: '),
'Width': 40, 'Width': 40,
'Height': 12, 'Height': 12,
'Border': 1, 'Border': 1,

27
zaz.py
View File

@ -75,10 +75,16 @@ class LiboXML(object):
'manifest': 'urn:oasis:names:tc:opendocument:xmlns:manifest:1.0', 'manifest': 'urn:oasis:names:tc:opendocument:xmlns:manifest:1.0',
'xmlns:loext': 'urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0', 'xmlns:loext': 'urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0',
} }
xmlns = 'http://openoffice.org/extensions/description/2006'
xmlns_xlink = 'http://www.w3.org/1999/xlink'
xmlns_l = 'http://libreoffice.org/extensions/description/2011'
NS_DESCRIPTION = { NS_DESCRIPTION = {
'xmlns': 'http://openoffice.org/extensions/description/2006', 'xmlns': xmlns,
'xmlns:xlink': 'http://www.w3.org/1999/xlink', 'xmlns:xlink': xmlns_xlink,
'xmlns:d': 'http://openoffice.org/extensions/description/2006', 'xmlns:d': xmlns,
'xmlns:l': xmlns_l,
} }
NS_ADDONS = { NS_ADDONS = {
'xmlns:xs': 'http://www.w3.org/2001/XMLSchema', 'xmlns:xs': 'http://www.w3.org/2001/XMLSchema',
@ -87,7 +93,7 @@ class LiboXML(object):
NS_UPDATE = { NS_UPDATE = {
'xmlns': 'http://openoffice.org/extensions/update/2006', 'xmlns': 'http://openoffice.org/extensions/update/2006',
'xmlns:d': 'http://openoffice.org/extensions/description/2006', 'xmlns:d': 'http://openoffice.org/extensions/description/2006',
'xmlns:xlink': 'http://www.w3.org/1999/xlink', 'xmlns:xlink': xmlns_xlink,
} }
def __init__(self): def __init__(self):
@ -158,6 +164,13 @@ class LiboXML(object):
key = 'version' key = 'version'
ET.SubElement(doc, key, data[key]) ET.SubElement(doc, key, data[key])
key = 'minimal'
if data[key]:
node = ET.SubElement(doc, 'dependencies')
# ~ attr = {'value': data[key], 'name': f'LibreOffice {data[key]}'}
attr = {'value': data[key]}
ET.SubElement(node, 'l:LibreOffice-minimal-version', attr)
key = 'display-name' key = 'display-name'
node = ET.SubElement(doc, key) node = ET.SubElement(doc, key)
for k, v in data[key].items(): for k, v in data[key].items():
@ -413,14 +426,14 @@ def _compress_oxt():
z.write(fullpath, file_name, zipfile.ZIP_DEFLATED) z.write(fullpath, file_name, zipfile.ZIP_DEFLATED)
z.close() z.close()
log.info('Extension OXT created sucesfully...') log.info('Extension OXT created successfully...')
return return
def _install_and_test(): def _install_and_test():
path_oxt = (_join(DIRS['files'], FILES['oxt']),) path_oxt = (_join(DIRS['files'], FILES['oxt']),)
call(PATHS['install'] + path_oxt) call(PATHS['install'] + path_oxt)
log.info('Install extension sucesfully...') log.info('Install extension successfully...')
log.info('Start LibreOffice...') log.info('Start LibreOffice...')
call(PATHS['soffice']) call(PATHS['soffice'])
return return
@ -525,7 +538,7 @@ def _compile_idl():
call([PATHS['regmerge'], path_rdb, '/UCR', path_urd]) call([PATHS['regmerge'], path_rdb, '/UCR', path_urd])
os.remove(path_urd) os.remove(path_urd)
log.info('Compilate IDL sucesfully...') log.info('Compilate IDL successfully...')
return return