Grammalecte  Check-in [ab1e3ccae3]

Overview
Comment:[lo] lexicon editor: fix path for Linux
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk | lo
Files: files | file ages | folders
SHA3-256: ab1e3ccae3f8656d8c50f5be95a77e1922cc96e7ecd96a2ef89b802b84b1f384
User & Date: olr on 2020-09-02 08:15:54
Other Links: manifest | tags
Context
2020-09-02
08:17
[lo][ui] lexicon editor: replace space replacement check-in: 971a16410f user: olr tags: trunk, lo
08:15
[lo] lexicon editor: fix path for Linux check-in: ab1e3ccae3 user: olr tags: trunk, lo
08:14
[fr] ajustements check-in: f79e7e36c9 user: olr tags: trunk, fr
Changes

Modified gc_lang/fr/oxt/DictOptions/LexiconEditor.py from [9068830b8a] to [5dfd11a474].

408
409
410
411
412
413
414
415



416
417
418
419
420
421
422
408
409
410
411
412
413
414

415
416
417
418
419
420
421
422
423
424







-
+
+
+







            xFilePicker.setMultiSelectionMode(False)
            nResult = xFilePicker.execute()
            if nResult == 1:
                # lFile = xFilePicker.getSelectedFiles()
                lFile = xFilePicker.getFiles()
                #print(lFile)
                #MessageBox(self.xDocument, "File(s): " + str(lFile), "DEBUG", INFOBOX)
                spfImported = lFile[0][8:] # remove file:///
                spfImported = lFile[0][5:].lstrip("/") # remove file://
                if platform.system() != "Windows":
                    spfImported = "/" + spfImported
        except:
            spfImported = os.path.join(os.path.expanduser("~"), "fr.personal.json") # workaround
        if spfImported and os.path.isfile(spfImported):
            with open(spfImported, "r", encoding="utf-8") as hDst:
                sJSON = hDst.read()
                try:
                    sTest = json.loads(sJSON)
459
460
461
462
463
464
465
466



467
468
469
470
471
472
473
461
462
463
464
465
466
467

468
469
470
471
472
473
474
475
476
477







-
+
+
+







            xFilePicker.setDefaultName("fr.__personal__.json") # useless, doesn’t work
            xFilePicker.setDisplayDirectory("")
            xFilePicker.setMultiSelectionMode(False)
            nResult = xFilePicker.execute()
            if nResult == 1:
                # lFile = xFilePicker.getSelectedFiles()
                lFile = xFilePicker.getFiles()
                spfExported = lFile[0][8:] # remove file:///
                spfExported = lFile[0][5:].lstrip("/") # remove file://
                if platform.system() != "Windows":
                    spfExported = "/" + spfExported
                #spfExported = os.path.join(os.path.expanduser("~"), "fr.personal.json")
                sJSON = self.xOptionNode.getPropertyValue("personal_dic")
                if sJSON:
                    with open(spfExported, "w", encoding="utf-8") as hDst:
                        hDst.write(sJSON)
                    sMessage = self.dUI.get('export_message', "#err_msg: %s") % spfExported
                else: