Compare commits
8 Commits
Author | SHA1 | Date |
---|---|---|
Mauricio | fd4aeef140 | |
El Mau | fd706d59ba | |
El Mau | cf41711716 | |
El Mau | c59b1258da | |
El Mau | d27630c7df | |
Mauricio Baeza | a83b338a50 | |
Mauricio Baeza | 08bc00138b | |
Mauricio Baeza | 8c69515f06 |
|
@ -1,4 +1,7 @@
|
|||
v 0.2.0 [12-jul-2023]
|
||||
- Add function `zstrip`
|
||||
|
||||
v 0.1.0 [27-jun-2021]
|
||||
- Initial version
|
||||
- Function `reverse`
|
||||
- Function `eval`
|
||||
- Function `zreverse`
|
||||
- Function `zeval`
|
||||
|
|
|
@ -5,8 +5,9 @@ LibreOffice Calc Add-in
|
|||
|
||||
## Functions
|
||||
|
||||
* `zreverse` - Get reverse string
|
||||
* `zeval` - Parse and execute expresions
|
||||
* `zreverse` - Get reverse string.
|
||||
* `zeval` - Parse and execute expresions.
|
||||
* `zstrip` - Remove extra spaces or characteres. [Look](https://docs.python.org/3/library/stdtypes.html#str.strip)
|
||||
|
||||
|
||||
![Image](https://git.cuates.net/elmau/zaz-functions/raw/commit/b0e0a93a8ef27523cd3e0e17ec2df1d085881e60/images/image1.png "Functions")
|
||||
|
|
30
conf.py
30
conf.py
|
@ -29,7 +29,7 @@ TYPE_EXTENSION = 3
|
|||
NAME = 'ZAZFunctions'
|
||||
|
||||
# ~ https://semver.org/
|
||||
VERSION = '0.1.0'
|
||||
VERSION = '0.2.0'
|
||||
|
||||
|
||||
# ~ Should be unique, used URL inverse
|
||||
|
@ -80,13 +80,13 @@ LICENSE_ES = LICENSE_EN
|
|||
|
||||
INFO = {
|
||||
'en': {
|
||||
'display_name': 'My first extension',
|
||||
'description': 'My great extension',
|
||||
'display_name': 'ZAZ Functions',
|
||||
'description': 'Utils functions for Calc',
|
||||
'license': LICENSE_EN,
|
||||
},
|
||||
'es': {
|
||||
'display_name': 'Mi primer extensión',
|
||||
'description': 'Mi gran extensión',
|
||||
'display_name': 'ZAZ Funciones',
|
||||
'description': 'Funciones utiles para Calc',
|
||||
'license': LICENSE_ES,
|
||||
},
|
||||
}
|
||||
|
@ -142,7 +142,7 @@ FUNCTIONS = {
|
|||
'parameters': {
|
||||
'value': {
|
||||
'displayname': {'en': 'string', 'es': 'texto'},
|
||||
'description': {'en': 'The string', 'es': 'El cadena'},
|
||||
'description': {'en': 'The string', 'es': 'La cadena'},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -156,6 +156,20 @@ FUNCTIONS = {
|
|||
},
|
||||
},
|
||||
},
|
||||
'zstrip': {
|
||||
'displayname': {'en': 'zstrip', 'es': 'zstrip'},
|
||||
'description': {'en': 'Remove spaces at the beginning and at the end of the string.', 'es': 'Buscar en un rango por fila'},
|
||||
'parameters': {
|
||||
'value': {
|
||||
'displayname': {'en': 'string', 'es': 'texto'},
|
||||
'description': {'en': 'Value to trim', 'es': 'Valor a limpiar'},
|
||||
},
|
||||
'characters': {
|
||||
'displayname': {'en': 'characters', 'es': 'caracteres'},
|
||||
'description': {'en': 'A set of characters to remove as leading/trailing characters', 'es': 'Caracteres a elmininar de la cadena'},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
# ~ FUNCTIONS = {}
|
||||
|
||||
|
@ -176,7 +190,7 @@ DIRS = {
|
|||
'description': 'description',
|
||||
'images': 'images',
|
||||
'registration': 'registration',
|
||||
'files': 'files',
|
||||
'files': 'extension',
|
||||
'office': 'Office',
|
||||
'locales': PATH_LOCALES,
|
||||
'pythonpath': True,
|
||||
|
@ -209,7 +223,7 @@ URL_OXT = ''
|
|||
# ~ Default program for test: --calc, --writer, --draw
|
||||
PROGRAM = '--calc'
|
||||
# ~ Path to file for test
|
||||
FILE_TEST = ''
|
||||
FILE_TEST = '/home/elmau/Projects/libre_office/examples/zutil_functions.ods'
|
||||
|
||||
PATHS = {
|
||||
'idlc': '/usr/lib/libreoffice/sdk/bin/idlc',
|
||||
|
|
Binary file not shown.
|
@ -26,7 +26,7 @@
|
|||
</prop>
|
||||
<prop oor:name="Description">
|
||||
<value xml:lang="en">The string</value>
|
||||
<value xml:lang="es">El cadena</value>
|
||||
<value xml:lang="es">La cadena</value>
|
||||
</prop>
|
||||
</node>
|
||||
</node>
|
||||
|
@ -57,6 +57,42 @@
|
|||
</prop>
|
||||
</node>
|
||||
</node>
|
||||
</node> <node oor:name="zstrip" oor:op="replace">
|
||||
<prop oor:name="DisplayName">
|
||||
<value xml:lang="en">zstrip</value>
|
||||
<value xml:lang="es">zstrip</value>
|
||||
</prop>
|
||||
<prop oor:name="Description">
|
||||
<value xml:lang="en">Remove spaces at the beginning and at the end of the string.</value>
|
||||
<value xml:lang="es">Buscar en un rango por fila</value>
|
||||
</prop>
|
||||
<prop oor:name="Category">
|
||||
<value>Add-In</value>
|
||||
</prop>
|
||||
<prop oor:name="CompatibilityName">
|
||||
<value xml:lang="en">AutoAddIn.zstrip</value>
|
||||
</prop>
|
||||
<node oor:name="Parameters">
|
||||
<node oor:name="value" oor:op="replace">
|
||||
<prop oor:name="DisplayName">
|
||||
<value xml:lang="en">string</value>
|
||||
<value xml:lang="es">texto</value>
|
||||
</prop>
|
||||
<prop oor:name="Description">
|
||||
<value xml:lang="en">Value to trim</value>
|
||||
<value xml:lang="es">Valor a limpiar</value>
|
||||
</prop>
|
||||
</node> <node oor:name="characters" oor:op="replace">
|
||||
<prop oor:name="DisplayName">
|
||||
<value xml:lang="en">characters</value>
|
||||
<value xml:lang="es">caracteres</value>
|
||||
</prop>
|
||||
<prop oor:name="Description">
|
||||
<value xml:lang="en">A set of characters to remove as leading/trailing characters</value>
|
||||
<value xml:lang="es">Caracteres a elmininar de la cadena</value>
|
||||
</prop>
|
||||
</node>
|
||||
</node>
|
||||
</node>
|
||||
</node>
|
||||
</node>
|
||||
|
|
|
@ -3,12 +3,14 @@
|
|||
|
||||
#include <com/sun/star/uno/XInterface.idl>
|
||||
|
||||
|
||||
module net { module elmau { module zaz { module functions {
|
||||
|
||||
interface XZAZFunctions : com::sun::star::uno::XInterface
|
||||
{
|
||||
string zreverse([in] string value);
|
||||
any zeval([in] string value);
|
||||
string zstrip([in] string value, [in] any characters);
|
||||
};
|
||||
|
||||
service functions {
|
||||
|
|
Binary file not shown.
|
@ -20,6 +20,13 @@ class ZAZFunctions(unohelper.Base, XZAZFunctions):
|
|||
result = eval(value)
|
||||
return result
|
||||
|
||||
def zstrip(self, value, characters=''):
|
||||
options = ' '
|
||||
if not characters is None:
|
||||
options = characters
|
||||
result = value.strip(options)
|
||||
return result
|
||||
|
||||
|
||||
g_ImplementationHelper = unohelper.ImplementationHelper()
|
||||
g_ImplementationHelper.addImplementation(ZAZFunctions, ID_EXTENSION, SERVICE)
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
<?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">
|
||||
<identifier value="net.elmau.zaz.functions"/>
|
||||
<version value="0.1.0"/>
|
||||
<version value="0.2.0"/>
|
||||
<display-name>
|
||||
<name lang="en">My first extension</name>
|
||||
<name lang="es">Mi primer extensión</name>
|
||||
<name lang="en">ZAZ Functions</name>
|
||||
<name lang="es">ZAZ Funciones</name>
|
||||
</display-name>
|
||||
<extension-description>
|
||||
<src lang="en" xlink:href="description/desc_en.txt"/>
|
||||
|
|
|
@ -1 +1 @@
|
|||
My great extension
|
||||
Utils functions for Calc
|
|
@ -1 +1 @@
|
|||
Mi gran extensión
|
||||
Funciones utiles para Calc
|
Loading…
Reference in New Issue