src/eric7/Project/Project.py

branch
server
changeset 10597
fbe93720ee9f
parent 10596
ea35c92a3c7c
child 10598
79c6ea2cb2e7
equal deleted inserted replaced
10596:ea35c92a3c7c 10597:fbe93720ee9f
1346 ) 1346 )
1347 if not self.__remotefsInterface.exists(fn): 1347 if not self.__remotefsInterface.exists(fn):
1348 return 1348 return
1349 else: 1349 else:
1350 fn1, _ext = os.path.splitext(os.path.basename(self.pfile)) 1350 fn1, _ext = os.path.splitext(os.path.basename(self.pfile))
1351 fn = os.path.join( 1351 fn = os.path.join(self.getProjectManagementDir(), f"{fn1}{indicator}.esj")
1352 self.getProjectManagementDir(), f"{fn1}{indicator}.esj"
1353 )
1354 if not os.path.exists(fn): 1352 if not os.path.exists(fn):
1355 return 1353 return
1356 1354
1357 self.__sessionFile.readFile(fn) 1355 self.__sessionFile.readFile(fn)
1358 1356
1383 fn = self.__remotefsInterface.join( 1381 fn = self.__remotefsInterface.join(
1384 self.getProjectManagementDir(), f"{fn1}{indicator}.esj" 1382 self.getProjectManagementDir(), f"{fn1}{indicator}.esj"
1385 ) 1383 )
1386 else: 1384 else:
1387 fn1, _ext = os.path.splitext(os.path.basename(self.pfile)) 1385 fn1, _ext = os.path.splitext(os.path.basename(self.pfile))
1388 fn = os.path.join( 1386 fn = os.path.join(self.getProjectManagementDir(), f"{fn1}{indicator}.esj")
1389 self.getProjectManagementDir(), f"{fn1}{indicator}.esj"
1390 )
1391 1387
1392 self.__sessionFile.writeFile(fn) 1388 self.__sessionFile.writeFile(fn)
1393 1389
1394 def __deleteSession(self): 1390 def __deleteSession(self):
1395 """ 1391 """
1834 tbPath = self.__pdata["TRANSLATIONSBINPATH"] 1830 tbPath = self.__pdata["TRANSLATIONSBINPATH"]
1835 for langFile in self.__pdata["TRANSLATIONS"][:]: 1831 for langFile in self.__pdata["TRANSLATIONS"][:]:
1836 qmFile = self.__binaryTranslationFile(langFile) 1832 qmFile = self.__binaryTranslationFile(langFile)
1837 if qmFile: 1833 if qmFile:
1838 if FileSystemUtilities.isRemoteFileName(self.ppath): 1834 if FileSystemUtilities.isRemoteFileName(self.ppath):
1839 if ( 1835 if qmFile not in self.__pdata[
1840 qmFile not in self.__pdata["TRANSLATIONS"] 1836 "TRANSLATIONS"
1841 and self.__remotefsInterface.exists( 1837 ] and self.__remotefsInterface.exists(
1842 self.__remotefsInterface.join(self.ppath, qmFile) 1838 self.__remotefsInterface.join(self.ppath, qmFile)
1843 )
1844 ): 1839 ):
1845 self.appendFile(qmFile) 1840 self.appendFile(qmFile)
1846 if tbPath: 1841 if tbPath:
1847 qmFile = self.__remotefsInterface.join( 1842 qmFile = self.__remotefsInterface.join(
1848 tbPath, self.__remotefsInterface.basename(qmFile) 1843 tbPath, self.__remotefsInterface.basename(qmFile)
1849 ) 1844 )
1850 if ( 1845 if qmFile not in self.__pdata[
1851 qmFile not in self.__pdata["TRANSLATIONS"] 1846 "TRANSLATIONS"
1852 and self.__remotefsInterface.exists( 1847 ] and self.__remotefsInterface.exists(
1853 self.__remotefsInterface.join(self.ppath, qmFile) 1848 self.__remotefsInterface.join(self.ppath, qmFile)
1854 )
1855 ): 1849 ):
1856 self.appendFile(qmFile) 1850 self.appendFile(qmFile)
1857 else: 1851 else:
1858 if qmFile not in self.__pdata["TRANSLATIONS"] and os.path.exists( 1852 if qmFile not in self.__pdata["TRANSLATIONS"] and os.path.exists(
1859 os.path.join(self.ppath, qmFile) 1853 os.path.join(self.ppath, qmFile)
1860 ): 1854 ):
1861 self.appendFile(qmFile) 1855 self.appendFile(qmFile)
1862 if tbPath: 1856 if tbPath:
1863 qmFile = os.path.join(tbPath, os.path.basename(qmFile)) 1857 qmFile = os.path.join(tbPath, os.path.basename(qmFile))
1864 if ( 1858 if qmFile not in self.__pdata[
1865 qmFile not in self.__pdata["TRANSLATIONS"] 1859 "TRANSLATIONS"
1866 and os.path.exists(os.path.join(self.ppath, qmFile)) 1860 ] and os.path.exists(os.path.join(self.ppath, qmFile)):
1867 ):
1868 self.appendFile(qmFile) 1861 self.appendFile(qmFile)
1869 1862
1870 def removeLanguageFile(self, langFile): 1863 def removeLanguageFile(self, langFile):
1871 """ 1864 """
1872 Public slot to remove a translation from the project. 1865 Public slot to remove a translation from the project.
4340 @param group group to check 4333 @param group group to check
4341 @type str 4334 @type str
4342 @return flag indicating membership 4335 @return flag indicating membership
4343 @rtype bool 4336 @rtype bool
4344 """ 4337 """
4345 newfn = ( 4338 newfn = fn if FileSystemUtilities.isRemoteFileName(fn) else os.path.abspath(fn)
4346 fn
4347 if FileSystemUtilities.isRemoteFileName(fn)
4348 else os.path.abspath(fn)
4349 )
4350 newfn = self.getRelativePath(newfn) 4339 newfn = self.getRelativePath(newfn)
4351 if newfn in self.__pdata[group] or ( 4340 if newfn in self.__pdata[group] or (
4352 group == "OTHERS" 4341 group == "OTHERS"
4353 and any(newfn.startswith(entry) for entry in self.__pdata[group]) 4342 and any(newfn.startswith(entry) for entry in self.__pdata[group])
4354 ): 4343 ):
7445 self.tr("Project Files (*.epj)"), 7434 self.tr("Project Files (*.epj)"),
7446 ) 7435 )
7447 if fn: 7436 if fn:
7448 self.openProject(fn=fn) 7437 self.openProject(fn=fn)
7449 7438
7439
7450 # 7440 #
7451 # eflag: noqa = M601 7441 # eflag: noqa = M601

eric ide

mercurial