python plugins

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

python plugins

Walter Cazzola
Dear All,
I'm a long time user of gnumeric, today I would like to add a quite simple
python plugin that I'm writing but I have hard time to:
   - find the gnumeric module that all the examples I found around import
   - find some recent tutorial/documentation about python plugin development

I already did some attempt without much luck. My test is:

    from Gnumeric import GnumericError, GnumericErrorVALUE
    import Gnumeric
    import string

    def test_func(coord):
      return coord

    test_functions = {
       'test_func' : test_func
    }

stored in ~/.gnumeric/1.12.46/plugins/test/test_func.py with the plugin.xml

<?xml version="1.0"?>
<plugin id="Gnumeric_ExamsPlugin">
  <information>
  <name>Python Test Plugin</name>
  <description>A test for python plugins.</description>
  </information>
  <loader type="Gnumeric_PythonLoader:python">
  <attribute name="module_name" value="test"/> 3
  </loader>
  <services>
  <service type="function_group" id="test"> 4
  <category>Local Python</category>
  <functions>
              <function name="test_func"/>
  </functions>
  </service>
  </services>
</plugin>

but I can't compile it because of the import (no module is found) and when I
try to select it in tools→plugins I get the error:

   Error while activating plugin "Python Test Plugin".
   Error while activating plugin dependencies.
   Couldn't find plugin with ID="Gnumeric_PythonLoader".

To me seems quite evident that the module gnumeric is not in my system but I
can't find it neither through pip/pip3, through "dnf search" nor googling it.

I'm on a fedora linux box with gnumeric 1.12.46, python 3.7

Any help is really appreciated.

--
_______________________________________________
gnumeric-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gnumeric-list
Reply | Threaded
Open this post in threaded view
|

Re: python plugins

Jean Brefort-2
Hi,

The Python support in gnumeric is limited to Python-2, it can't work
with Python-3.

Regards,
Jean

Le jeudi 02 avril 2020 à 22:10 +0200, Walter Cazzola a écrit :

> Dear All,
> I'm a long time user of gnumeric, today I would like to add a quite
> simple
> python plugin that I'm writing but I have hard time to:
>    - find the gnumeric module that all the examples I found around
> import
>    - find some recent tutorial/documentation about python plugin
> development
>
> I already did some attempt without much luck. My test is:
>
>     from Gnumeric import GnumericError, GnumericErrorVALUE
>     import Gnumeric
>     import string
>
>     def test_func(coord):
>       return coord
>
>     test_functions = {
>        'test_func' : test_func
>     }
>
> stored in ~/.gnumeric/1.12.46/plugins/test/test_func.py with the
> plugin.xml
>
> <?xml version="1.0"?>
> <plugin id="Gnumeric_ExamsPlugin">
>   <information>
>   <name>Python Test Plugin</name>
>   <description>A test for python plugins.</description>
>   </information>
>   <loader type="Gnumeric_PythonLoader:python">
>   <attribute name="module_name" value="test"/> 3
>   </loader>
>   <services>
>   <service type="function_group" id="test"> 4
>   <category>Local Python</category>
>   <functions>
>               <function name="test_func"/>
>   </functions>
>   </service>
>   </services>
> </plugin>
>
> but I can't compile it because of the import (no module is found) and
> when I
> try to select it in tools→plugins I get the error:
>
>    Error while activating plugin "Python Test Plugin".
>    Error while activating plugin dependencies.
>    Couldn't find plugin with ID="Gnumeric_PythonLoader".
>
> To me seems quite evident that the module gnumeric is not in my
> system but I
> can't find it neither through pip/pip3, through "dnf search" nor
> googling it.
>
> I'm on a fedora linux box with gnumeric 1.12.46, python 3.7
>
> Any help is really appreciated.
>

_______________________________________________
gnumeric-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gnumeric-list
Reply | Threaded
Open this post in threaded view
|

Re: [gnumeric-list] Re: python plugins

Walter Cazzola
Hi,
this wouldn't be a problem but the module gnumeric is missing also in pip2.
Even if deprecated and end-of-life since January python2 is still installed in
any linux box.

Walter

On Fri, 3 Apr 2020, Jean Bréfort wrote:

> Hi,
>
> The Python support in gnumeric is limited to Python-2, it can't work
> with Python-3.
>
> Regards,
> Jean
>
> Le jeudi 02 avril 2020 à 22:10 +0200, Walter Cazzola a écrit :
>> Dear All,
>> I'm a long time user of gnumeric, today I would like to add a quite
>> simple
>> python plugin that I'm writing but I have hard time to:
>>    - find the gnumeric module that all the examples I found around
>> import
>>    - find some recent tutorial/documentation about python plugin
>> development
>>
>> I already did some attempt without much luck. My test is:
>>
>>     from Gnumeric import GnumericError, GnumericErrorVALUE
>>     import Gnumeric
>>     import string
>>
>>     def test_func(coord):
>>       return coord
>>
>>     test_functions = {
>>        'test_func' : test_func
>>     }
>>
>> stored in ~/.gnumeric/1.12.46/plugins/test/test_func.py with the
>> plugin.xml
>>
>> <?xml version="1.0"?>
>> <plugin id="Gnumeric_ExamsPlugin">
>>   <information>
>>   <name>Python Test Plugin</name>
>>   <description>A test for python plugins.</description>
>>   </information>
>>   <loader type="Gnumeric_PythonLoader:python">
>>   <attribute name="module_name" value="test"/> 3
>>   </loader>
>>   <services>
>>   <service type="function_group" id="test"> 4
>>   <category>Local Python</category>
>>   <functions>
>>               <function name="test_func"/>
>>   </functions>
>>   </service>
>>   </services>
>> </plugin>
>>
>> but I can't compile it because of the import (no module is found) and
>> when I
>> try to select it in tools→plugins I get the error:
>>
>>    Error while activating plugin "Python Test Plugin".
>>    Error while activating plugin dependencies.
>>    Couldn't find plugin with ID="Gnumeric_PythonLoader".
>>
>> To me seems quite evident that the module gnumeric is not in my
>> system but I
>> can't find it neither through pip/pip3, through "dnf search" nor
>> googling it.
>>
>> I'm on a fedora linux box with gnumeric 1.12.46, python 3.7
>>
>> Any help is really appreciated.
>>
>

--
_______________________________________________
gnumeric-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gnumeric-list