Grammalecte  Diff

Differences From Artifact [bbf80e041f]:

To Artifact [1cf16e149d]:


382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
        #xFilePicker.setMultiSelectionMode(False)
        #nResult = xFilePicker.execute()
        #if nResult == 1:
        #    lFile = xFilePicker.getSelectedFiles()
        #    lFile = xFilePicker.getFiles()
        #    print(lFile)
        # workaround
        spfImported = os.path.join(os.environ['USERPROFILE'], "fr.personal.json")
        if os.path.isfile(spfImported):
            with open(spfImported, "r", encoding="utf-8") as hDst:
                sJSON = hDst.read()
                try:
                    sTest = json.loads(sJSON)
                except:
                    sMessage = self.dUI.get('wrong_json', "#err_msg: %s") % spfImported







|







382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
        #xFilePicker.setMultiSelectionMode(False)
        #nResult = xFilePicker.execute()
        #if nResult == 1:
        #    lFile = xFilePicker.getSelectedFiles()
        #    lFile = xFilePicker.getFiles()
        #    print(lFile)
        # workaround
        spfImported = os.path.join(os.path.expanduser("~"), "fr.personal.json")
        if os.path.isfile(spfImported):
            with open(spfImported, "r", encoding="utf-8") as hDst:
                sJSON = hDst.read()
                try:
                    sTest = json.loads(sJSON)
                except:
                    sMessage = self.dUI.get('wrong_json', "#err_msg: %s") % spfImported
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
            self.xOptionNode.setPropertyValue("personal_dic", "")
            self.xSettingNode.commitChanges()
            self.xNumDic.Label = "0"
            self.xDateDic.Label = self.dUI.get("void", "#err")

    def exportDictionary (self):
        try:
            spfExported = os.path.join(os.environ['USERPROFILE'], "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:
                sMessage = self.dUI.get('empty_dictionary', "#err")







|







420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
            self.xOptionNode.setPropertyValue("personal_dic", "")
            self.xSettingNode.commitChanges()
            self.xNumDic.Label = "0"
            self.xDateDic.Label = self.dUI.get("void", "#err")

    def exportDictionary (self):
        try:
            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:
                sMessage = self.dUI.get('empty_dictionary', "#err")