Commit Graph
31 Commits
Author SHA1 Message Date
Ilmari Lauhakangas 2c3bf9471d odk, oox, pyuno: fix issues found by Ruff linter
Change-Id: I79d56453877a10502768b522ca93da3990891c0b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171098
Tested-by: Jenkins
Tested-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
2024-07-27 18:52:48 +02:00
Mike Kaganski 2875d11939 tdf#150982: properly unquote (URL-decode) vnd.sun.star.expand payload
Similar to what is done in bootstrap_expandUri, expandUnoRcUrl,
UrlReference::expand, JavaLoader.expand_url, and is documented
in XVndSunStarExpandUrl interface.

Change-Id: I92917adb38e42c3926494427e4df2451298033e0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140042
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-09-16 12:55:06 +02:00
Mike Kaganski 3e524922b9 Wrap "open" into "with"
Change-Id: I1ecc16ddf565ac1f7306289fd51b673ed928cc20
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107329
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2020-12-07 08:14:46 +01:00
Julien Nabet 62887aa764 Fix ResourceWarning in pythonloader.py
trace:
/home/julien/lo/libreoffice/instdir/program/pythonloader.py:146: ResourceWarning: unclosed file <_io.TextIOWrapper name='/home/julien/lo/libreoffice/instdir/share/extensions/numbertext/reg.uno.py' mode='r' encoding='utf_8'>
  mod = self.getModuleFromUrl( locationUrl )
ResourceWarning: Enable tracemalloc to get the object allocation traceback

Change-Id: I106ab6c3c9024a8c1a4624a3b64958dc205e30e6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107232
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-12-04 20:02:57 +01:00
Noel Grandin 0a3d414fb0 fix some more python 3.8 deprecation warnings
Change-Id: I8bdbf05f1357aea83a3cdda2f06d63c7d04de8f9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94561
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-05-20 12:37:38 +02:00
Michael Stahl c4fa6efa67 pyuno,*: kill Python 2 support with fire
Python 2 support was retained for use with --enable-python=system
on RHEL7 and SLES.  The time has arrived to remove it.

Some .py files that were imported from third parties are not changed to
enable easier replacement with updated versions if necessary.

solenv/gdb should continue to support Python 2.

bin/get-bugzilla-attachments-by-mimetype requires Python 2 to access
Launchpad.

Change-Id: I26414ae8e9f8402c90336af82020135685694217
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91697
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@cib.de>
2020-04-09 16:43:34 +02:00
Mike Kaganski a76d229fa9 sys.version is for displaying; use sys.version_info for version check
Change-Id: If0d26019d9f842bcf56c1e01c46cc86c21523c3b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87476
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2020-01-28 13:01:26 +01:00
Thomas Viehmann dbbf20a4b4 For Python extensions, set __file__ before executing the module
Previously __file__ was set after executing the module. This meant,
however that it was not available during execution.
This patch moves setting __file__ before the execution.

As __file__ is a string (and not bytes), we remove the encoding.

Change-Id: I63fe34b6f5d30f53aab16627d413c87b9de81992
Reviewed-on: https://gerrit.libreoffice.org/70048
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2019-04-02 09:22:03 +02:00
Michael Stahl aa70294ffc normalize existing emacs/vim mode-lines in python files
Bunch of these were setting C++ or Make modes and icky tabs...

Also, reportedly Emacs can figure out to enable python-mode
automatically.

Change-Id: I50072488fb92cb4d27aa3f74f717a28ae3967543
2016-10-26 22:16:08 +02:00
Stephan Bergmann 431b49fbec No serviceNames attribute in Loader
Change-Id: I6cc001d18683fc412f0ec0b6a33054d6e745463f
2014-01-07 15:38:19 +01:00
Stephan Bergmann c2445b03f4 fdo#59728: Fix encoding of .py files as UTF-8 for Python 3
...where it could default to something like CP 1252 instead on Windows, while
keeping backwards compatibility for now with running under Python 2 (where
things apparently worked well with the original code).

Change-Id: I0ddd06771a36e1cd2cc2ce78abd8bd667db7778f
2013-01-23 17:58:25 +01:00
László Németh 71f9633d67 some not important Python3.3 port (pythonloader DEBUG mode)
Change-Id: I9a6ee04524c0ecd10301c17d2ca6da156d1c2160
2012-12-19 11:16:14 +01:00
Julien Nabet a0f86c9c1d Python/pep8: fix E711 (is or is not None instead of = or !=) in pyuno module
Change-Id: I8ee9abc9a31a6d7791a006ed589d83d5858de267
2012-12-09 23:16:08 +01:00
Michael Stahl a38b59265c pyuno: adjust uno.ByteSequence to work with "bytes"
This is necessary for Python3; "str" type is still accepted so it runs
on Python 2 as well.

Change-Id: I51098feca00e4cd8ce3ceebf663d4ce79252cbcd
2012-11-25 16:06:40 +01:00
Michael Meeks 1d3e6bb6c4 re-base on ALv2 code. Removing:
a patch contributed by Pedro Giffuni to handle FreeBSD issues
    that are unlikely to be an issue with a two-layer LibreOffice.
    http://svn.apache.org/viewvc?view=revision&revision=1180509
2012-07-02 16:52:50 +01:00
Lionel Elie Mamane 7f4cb27518 fix loading of python-uno module by package.module name 2011-12-12 22:14:50 +01:00
Caolán McNamara 9e8ac5c91e more debug spew in non-debug product 2011-12-12 15:21:49 +00:00
Caolán McNamara fb37327df4 Let's not have debug spew all the time 2011-12-12 14:17:08 +00:00
Michael Meeks 1a7eee2446 Improve pyuno debugging in various ways - add stack traces etc. 2011-12-05 20:53:24 +00:00
Michael Meeks 41b8bad143 wizards: completely work python wizard packaging and registration
Also improve exception handling and error printing in pythonloader
Allow registration of explicit .py components - the only method that works
2011-12-05 20:53:24 +00:00
Christian Lohmaier c78b2702a4 minor whitespace/makefile cleanup 2011-07-24 19:23:32 +02:00
Andreas Becker a09ce46818 Port PyUno to support Python 3 2011-05-07 20:35:03 +01:00
Jens-Heiner Rechtien 7c80db2eb3 changefileheader2: #i109125#: change source file copyright notice from Sun Microsystems to Oracle; remove CVS style keywords (RCSfile, Revision) 2010-02-12 15:01:35 +01:00
Rüdiger Timm 392fb06810 CWS-TOOLING: integrate CWS sb101
2008-12-08 16:52:06 +0100 sb  r265009 : #i95330# python23.dll needs to be copied to brand layer, not just moved there
2008-11-24 18:15:54 +0100 sb  r264259 : #i95022# tools::extendApplicationEnvironment gets URE_BOOTSTRAP value from outside bootstrap.cxx, so needs to operate in LOOKUP_MODE_URE_BOOTSTRAP, too
2008-11-20 21:12:31 +0100 jbu  r264103 : deactivated debug log
2008-11-20 21:09:03 +0100 jbu  r264102 : #i95331# ld_library_path now contains ure/lib directory
2008-11-20 21:05:37 +0100 jbu  r264101 : #i95330# python.dll is now installed in the brand-program directory (unix remains unchanged)
2008-11-20 20:46:57 +0100 jbu  r264099 : #i95118# + #i93994# Python scripts in share and user uno packages now work again
2008-11-20 20:38:23 +0100 jbu  r264098 : #i95037# python wrapper now waits for completion of python executable and currectly returns the exit state
2008-11-20 10:46:28 +0100 sb  r264034 : #i95028# import socket, since on Windows sal3.dll no longer calls WSAStartup (and import socket does)
2008-11-18 17:01:09 +0100 sb  r263784 : #i96314# fixed encode()
2008-11-18 15:59:17 +0100 sb  r263779 : #i95024# missing vnd.sun.star.pathname: in URE_BOOTSTRAP
2008-11-18 13:51:36 +0100 sb  r263765 : #i95022# treat \ and $ verbatim in URE_BOOTSTRAP=vnd.sun.star.pathname values
2008-12-11 12:57:12 +00:00
Kurt Zenker a565357d1d INTEGRATION: CWS pyunosystempaths_DEV300 (1.5.16); FILE MERGED
2008/04/23 20:04:52 fs 1.5.16.1: #i86251# committing on behalf of jbu@openoffice.org
2008-05-20 13:32:42 +00:00
Rüdiger Timm b1b762e56f INTEGRATION: CWS changefileheader (1.5.12); FILE MERGED
2008/03/31 07:24:58 rt 1.5.12.1: #i87441# Change license header to LPGL v3.
2008-04-11 09:30:37 +00:00
Kurt Zenker 72a86e8e74 INTEGRATION: CWS pyunofixes4 (1.4.66); FILE MERGED
2007/07/30 19:43:44 jbu 1.4.66.1: adding pythonpath import functionality, fixed a gc deadlock, fixed some minor issues
2007-10-11 10:52:00 +00:00
Rüdiger Timm eaa32f6f84 INTEGRATION: CWS ooo19126 (1.3.42); FILE MERGED
2005/09/05 18:39:19 rt 1.3.42.1: #i54170# Change license header: remove SISSL
2005-09-08 15:50:23 +00:00
Jens-Heiner Rechtien 0b872a33ef INTEGRATION: CWS geordi2q14 (1.2.34); FILE MERGED
2004/01/29 18:09:47 hr 1.2.34.1: #111934#: merge CWS ooo111fix2
2004-02-02 18:28:45 +00:00
Jörg Budischewski ff78d7629b #i11753# rewritten loader implementation, pyuno now supports file and vnd.sun.star.expand protocols 2003-04-06 16:16:47 +00:00
Jörg Budischewski e80bdbafeb initial checkin for the pyuno-0.9.2 release 2003-03-23 11:12:59 +00:00