Grammalecte  Check-in [fc98962a37]

Overview
Comment:[lo] lexicon editor: add .json to exported file
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk | lo
Files: files | file ages | folders
SHA3-256: fc98962a3781328bd88549433bb647f5e80d030a1854695f32948b0e93206b9e
User & Date: olr on 2023-06-11 12:58:00
Other Links: manifest | tags
Context
2023-06-12
09:18
[fr] nouvelles règles sur le COD précédent le participe passé check-in: 4101105d41 user: olr tags: trunk, fr
2023-06-11
12:58
[lo] lexicon editor: add .json to exported file check-in: fc98962a37 user: olr tags: trunk, lo
12:57
[lo] text formatter editor: securise import/export check-in: d42cd2d56f user: olr tags: trunk, lo
Changes

Modified gc_lang/fr/oxt/DictOptions/LexiconEditor.py from [4ab28bf540] to [3308c2d10a].

473
474
475
476
477
478
479


480
481
482
483
484
485
486
            if nResult == 1:
                # lFile = xFilePicker.getSelectedFiles()
                lFile = xFilePicker.getFiles()
                spfExported = lFile[0][5:].lstrip("/") # remove file://
                if platform.system() != "Windows":
                    spfExported = "/" + spfExported
                spfExported = urllib.parse.unquote(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 = ui.get('export_message') % spfExported
                else:







>
>







473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
            if nResult == 1:
                # lFile = xFilePicker.getSelectedFiles()
                lFile = xFilePicker.getFiles()
                spfExported = lFile[0][5:].lstrip("/") # remove file://
                if platform.system() != "Windows":
                    spfExported = "/" + spfExported
                spfExported = urllib.parse.unquote(spfExported)
                if not spfExported.endswith((".json", ".JSON")):
                    spfExported += ".json"
                #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 = ui.get('export_message') % spfExported
                else: