eric6/Project/Project.py

changeset 8258
82b608e352ec
parent 8243
cc717c2ae956
child 8259
2bbec88047dd
equal deleted inserted replaced
8257:28146736bbfc 8258:82b608e352ec
1502 Public slot to delete a translation from the project directory. 1502 Public slot to delete a translation from the project directory.
1503 1503
1504 @param langFile the translation file to be removed (string) 1504 @param langFile the translation file to be removed (string)
1505 """ 1505 """
1506 try: 1506 try:
1507 from ThirdParty.Send2Trash.send2trash import send2trash as s2t 1507 from send2trash import send2trash as s2t
1508 except ImportError: 1508 except ImportError:
1509 s2t = os.remove 1509 s2t = os.remove
1510 1510
1511 langFile = self.getRelativePath(langFile) 1511 langFile = self.getRelativePath(langFile)
1512 qmFile = self.__binaryTranslationFile(langFile) 1512 qmFile = self.__binaryTranslationFile(langFile)
2227 2227
2228 @param fn filename to be deleted from the project 2228 @param fn filename to be deleted from the project
2229 @return flag indicating success (boolean) 2229 @return flag indicating success (boolean)
2230 """ 2230 """
2231 try: 2231 try:
2232 from ThirdParty.Send2Trash.send2trash import send2trash as s2t 2232 from send2trash import send2trash as s2t
2233 except ImportError: 2233 except ImportError:
2234 s2t = os.remove 2234 s2t = os.remove
2235 2235
2236 try: 2236 try:
2237 s2t(os.path.join(self.ppath, fn)) 2237 s2t(os.path.join(self.ppath, fn))
2274 """ 2274 """
2275 if not os.path.isabs(dn): 2275 if not os.path.isabs(dn):
2276 dn = os.path.join(self.ppath, dn) 2276 dn = os.path.join(self.ppath, dn)
2277 try: 2277 try:
2278 try: 2278 try:
2279 from ThirdParty.Send2Trash.send2trash import send2trash 2279 from send2trash import send2trash
2280 send2trash(dn) 2280 send2trash(dn)
2281 except ImportError: 2281 except ImportError:
2282 shutil.rmtree(dn, True) 2282 shutil.rmtree(dn, True)
2283 except OSError as err: 2283 except OSError as err:
2284 E5MessageBox.critical( 2284 E5MessageBox.critical(

eric ide

mercurial