31 pyqtSlot, |
31 pyqtSlot, |
32 ) |
32 ) |
33 from PyQt6.QtGui import QAction, QKeySequence |
33 from PyQt6.QtGui import QAction, QKeySequence |
34 from PyQt6.QtWidgets import QDialog, QInputDialog, QLineEdit, QMenu, QToolBar |
34 from PyQt6.QtWidgets import QDialog, QInputDialog, QLineEdit, QMenu, QToolBar |
35 |
35 |
36 from eric7 import Preferences, Utilities |
36 from eric7 import Globals, Preferences, Utilities |
37 from eric7.CodeFormatting.BlackFormattingAction import BlackFormattingAction |
37 from eric7.CodeFormatting.BlackFormattingAction import BlackFormattingAction |
38 from eric7.CodeFormatting.BlackUtilities import aboutBlack |
38 from eric7.CodeFormatting.BlackUtilities import aboutBlack |
39 from eric7.CodeFormatting.IsortFormattingAction import IsortFormattingAction |
39 from eric7.CodeFormatting.IsortFormattingAction import IsortFormattingAction |
40 from eric7.CodeFormatting.IsortUtilities import aboutIsort |
40 from eric7.CodeFormatting.IsortUtilities import aboutIsort |
41 from eric7.EricGui import EricPixmapCache |
41 from eric7.EricGui import EricPixmapCache |
3174 vcsData, |
3174 vcsData, |
3175 ) in pluginManager.getVcsSystemIndicators().items(): |
3175 ) in pluginManager.getVcsSystemIndicators().items(): |
3176 if os.path.exists(os.path.join(self.ppath, indicator)): |
3176 if os.path.exists(os.path.join(self.ppath, indicator)): |
3177 if len(vcsData) > 1: |
3177 if len(vcsData) > 1: |
3178 vcsList = [] |
3178 vcsList = [] |
3179 for (_vcsSystemStr, vcsSystemDisplay) in vcsData: |
3179 for _vcsSystemStr, vcsSystemDisplay in vcsData: |
3180 vcsList.append(vcsSystemDisplay) |
3180 vcsList.append(vcsSystemDisplay) |
3181 with EricOverridenCursor(): |
3181 with EricOverridenCursor(): |
3182 res, vcs_ok = QInputDialog.getItem( |
3182 res, vcs_ok = QInputDialog.getItem( |
3183 None, |
3183 None, |
3184 self.tr("New Project"), |
3184 self.tr("New Project"), |
6106 |
6106 |
6107 ######################################################################### |
6107 ######################################################################### |
6108 ## Below are the plugin development related methods |
6108 ## Below are the plugin development related methods |
6109 ######################################################################### |
6109 ######################################################################### |
6110 |
6110 |
6111 def __pluginVersionToTuple(self, versionStr): |
|
6112 """ |
|
6113 Private method to convert a plug-in version string into a version |
|
6114 tuple. |
|
6115 |
|
6116 @param versionStr version string to be converted |
|
6117 @type str |
|
6118 @return version info as a tuple |
|
6119 @rtype tuple of int and str |
|
6120 """ |
|
6121 vParts = [] |
|
6122 if "-" in versionStr: |
|
6123 versionStr, additional = versionStr.split("-", 1) |
|
6124 else: |
|
6125 additional = "" |
|
6126 for part in versionStr.split("."): |
|
6127 try: |
|
6128 vParts.append(int(part)) |
|
6129 except ValueError: |
|
6130 vParts.append(part) |
|
6131 |
|
6132 if additional: |
|
6133 vParts.append(additional) |
|
6134 |
|
6135 return tuple(vParts) |
|
6136 |
|
6137 def __pluginCreatePkgList(self): |
6111 def __pluginCreatePkgList(self): |
6138 """ |
6112 """ |
6139 Private slot to create a PKGLIST file needed for archive file creation. |
6113 Private slot to create a PKGLIST file needed for archive file creation. |
6140 """ |
6114 """ |
6141 pkglist = os.path.join(self.ppath, "PKGLIST") |
6115 pkglist = os.path.join(self.ppath, "PKGLIST") |
6361 if name == self.__pdata["MAINSCRIPT"]: |
6335 if name == self.__pdata["MAINSCRIPT"]: |
6362 version = self.__pluginExtractVersion( |
6336 version = self.__pluginExtractVersion( |
6363 os.path.join(self.ppath, self.__pdata["MAINSCRIPT"]) |
6337 os.path.join(self.ppath, self.__pdata["MAINSCRIPT"]) |
6364 ) |
6338 ) |
6365 if archiveVersion and ( |
6339 if archiveVersion and ( |
6366 self.__pluginVersionToTuple(version) |
6340 Globals.versionToTuple(version) |
6367 < self.__pluginVersionToTuple(archiveVersion) |
6341 < Globals.versionToTuple(archiveVersion) |
6368 ): |
6342 ): |
6369 version = archiveVersion |
6343 version = archiveVersion |
6370 except OSError as why: |
6344 except OSError as why: |
6371 EricMessageBox.critical( |
6345 EricMessageBox.critical( |
6372 self.ui, |
6346 self.ui, |