src/eric7/Project/Project.py

branch
eric7
changeset 10263
f4bb67586615
parent 10256
1b728f26d1ae
child 10272
7ae72d1df070
child 10277
e3d7e0cc0e6a
equal deleted inserted replaced
10262:928079fd741e 10263:f4bb67586615
1778 1778
1779 @param langFile the translation file to be removed (string) 1779 @param langFile the translation file to be removed (string)
1780 """ 1780 """
1781 langFile = self.getRelativePath(langFile) 1781 langFile = self.getRelativePath(langFile)
1782 qmFile = self.__binaryTranslationFile(langFile) 1782 qmFile = self.__binaryTranslationFile(langFile)
1783 self.__pdata["TRANSLATIONS"].remove(langFile) 1783 with contextlib.suppress(ValueError):
1784 self.__model.removeItem(langFile) 1784 self.__model.removeItem(langFile)
1785 self.__pdata["TRANSLATIONS"].remove(langFile)
1785 if qmFile: 1786 if qmFile:
1786 with contextlib.suppress(ValueError): 1787 with contextlib.suppress(ValueError):
1787 if self.__pdata["TRANSLATIONSBINPATH"]: 1788 if self.__pdata["TRANSLATIONSBINPATH"]:
1788 qmFile = self.getRelativePath( 1789 qmFile = self.getRelativePath(
1789 os.path.join( 1790 os.path.join(
1790 self.__pdata["TRANSLATIONSBINPATH"], 1791 self.__pdata["TRANSLATIONSBINPATH"],
1791 os.path.basename(qmFile), 1792 os.path.basename(qmFile),
1792 ) 1793 )
1793 ) 1794 )
1795 self.__model.removeItem(qmFile)
1794 self.__pdata["TRANSLATIONS"].remove(qmFile) 1796 self.__pdata["TRANSLATIONS"].remove(qmFile)
1795 self.__model.removeItem(qmFile)
1796 self.setDirty(True) 1797 self.setDirty(True)
1797 1798
1798 def deleteLanguageFile(self, langFile): 1799 def deleteLanguageFile(self, langFile):
1799 """ 1800 """
1800 Public slot to delete a translation from the project directory. 1801 Public slot to delete a translation from the project directory.

eric ide

mercurial