Grammalecte  Check-in [507372a50d]

Overview
Comment:[lo][bug] lexicon editor: USERPROFILE unknown on Linux
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk | lo
Files: files | file ages | folders
SHA3-256: 507372a50d3753de562fb474c90d0c56cd35c2d8e2dc1c3c7e34cb2879e63351
User & Date: olr on 2018-04-14 17:31:14
Other Links: manifest | tags
Context
2018-04-14
19:38
[lo] lexicon editor: update + translations check-in: b9c72f6c5f user: olr tags: lo, trunk
17:31
[lo][bug] lexicon editor: USERPROFILE unknown on Linux check-in: 507372a50d user: olr tags: lo, trunk
17:28
[fr] pt: très bien/mal + correction d’un message check-in: fb7078506b user: olr tags: fr, trunk
Changes

Modified gc_lang/fr/oxt/DictOptions/LexiconEditor.py from [bbf80e041f] to [1cf16e149d].

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