Re: [Libreoffice-commits] core.git: Access2Base - Support API from Python

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

Re: [Libreoffice-commits] core.git: Access2Base - Support API from Python

On 13/08/2019 17:41, Jean-Pierre Ledure (via logerrit) wrote:

> New commits:
> commit f8d6c00d4c6d2e5f63dc660069c858bdc8affec6
> Author:     Jean-Pierre Ledure <[hidden email]>
> AuthorDate: Tue Aug 13 17:36:10 2019 +0200
> Commit:     Jean-Pierre Ledure <[hidden email]>
> CommitDate: Tue Aug 13 17:41:16 2019 +0200
>
>      Access2Base - Support API from Python
>      
>      access2base.py if the Python wrapper to be imported
>      in user scripts.
>      
>      Make file adapted to copy access2base.py in $INSTDIR/program directory
>      File can be found by user scripts on PYTHONPATH
>      
>      Change-Id: Icb62f76d6e9df1110b70471178127c60a4dd46d0
>
[...]
> diff --git a/wizards/source/access2base/access2base.py b/wizards/source/access2base/access2base.py
> new file mode 100644
> index 000000000000..ce20e70e210a
> --- /dev/null
> +++ b/wizards/source/access2base/access2base.py
> @@ -0,0 +1,1448 @@
> +#!/usr/bin/python

Seeing follow-up
<https://gerrit.libreoffice.org/plugins/gitiles/core/+/36432802bc955bed05fb87bef8053bd3b06411f0%5E!/>
"fix shebang of wizards/source/access2base/access2base.py":  Does it
even make sense to have a shebang line, so that it can be executed
directly?  The docstring below suggests that it should be imported as a
Python library, so wouldn't need one?

> +# -*- coding: utf-8 -*-
> +
> +#     Copyright 2012-2020 Jean-Pierre LEDURE
> +
> +# =====================================================================================================================
> +# ===                   The Access2Base library is a part of the LibreOffice project.                               ===
> +# ===                   Full documentation is available on http://www.access2base.com                               ===
> +# =====================================================================================================================
> +
> +# Access2Base is distributed in the hope that it will be useful,
> +# but WITHOUT ANY WARRANTY; without even the implied warranty of
> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
> +
> +# Access2Base is free software; you can redistribute it and/or modify it under the terms of either (at your option):
> +
> +# 1) The Mozilla Public License, v. 2.0. If a copy of the MPL was not
> +# distributed with this file, you can obtain one at http://mozilla.org/MPL/2.0/ .
> +
> +# 2) The GNU Lesser General Public License as published by
> +# the Free Software Foundation, either version 3 of the License, or
> +# (at your option) any later version. If a copy of the LGPL was not
> +# distributed with this file, see http://www.gnu.org/licenses/ .
> +
> +"""
> +The access2base.py module implements an interface between Python (user) scripts and the Access2Base Basic library.
> +
> +Usage:
> +    from access2base import *
> +Additionally, if Python and LibreOffice are started in separate processes:
> +    If LibreOffice started from console ... (example for Linux)
> +        ./soffice --accept='socket,host=localhost,port=2019;urp;'
> +    then insert next statement
> +        A2BConnect(hostname = 'localhost', port = 2019)
> +
> +Specific documentation about Access2Base and Python:
> +    http://www.access2base.com/access2base.html#%5B%5BAccess2Base%20and_Python%5D%5D

Btw, <http://www.access2base.com> mentioned above doesn't appear to
provide information about access2base.py; it offers a search
functionality, but searching for neither "access2base.py" nor "python"
finds anything.  The link
<http://www.access2base.com/access2base.html#%5B%5BAccess2Base%20and_Python%5D%5D>
mentioned here has a stale fragment.
_______________________________________________
LibreOffice mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/libreoffice
JPL JPL
Reply | Threaded
Open this post in threaded view
|

Re: [Libreoffice-commits] core.git: Access2Base - Support API from Python

Hi,

Indeed the <http://www.access2base.com> link points today to the documentation of the library as implemented in the CURRENT releases (6.2/6.3).

Today you can find the draft documentation of the new (6.4) functionalities on <http://www.access2base.com/6.4/access2base.html>  and <http://www.access2base.com/6.4/access2base.html#%5B%5BAccess2Base%20and_Python%5D%5D>.

Those pages will replace the actual information as soon as LO 6.4 will be Beta-released. The comments stored in the sources will be correct at that time.

JP

Le 14/08/19 à 09:24, Stephan Bergmann a écrit :
Btw, <http://www.access2base.com> mentioned above doesn't appear to provide information about access2base.py; it offers a search functionality, but searching for neither "access2base.py" nor "python" finds anything.  The link <http://www.access2base.com/access2base.html#%5B%5BAccess2Base%20and_Python%5D%5D> mentioned here has a stale fragment.

_______________________________________________
LibreOffice mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/libreoffice
sberg sberg
Reply | Threaded
Open this post in threaded view
|

Re: [Libreoffice-commits] core.git: Access2Base - Support API from Python

On 14/08/2019 10:00, Jean-Pierre Ledure wrote:

> Indeed the <http://www.access2base.com> link points today to the
> documentation of the library as implemented in the CURRENT releases
> (6.2/6.3).
>
> Today you can find the draft documentation of the new (6.4)
> functionalities on <http://www.access2base.com/6.4/access2base.html>_  
> and
> _<http://www.access2base.com/6.4/access2base.html#%5B%5BAccess2Base%20and_Python%5D%5D>.
>
> Those pages will replace the actual information as soon as LO 6.4 will
> be Beta-released. The comments stored in the sources will be correct at
> that time.

Thanks.  Any answer for the shebang question (repeated below)?

>> diff --git a/wizards/source/access2base/access2base.py b/wizards/source/access2base/access2base.py
>> new file mode 100644
>> index 000000000000..ce20e70e210a
>> --- /dev/null
>> +++ b/wizards/source/access2base/access2base.py
>> @@ -0,0 +1,1448 @@
>> +#!/usr/bin/python
>
> Seeing follow-up <https://gerrit.libreoffice.org/plugins/gitiles/core/+/36432802bc955bed05fb87bef8053bd3b06411f0%5E!/> "fix shebang of wizards/source/access2base/access2base.py":  Does it even make sense to have a shebang line, so that it can be executed directly?  The docstring below suggests that it should be imported as a Python library, so wouldn't need one?

_______________________________________________
LibreOffice mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/libreoffice
JPL JPL
Reply | Threaded
Open this post in threaded view
|

Re: [Libreoffice-commits] core.git: Access2Base - Support API from Python

Indeed the module should be imported and not executed directly.

=> The #!/usr/bin/python[3] shebang line should be deleted.

Thanks. JP

Le 14/08/19 à 11:27, Stephan Bergmann a écrit :

>
> Any answer for the shebang question (repeated below)?
>
>>> diff --git a/wizards/source/access2base/access2base.py
>>> b/wizards/source/access2base/access2base.py
>>> new file mode 100644
>>> index 000000000000..ce20e70e210a
>>> --- /dev/null
>>> +++ b/wizards/source/access2base/access2base.py
>>> @@ -0,0 +1,1448 @@
>>> +#!/usr/bin/python
>>
>> Seeing follow-up
>> <https://gerrit.libreoffice.org/plugins/gitiles/core/+/36432802bc955bed05fb87bef8053bd3b06411f0%5E!/>
>> "fix shebang of wizards/source/access2base/access2base.py": Does it
>> even make sense to have a shebang line, so that it can be executed
>> directly?  The docstring below suggests that it should be imported as
>> a Python library, so wouldn't need one?
>
>
_______________________________________________
LibreOffice mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/libreoffice
Rene Engelhard Rene Engelhard
Reply | Threaded
Open this post in threaded view
|

Re: [Libreoffice-commits] core.git: Access2Base - Support API from Python

In reply to this post by sberg
Hi,

On Wed, Aug 14, 2019 at 09:24:14AM +0200, Stephan Bergmann wrote:
> Seeing follow-up <https://gerrit.libreoffice.org/plugins/gitiles/core/+/36432802bc955bed05fb87bef8053bd3b06411f0%5E!/>
> "fix shebang of wizards/source/access2base/access2base.py":  Does it even
> make sense to have a shebang line, so that it can be executed directly?  The
> docstring below suggests that it should be imported as a Python library, so
> wouldn't need one?

That's true, but given it was there I fixed it just to be completely
clear.

Regards,

Rene
_______________________________________________
LibreOffice mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/libreoffice