You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by da...@apache.org on 2026/05/21 16:28:29 UTC

(openoffice) branch python-editing-embedding updated (8e23be7474 -> a7a66e361b)

This is an automated email from the ASF dual-hosted git repository.

asf-gitbox-commits pushed a change to branch python-editing-embedding
in repository https://gitbox.apache.org/repos/asf/openoffice.git


    from 8e23be7474 Use pop() instead of del to delete keys from the self.modules dictionary for Python scripts, so KeyError isn't thrown when the key is missing.
     new d7d7c2bb24 Remove a duplicate method.
     new a7a66e361b Use a fixed width font for the Python editor.

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 main/scripting/source/pyprov/pythonscript.py | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)


(openoffice) 01/02: Remove a duplicate method.

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

asf-gitbox-commits pushed a commit to branch python-editing-embedding
in repository https://gitbox.apache.org/repos/asf/openoffice.git

commit d7d7c2bb2491c9ea01f6567c93f888a1a49f8f40
Author: Damjan Jovanovic <da...@apache.org>
AuthorDate: Wed May 13 19:53:14 2026 +0200

    Remove a duplicate method.
    
    Patch by: me
---
 main/scripting/source/pyprov/pythonscript.py | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/main/scripting/source/pyprov/pythonscript.py b/main/scripting/source/pyprov/pythonscript.py
index 677ff90006..f61dec865b 100644
--- a/main/scripting/source/pyprov/pythonscript.py
+++ b/main/scripting/source/pyprov/pythonscript.py
@@ -1322,14 +1322,9 @@ class PythonScriptProvider( unohelper.Base, XBrowseNode, XScriptProvider, XNameC
     def getType( self ):
         return self.dirBrowseNode.getType()
 
-    def getScript( self, uri ):
-        log.debug( "DirBrowseNode getScript " + uri + " invoked" )
-
-        raise IllegalArgumentException( "DirBrowseNode couldn't instantiate script " + uri , self , 0 )
-
     def getScript( self, scriptUri ):
         try:
-            log.debug( "getScript " + scriptUri + " invoked")
+            log.debug( "DirBrowseNode getScript " + scriptUri + " invoked")
 
             storageUri = self.provCtx.getStorageUrlFromPersistentUrl(
                 self.provCtx.uriHelper.getStorageURI(scriptUri) );


(openoffice) 02/02: Use a fixed width font for the Python editor.

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

asf-gitbox-commits pushed a commit to branch python-editing-embedding
in repository https://gitbox.apache.org/repos/asf/openoffice.git

commit a7a66e361bbbb1aeebaa772eda89967338b12107
Author: Damjan Jovanovic <da...@apache.org>
AuthorDate: Thu May 21 18:26:52 2026 +0200

    Use a fixed width font for the Python editor.
    
    Patch by: me
---
 main/scripting/source/pyprov/pythonscript.py | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/main/scripting/source/pyprov/pythonscript.py b/main/scripting/source/pyprov/pythonscript.py
index f61dec865b..4e7fc4667e 100644
--- a/main/scripting/source/pyprov/pythonscript.py
+++ b/main/scripting/source/pyprov/pythonscript.py
@@ -135,7 +135,8 @@ from com.sun.star.container import XNameContainer
 from com.sun.star.xml.sax import XDocumentHandler, InputSource
 from com.sun.star.uno import Exception as UnoException
 from com.sun.star.script import XInvocation
-from com.sun.star.awt import XActionListener
+from com.sun.star.awt import XActionListener, FontDescriptor
+from com.sun.star.awt.FontPitch import FIXED
 
 from com.sun.star.script.provider import XScriptProvider, XScript, XScriptContext, ScriptFrameworkErrorException
 from com.sun.star.script.browse import XBrowseNode
@@ -551,6 +552,10 @@ def createEditorDialog( ctx ):
     closeButtonModel.PushButtonType = 2  # CANCEL
     closeButtonModel.Label = "Close"
 
+    fontDescriptor = FontDescriptor()
+    fontDescriptor.Name = "SomeFixedWidthFont"
+    fontDescriptor.Pitch = FIXED
+
     textFieldModel = dialogModel.createInstance(
         "com.sun.star.awt.UnoControlEditModel" )
     textFieldModel.PositionX = 6
@@ -561,6 +566,7 @@ def createEditorDialog( ctx ):
     textFieldModel.HScroll = True
     textFieldModel.VScroll = True
     textFieldModel.MultiLine = True
+    textFieldModel.FontDescriptor = fontDescriptor
 
     dialogModel.insertByName( "RunButton", runButtonModel )
     dialogModel.insertByName( "SaveButton", saveButtonModel )