Grammalecte  Check-in [0c8b8e29c0]

Overview
Comment:[lo] console from APSO
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk | lo
Files: files | file ages | folders
SHA3-256: 0c8b8e29c0b5bb3942b10ac7e2c92c6588e08199ad3a5efc44f0f5d04d11ad2a
User & Date: olr on 2019-07-12 09:33:34
Other Links: manifest | tags
Context
2019-07-12
09:42
[lo] lexicon editor: fix spellchecker loading check-in: 28d0015e4b user: olr tags: trunk, lo
09:33
[lo] console from APSO check-in: 0c8b8e29c0 user: olr tags: trunk, lo
07:21
[fr] ajustements check-in: 5a1cd66810 user: olr tags: trunk, fr
Changes

Modified gc_core/py/oxt/helpers.py from [f3ef6493bc] to [f1e81ad455].

1
2
3
4
5
6
7
8
9
10











11
12
13
14
15
16
17
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28










+
+
+
+
+
+
+
+
+
+
+







# Helpers for LibreOffice extension

import os
import traceback

import uno

from com.sun.star.beans import PropertyValue
from com.sun.star.uno import RuntimeException as _rtex


def apso_console ():
    try:
        ctx = uno.getComponentContext()
        ctx.ServiceManager.createInstance("apso.python.script.organizer.impl")
        # now we can import apso_utils library
        from apso_utils import console
        console()
    except:
        traceback.print_exc()


def xray (myObject):
    "XRay - API explorer"
    try:
        sm = uno.getComponentContext().ServiceManager
        mspf = sm.createInstanceWithContext("com.sun.star.script.provider.MasterScriptProviderFactory", uno.getComponentContext())
        scriptPro = mspf.createScriptProvider("")

Modified gc_lang/fr/oxt/ContextMenu/ContextMenu.py from [84e566480c] to [95fd6d10c1].

1
2
3
4
5
6
7
8

1
2
3
4
5
6
7
-







# -*- coding: utf8 -*-
# Grammalecte - Lexicographe
# by Olivier R. License: MPL 2

import uno
import unohelper
import traceback

93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
92
93
94
95
96
97
98

99
100
101
102
103
104
105







-







    def _addItemToContextMenu (self, xContextMenu, i, sType, **args):
        xMenuItem = xContextMenu.createInstance("com.sun.star.ui."+sType)
        #echo("com.sun.star.ui."+sType)
        for k, v in args.items():
            xMenuItem.setPropertyValue(k, v)
            #print("> ", k, v, xMenuItem)
        xContextMenu.insertByIndex(i, xMenuItem)

        return i + 1

    def _getWord (self):
        try:
            xDoc = xDesktop.getCurrentComponent()
            xViewCursor = xDoc.CurrentController.ViewCursor
            if xViewCursor.CharLocale.Language != "fr":