eric6/Project/Project.py

changeset 8220
006ee31b4835
parent 8218
7c09585bd960
child 8221
0572a215bd2f
equal deleted inserted replaced
8219:013aee248a62 8220:006ee31b4835
4557 """ 4557 """
4558 self.__loadRecent() 4558 self.__loadRecent()
4559 4559
4560 self.recentMenu.clear() 4560 self.recentMenu.clear()
4561 4561
4562 idx = 1 4562 for idx, rp in enumerate(self.recent, start=1):
4563 for rp in self.recent:
4564 if idx < 10: 4563 if idx < 10:
4565 formatStr = '&{0:d}. {1}' 4564 formatStr = '&{0:d}. {1}'
4566 else: 4565 else:
4567 formatStr = '{0:d}. {1}' 4566 formatStr = '{0:d}. {1}'
4568 act = self.recentMenu.addAction( 4567 act = self.recentMenu.addAction(
4569 formatStr.format( 4568 formatStr.format(
4570 idx, 4569 idx,
4571 Utilities.compactPath(rp, self.ui.maxMenuFilePathLen))) 4570 Utilities.compactPath(rp, self.ui.maxMenuFilePathLen)))
4572 act.setData(rp) 4571 act.setData(rp)
4573 act.setEnabled(QFileInfo(rp).exists()) 4572 act.setEnabled(QFileInfo(rp).exists())
4574 idx += 1
4575 4573
4576 self.recentMenu.addSeparator() 4574 self.recentMenu.addSeparator()
4577 self.recentMenu.addAction(self.tr('&Clear'), self.clearRecent) 4575 self.recentMenu.addAction(self.tr('&Clear'), self.clearRecent)
4578 4576
4579 def __openRecent(self, act): 4577 def __openRecent(self, act):
5401 progress = E5ProgressDialog( 5399 progress = E5ProgressDialog(
5402 self.tr("Creating plugin archives..."), self.tr("Abort"), 5400 self.tr("Creating plugin archives..."), self.tr("Abort"),
5403 0, len(selectedLists), self.tr("%v/%m Archives")) 5401 0, len(selectedLists), self.tr("%v/%m Archives"))
5404 progress.setMinimumDuration(0) 5402 progress.setMinimumDuration(0)
5405 progress.setWindowTitle(self.tr("Create Plugin Archives")) 5403 progress.setWindowTitle(self.tr("Create Plugin Archives"))
5406 count = 0
5407 errors = 0 5404 errors = 0
5408 for pkglist in selectedLists: 5405 for count, pkglist in enumerate(selectedLists):
5409 progress.setValue(count) 5406 progress.setValue(count)
5410 if progress.wasCanceled(): 5407 if progress.wasCanceled():
5411 break 5408 break
5412 5409
5413 try: 5410 try:
5420 self.tr( 5417 self.tr(
5421 """<p>The file <b>{0}</b> could not be read.</p>""" 5418 """<p>The file <b>{0}</b> could not be read.</p>"""
5422 """<p>Reason: {1}</p>""").format( 5419 """<p>Reason: {1}</p>""").format(
5423 os.path.basename(pkglist), str(why))) 5420 os.path.basename(pkglist), str(why)))
5424 errors += 1 5421 errors += 1
5425 count += 1
5426 continue 5422 continue
5427 5423
5428 lines = names.splitlines() 5424 lines = names.splitlines()
5429 archiveName = "" 5425 archiveName = ""
5430 archiveVersion = "" 5426 archiveVersion = ""
5449 """<p>The file <b>{0}</b> is not ready yet.""" 5445 """<p>The file <b>{0}</b> is not ready yet."""
5450 """</p><p>Please rework it and delete the""" 5446 """</p><p>Please rework it and delete the"""
5451 """'; initial_list' line of the header.""" 5447 """'; initial_list' line of the header."""
5452 """</p>""").format(os.path.basename(pkglist))) 5448 """</p>""").format(os.path.basename(pkglist)))
5453 errors += 1 5449 errors += 1
5454 count += 1
5455 listOK = False 5450 listOK = False
5456 break 5451 break
5457 elif line.strip(): 5452 elif line.strip():
5458 names.append(line.strip()) 5453 names.append(line.strip())
5459 5454
5476 self.tr( 5471 self.tr(
5477 """<p>The eric plugin archive file <b>{0}</b>""" 5472 """<p>The eric plugin archive file <b>{0}</b>"""
5478 """ could not be created.</p>""" 5473 """ could not be created.</p>"""
5479 """<p>Reason: {1}</p>""").format(archive, str(why))) 5474 """<p>Reason: {1}</p>""").format(archive, str(why)))
5480 errors += 1 5475 errors += 1
5481 count += 1
5482 continue 5476 continue
5483 5477
5484 for name in names: 5478 for name in names:
5485 if name: 5479 if name:
5486 try: 5480 try:
5517 archiveFile.writestr("VERSION", version.encode("utf-8")) 5511 archiveFile.writestr("VERSION", version.encode("utf-8"))
5518 archiveFile.close() 5512 archiveFile.close()
5519 5513
5520 if archive not in self.pdata["OTHERS"]: 5514 if archive not in self.pdata["OTHERS"]:
5521 self.appendFile(archive) 5515 self.appendFile(archive)
5522
5523 count += 1
5524 5516
5525 progress.setValue(len(selectedLists)) 5517 progress.setValue(len(selectedLists))
5526 5518
5527 if errors: 5519 if errors:
5528 self.ui.showNotification( 5520 self.ui.showNotification(

eric ide

mercurial