404 self.dbgAutoClearShell = True |
404 self.dbgAutoClearShell = True |
405 self.dbgTracePython = False |
405 self.dbgTracePython = False |
406 self.dbgAutoContinue = True |
406 self.dbgAutoContinue = True |
407 |
407 |
408 self.pdata = { |
408 self.pdata = { |
409 # TODO: change these to use lists only where neccessary |
409 "DESCRIPTION": "", |
410 "DESCRIPTION": [], |
410 "VERSION": "", |
411 "VERSION": [], |
|
412 "SOURCES": [], |
411 "SOURCES": [], |
413 "FORMS": [], |
412 "FORMS": [], |
414 "RESOURCES": [], |
413 "RESOURCES": [], |
415 "INTERFACES": [], |
414 "INTERFACES": [], |
416 "OTHERS": [], |
415 "OTHERS": [], |
417 "TRANSLATIONS": [], |
416 "TRANSLATIONS": [], |
418 "TRANSLATIONPATTERN": [], |
|
419 "TRANSLATIONSBINPATH": [], |
|
420 "TRANSLATIONEXCEPTIONS": [], |
417 "TRANSLATIONEXCEPTIONS": [], |
421 "MAINSCRIPT": [], |
418 "TRANSLATIONPATTERN": "", |
422 "VCS": [], |
419 "TRANSLATIONSBINPATH": "", |
423 "VCSOPTIONS": [], |
420 "MAINSCRIPT": "", |
424 "VCSOTHERDATA": [], |
421 "VCS": "None", |
|
422 "VCSOPTIONS": {}, |
|
423 "VCSOTHERDATA": {}, |
|
424 # TODO: change these to use lists only where neccessary |
425 "AUTHOR": [''], |
425 "AUTHOR": [''], |
426 "EMAIL": [''], |
426 "EMAIL": [''], |
427 "HASH": [''], |
427 "HASH": [''], |
428 "PROGLANGUAGE": ["Python3"], |
428 "PROGLANGUAGE": ["Python3"], |
429 "MIXEDLANGUAGE": [False], |
429 "MIXEDLANGUAGE": [False], |
706 |
706 |
707 # insert filename into list of recently opened projects |
707 # insert filename into list of recently opened projects |
708 self.__syncRecent() |
708 self.__syncRecent() |
709 |
709 |
710 if res: |
710 if res: |
711 if len(self.pdata["TRANSLATIONPATTERN"]) == 1: |
711 if self.pdata["TRANSLATIONPATTERN"]: |
712 self.translationsRoot = \ |
712 self.translationsRoot = \ |
713 self.pdata["TRANSLATIONPATTERN"][0].split("%language%")[0] |
713 self.pdata["TRANSLATIONPATTERN"].split("%language%")[0] |
714 elif len(self.pdata["MAINSCRIPT"]) == 1: |
714 elif self.pdata["MAINSCRIPT"]: |
715 self.translationsRoot = os.path.splitext( |
715 self.translationsRoot = os.path.splitext( |
716 self.pdata["MAINSCRIPT"][0])[0] |
716 self.pdata["MAINSCRIPT"])[0] |
717 if os.path.isdir(os.path.join(self.ppath, self.translationsRoot)): |
717 if os.path.isdir(os.path.join(self.ppath, self.translationsRoot)): |
718 dn = self.translationsRoot |
718 dn = self.translationsRoot |
719 else: |
719 else: |
720 dn = os.path.dirname(self.translationsRoot) |
720 dn = os.path.dirname(self.translationsRoot) |
721 if dn not in self.subdirs: |
721 if dn not in self.subdirs: |
769 is used instead of the one in the project object. This is the |
769 is used instead of the one in the project object. This is the |
770 'save as' action. |
770 'save as' action. |
771 @return flag indicating success |
771 @return flag indicating success |
772 """ |
772 """ |
773 if self.vcs is not None: |
773 if self.vcs is not None: |
774 self.pdata["VCSOPTIONS"] = [ |
774 self.pdata["VCSOPTIONS"] = \ |
775 copy.deepcopy(self.vcs.vcsGetOptions())] |
775 copy.deepcopy(self.vcs.vcsGetOptions()) |
776 self.pdata["VCSOTHERDATA"] = [ |
776 self.pdata["VCSOTHERDATA"] = \ |
777 copy.deepcopy(self.vcs.vcsGetOtherData())] |
777 copy.deepcopy(self.vcs.vcsGetOtherData()) |
778 |
778 |
779 if not self.pdata["HASH"][0]: |
779 if not self.pdata["HASH"][0]: |
780 hash = str(QCryptographicHash.hash( |
780 hash = str(QCryptographicHash.hash( |
781 QByteArray(self.ppath.encode("utf-8")), |
781 QByteArray(self.ppath.encode("utf-8")), |
782 QCryptographicHash.Sha1).toHex(), |
782 QCryptographicHash.Sha1).toHex(), |
1237 """ |
1237 """ |
1238 Public method to get the translation pattern. |
1238 Public method to get the translation pattern. |
1239 |
1239 |
1240 @return translation pattern (string) |
1240 @return translation pattern (string) |
1241 """ |
1241 """ |
1242 if self.pdata["TRANSLATIONPATTERN"]: |
1242 return self.pdata["TRANSLATIONPATTERN"] |
1243 return self.pdata["TRANSLATIONPATTERN"][0] |
|
1244 else: |
|
1245 return "" |
|
1246 |
1243 |
1247 def setTranslationPattern(self, pattern): |
1244 def setTranslationPattern(self, pattern): |
1248 """ |
1245 """ |
1249 Public method to set the translation pattern. |
1246 Public method to set the translation pattern. |
1250 |
1247 |
1251 @param pattern translation pattern |
1248 @param pattern translation pattern |
1252 @type str |
1249 @type str |
1253 """ |
1250 """ |
1254 if pattern: |
1251 self.pdata["TRANSLATIONPATTERN"] = pattern |
1255 self.pdata["TRANSLATIONPATTERN"] = [pattern] |
|
1256 else: |
|
1257 self.pdata["TRANSLATIONPATTERN"] = [] |
|
1258 |
1252 |
1259 def addLanguage(self): |
1253 def addLanguage(self): |
1260 """ |
1254 """ |
1261 Public slot used to add a language to the project. |
1255 Public slot used to add a language to the project. |
1262 """ |
1256 """ |
1263 if len(self.pdata["TRANSLATIONPATTERN"]) == 0 or \ |
1257 if not self.pdata["TRANSLATIONPATTERN"]: |
1264 self.pdata["TRANSLATIONPATTERN"][0] == '': |
|
1265 E5MessageBox.critical( |
1258 E5MessageBox.critical( |
1266 self.ui, |
1259 self.ui, |
1267 self.tr("Add Language"), |
1260 self.tr("Add Language"), |
1268 self.tr( |
1261 self.tr( |
1269 "You have to specify a translation pattern first.")) |
1262 "You have to specify a translation pattern first.")) |
1274 if dlg.exec_() == QDialog.Accepted: |
1267 if dlg.exec_() == QDialog.Accepted: |
1275 lang = dlg.getSelectedLanguage() |
1268 lang = dlg.getSelectedLanguage() |
1276 if self.pdata["PROJECTTYPE"][0] in \ |
1269 if self.pdata["PROJECTTYPE"][0] in \ |
1277 ["Qt4", "Qt4C", "PyQt5", "PyQt5C", "E6Plugin", |
1270 ["Qt4", "Qt4C", "PyQt5", "PyQt5C", "E6Plugin", |
1278 "PySide", "PySideC"]: |
1271 "PySide", "PySideC"]: |
1279 langFile = self.pdata["TRANSLATIONPATTERN"][0]\ |
1272 langFile = self.pdata["TRANSLATIONPATTERN"]\ |
1280 .replace("%language%", lang) |
1273 .replace("%language%", lang) |
1281 self.appendFile(langFile) |
1274 self.appendFile(langFile) |
1282 self.projectLanguageAddedByCode.emit(lang) |
1275 self.projectLanguageAddedByCode.emit(lang) |
1283 |
1276 |
1284 def __binaryTranslationFile(self, langFile): |
1277 def __binaryTranslationFile(self, langFile): |
1765 @param oldfn old filename (string) |
1757 @param oldfn old filename (string) |
1766 @param newfn new filename of the main script (string) |
1758 @param newfn new filename of the main script (string) |
1767 """ |
1759 """ |
1768 if self.pdata["MAINSCRIPT"]: |
1760 if self.pdata["MAINSCRIPT"]: |
1769 ofn = self.getRelativePath(oldfn) |
1761 ofn = self.getRelativePath(oldfn) |
1770 if ofn != self.pdata["MAINSCRIPT"][0]: |
1762 if ofn != self.pdata["MAINSCRIPT"]: |
1771 return |
1763 return |
1772 |
1764 |
1773 fn = self.getRelativePath(newfn) |
1765 fn = self.getRelativePath(newfn) |
1774 self.pdata["MAINSCRIPT"] = [fn] |
1766 self.pdata["MAINSCRIPT"] = fn |
1775 self.setDirty(True) |
1767 self.setDirty(True) |
1776 |
1768 |
1777 def renameFile(self, oldfn, newfn=None): |
1769 def renameFile(self, oldfn, newfn=None): |
1778 """ |
1770 """ |
1779 Public slot to rename a file of the project. |
1771 Public slot to rename a file of the project. |
2140 self.menuApidocAct.setEnabled(True) |
2132 self.menuApidocAct.setEnabled(True) |
2141 self.menuPackagersAct.setEnabled(True) |
2133 self.menuPackagersAct.setEnabled(True) |
2142 self.pluginGrp.setEnabled( |
2134 self.pluginGrp.setEnabled( |
2143 self.pdata["PROJECTTYPE"][0] in ["E6Plugin"]) |
2135 self.pdata["PROJECTTYPE"][0] in ["E6Plugin"]) |
2144 self.addLanguageAct.setEnabled( |
2136 self.addLanguageAct.setEnabled( |
2145 len(self.pdata["TRANSLATIONPATTERN"]) > 0 and |
2137 bool(self.pdata["TRANSLATIONPATTERN"])) |
2146 self.pdata["TRANSLATIONPATTERN"][0] != '') |
|
2147 |
2138 |
2148 self.projectAboutToBeCreated.emit() |
2139 self.projectAboutToBeCreated.emit() |
2149 |
2140 |
2150 hash = str(QCryptographicHash.hash( |
2141 hash = str(QCryptographicHash.hash( |
2151 QByteArray(self.ppath.encode("utf-8")), |
2142 QByteArray(self.ppath.encode("utf-8")), |
2174 fn = os.path.join(self.ppath, "__init__.py") |
2165 fn = os.path.join(self.ppath, "__init__.py") |
2175 f = open(fn, "w", encoding="utf-8") |
2166 f = open(fn, "w", encoding="utf-8") |
2176 f.close() |
2167 f.close() |
2177 self.appendFile(fn, True) |
2168 self.appendFile(fn, True) |
2178 # create an empty main script file, if a name was given |
2169 # create an empty main script file, if a name was given |
2179 if len(self.pdata["MAINSCRIPT"]) and \ |
2170 if self.pdata["MAINSCRIPT"]: |
2180 self.pdata["MAINSCRIPT"][0]: |
2171 if not os.path.isabs(self.pdata["MAINSCRIPT"]): |
2181 if not os.path.isabs(self.pdata["MAINSCRIPT"][0]): |
|
2182 ms = os.path.join( |
2172 ms = os.path.join( |
2183 self.ppath, self.pdata["MAINSCRIPT"][0]) |
2173 self.ppath, self.pdata["MAINSCRIPT"]) |
2184 else: |
2174 else: |
2185 ms = self.pdata["MAINSCRIPT"][0] |
2175 ms = self.pdata["MAINSCRIPT"] |
2186 f = open(ms, "w") |
2176 f = open(ms, "w") |
2187 f.close() |
2177 f.close() |
2188 self.appendFile(ms, True) |
2178 self.appendFile(ms, True) |
2189 tpd = os.path.join(self.ppath, self.translationsRoot) |
2179 tpd = os.path.join(self.ppath, self.translationsRoot) |
2190 if not self.translationsRoot.endswith(os.sep): |
2180 if not self.translationsRoot.endswith(os.sep): |
2191 tpd = os.path.dirname(tpd) |
2181 tpd = os.path.dirname(tpd) |
2192 if not os.path.isdir(tpd): |
2182 if not os.path.isdir(tpd): |
2193 os.makedirs(tpd) |
2183 os.makedirs(tpd) |
2194 if self.pdata["TRANSLATIONSBINPATH"]: |
2184 if self.pdata["TRANSLATIONSBINPATH"]: |
2195 tpd = os.path.join( |
2185 tpd = os.path.join( |
2196 self.ppath, self.pdata["TRANSLATIONSBINPATH"][0]) |
2186 self.ppath, self.pdata["TRANSLATIONSBINPATH"]) |
2197 if not os.path.isdir(tpd): |
2187 if not os.path.isdir(tpd): |
2198 os.makedirs(tpd) |
2188 os.makedirs(tpd) |
2199 |
2189 |
2200 # create management directory if not present |
2190 # create management directory if not present |
2201 self.createProjectManagementDir() |
2191 self.createProjectManagementDir() |
2336 for vcsSystem, vcsSystemDisplay in vcsSystemsDict.items(): |
2326 for vcsSystem, vcsSystemDisplay in vcsSystemsDict.items(): |
2337 if vcsSystemDisplay == vcsSelected: |
2327 if vcsSystemDisplay == vcsSelected: |
2338 break |
2328 break |
2339 else: |
2329 else: |
2340 vcsSystem = "None" |
2330 vcsSystem = "None" |
2341 self.pdata["VCS"] = [vcsSystem] |
2331 self.pdata["VCS"] = vcsSystem |
2342 else: |
2332 else: |
2343 self.pdata["VCS"] = ['None'] |
2333 self.pdata["VCS"] = 'None' |
2344 self.vcs = self.initVCS() |
2334 self.vcs = self.initVCS() |
2345 if self.vcs is not None: |
2335 if self.vcs is not None: |
2346 vcsdlg = self.vcs.vcsOptionsDialog(self, self.name) |
2336 vcsdlg = self.vcs.vcsOptionsDialog(self, self.name) |
2347 if vcsdlg.exec_() == QDialog.Accepted: |
2337 if vcsdlg.exec_() == QDialog.Accepted: |
2348 vcsDataDict = vcsdlg.getData() |
2338 vcsDataDict = vcsdlg.getData() |
2349 else: |
2339 else: |
2350 self.pdata["VCS"] = ['None'] |
2340 self.pdata["VCS"] = 'None' |
2351 self.vcs = self.initVCS() |
2341 self.vcs = self.initVCS() |
2352 self.setDirty(True) |
2342 self.setDirty(True) |
2353 if self.vcs is not None: |
2343 if self.vcs is not None: |
2354 # edit VCS command options |
2344 # edit VCS command options |
2355 if self.vcs.vcsSupportCommandOptions(): |
2345 if self.vcs.vcsSupportCommandOptions(): |
2424 if '_' in os.path.basename(tslist[0]): |
2414 if '_' in os.path.basename(tslist[0]): |
2425 # the first entry determines the mainscript name |
2415 # the first entry determines the mainscript name |
2426 mainscriptname = os.path.splitext(mainscript)[0] or \ |
2416 mainscriptname = os.path.splitext(mainscript)[0] or \ |
2427 os.path.basename(tslist[0]).split('_')[0] |
2417 os.path.basename(tslist[0]).split('_')[0] |
2428 self.pdata["TRANSLATIONPATTERN"] = \ |
2418 self.pdata["TRANSLATIONPATTERN"] = \ |
2429 [os.path.join(os.path.dirname(tslist[0]), |
2419 os.path.join(os.path.dirname(tslist[0]), |
2430 "{0}_%language%{1}".format( |
2420 "{0}_%language%{1}".format( |
2431 os.path.basename(tslist[0]).split('_')[0], |
2421 os.path.basename(tslist[0]).split('_')[0], |
2432 os.path.splitext(tslist[0])[1]))] |
2422 os.path.splitext(tslist[0])[1])) |
2433 else: |
2423 else: |
2434 pattern, ok = QInputDialog.getText( |
2424 pattern, ok = QInputDialog.getText( |
2435 None, |
2425 None, |
2436 self.tr("Translation Pattern"), |
2426 self.tr("Translation Pattern"), |
2437 self.tr( |
2427 self.tr( |
2438 "Enter the path pattern for translation files " |
2428 "Enter the path pattern for translation files " |
2439 "(use '%language%' in place of the language code):"), # __IGNORE_WARNING__ |
2429 "(use '%language%' in place of the language code):"), # __IGNORE_WARNING__ |
2440 QLineEdit.Normal, |
2430 QLineEdit.Normal, |
2441 tslist[0]) |
2431 tslist[0]) |
2442 if pattern: |
2432 if pattern: |
2443 self.pdata["TRANSLATIONPATTERN"] = [pattern] |
2433 self.pdata["TRANSLATIONPATTERN"] = pattern |
2444 if self.pdata["TRANSLATIONPATTERN"]: |
2434 if self.pdata["TRANSLATIONPATTERN"]: |
2445 self.pdata["TRANSLATIONPATTERN"][0] = \ |
2435 self.pdata["TRANSLATIONPATTERN"] = \ |
2446 self.getRelativePath(self.pdata["TRANSLATIONPATTERN"][0]) |
2436 self.getRelativePath(self.pdata["TRANSLATIONPATTERN"]) |
2447 pattern = self.pdata["TRANSLATIONPATTERN"][0]\ |
2437 pattern = self.pdata["TRANSLATIONPATTERN"]\ |
2448 .replace("%language%", "*") |
2438 .replace("%language%", "*") |
2449 for ts in tslist: |
2439 for ts in tslist: |
2450 if fnmatch.fnmatch(ts, pattern): |
2440 if fnmatch.fnmatch(ts, pattern): |
2451 self.pdata["TRANSLATIONS"].append(ts) |
2441 self.pdata["TRANSLATIONS"].append(ts) |
2452 self.projectLanguageAdded.emit(ts) |
2442 self.projectLanguageAdded.emit(ts) |
2453 if self.pdata["TRANSLATIONSBINPATH"]: |
2443 if self.pdata["TRANSLATIONSBINPATH"]: |
2454 tpd = os.path.join(self.ppath, |
2444 tpd = os.path.join(self.ppath, |
2455 self.pdata["TRANSLATIONSBINPATH"][0]) |
2445 self.pdata["TRANSLATIONSBINPATH"]) |
2456 pattern = os.path.basename( |
2446 pattern = os.path.basename( |
2457 self.pdata["TRANSLATIONPATTERN"][0])\ |
2447 self.pdata["TRANSLATIONPATTERN"])\ |
2458 .replace("%language%", "*") |
2448 .replace("%language%", "*") |
2459 pattern = self.__binaryTranslationFile(pattern) |
2449 pattern = self.__binaryTranslationFile(pattern) |
2460 qmlist = Utilities.direntries(tpd, True, pattern) |
2450 qmlist = Utilities.direntries(tpd, True, pattern) |
2461 for qm in qmlist: |
2451 for qm in qmlist: |
2462 self.pdata["TRANSLATIONS"].append(qm) |
2452 self.pdata["TRANSLATIONS"].append(qm) |
2463 self.projectLanguageAdded.emit(qm) |
2453 self.projectLanguageAdded.emit(qm) |
2464 if len(self.pdata["MAINSCRIPT"]) == 0 or \ |
2454 if not self.pdata["MAINSCRIPT"]: |
2465 len(self.pdata["MAINSCRIPT"][0]) == 0: |
|
2466 if self.pdata["PROGLANGUAGE"][0] in \ |
2455 if self.pdata["PROGLANGUAGE"][0] in \ |
2467 ["Python", "Python2", "Python3"]: |
2456 ["Python", "Python2", "Python3"]: |
2468 self.pdata["MAINSCRIPT"] = [ |
2457 self.pdata["MAINSCRIPT"] = '{0}.py'.format(mainscriptname) |
2469 '{0}.py'.format(mainscriptname)] |
|
2470 elif self.pdata["PROGLANGUAGE"][0] == "Ruby": |
2458 elif self.pdata["PROGLANGUAGE"][0] == "Ruby": |
2471 self.pdata["MAINSCRIPT"] = [ |
2459 self.pdata["MAINSCRIPT"] = '{0}.rb'.format(mainscriptname) |
2472 '{0}.rb'.format(mainscriptname)] |
|
2473 self.setDirty(True) |
2460 self.setDirty(True) |
2474 QApplication.restoreOverrideCursor() |
2461 QApplication.restoreOverrideCursor() |
2475 |
2462 |
2476 def __showProperties(self): |
2463 def __showProperties(self): |
2477 """ |
2464 """ |
2524 |
2511 |
2525 def __showUserProperties(self): |
2512 def __showUserProperties(self): |
2526 """ |
2513 """ |
2527 Private slot to display the user specific properties dialog. |
2514 Private slot to display the user specific properties dialog. |
2528 """ |
2515 """ |
2529 vcsSystem = self.pdata["VCS"] and self.pdata["VCS"][0] or None |
2516 vcsSystem = self.pdata["VCS"] or None |
2530 vcsSystemOverride = self.pudata["VCSOVERRIDE"] or None |
2517 vcsSystemOverride = self.pudata["VCSOVERRIDE"] or None |
2531 |
2518 |
2532 from .UserPropertiesDialog import UserPropertiesDialog |
2519 from .UserPropertiesDialog import UserPropertiesDialog |
2533 dlg = UserPropertiesDialog(self) |
2520 dlg = UserPropertiesDialog(self) |
2534 if dlg.exec_() == QDialog.Accepted: |
2521 if dlg.exec_() == QDialog.Accepted: |
2535 dlg.storeData() |
2522 dlg.storeData() |
2536 |
2523 |
2537 if (self.pdata["VCS"] and |
2524 if (self.pdata["VCS"] and |
2538 self.pdata["VCS"][0] != vcsSystem) or \ |
2525 self.pdata["VCS"] != vcsSystem) or \ |
2539 (self.pudata["VCSOVERRIDE"] and |
2526 (self.pudata["VCSOVERRIDE"] and |
2540 self.pudata["VCSOVERRIDE"] != vcsSystemOverride) or \ |
2527 self.pudata["VCSOVERRIDE"] != vcsSystemOverride) or \ |
2541 (vcsSystemOverride is not None and |
2528 (vcsSystemOverride is not None and |
2542 not self.pudata["VCSOVERRIDE"]): |
2529 not self.pudata["VCSOVERRIDE"]): |
2543 # stop the VCS monitor thread and shutdown VCS |
2530 # stop the VCS monitor thread and shutdown VCS |
2704 vcsSystem = "None" |
2691 vcsSystem = "None" |
2705 else: |
2692 else: |
2706 vcsSystem = "None" |
2693 vcsSystem = "None" |
2707 else: |
2694 else: |
2708 vcsSystem = vcsData[0][0] |
2695 vcsSystem = vcsData[0][0] |
2709 self.pdata["VCS"] = [vcsSystem] |
2696 self.pdata["VCS"] = vcsSystem |
2710 self.vcs = self.initVCS() |
2697 self.vcs = self.initVCS() |
2711 self.setDirty(True) |
2698 self.setDirty(True) |
2712 if self.vcs is not None and \ |
2699 if self.vcs is not None and \ |
2713 (self.vcs.vcsRegisteredState(self.ppath) != |
2700 (self.vcs.vcsRegisteredState(self.ppath) != |
2714 self.vcs.canBeCommitted): |
2701 self.vcs.canBeCommitted): |
2715 self.pdata["VCS"] = ['None'] |
2702 self.pdata["VCS"] = 'None' |
2716 self.vcs = self.initVCS() |
2703 self.vcs = self.initVCS() |
2717 self.closeAct.setEnabled(True) |
2704 self.closeAct.setEnabled(True) |
2718 self.saveasAct.setEnabled(True) |
2705 self.saveasAct.setEnabled(True) |
2719 self.actGrp2.setEnabled(True) |
2706 self.actGrp2.setEnabled(True) |
2720 self.propsAct.setEnabled(True) |
2707 self.propsAct.setEnabled(True) |
4366 "<p>The selected VCS <b>{0}</b> could not be" |
4351 "<p>The selected VCS <b>{0}</b> could not be" |
4367 " found.<br/>Disabling version control.</p>" |
4352 " found.<br/>Disabling version control.</p>" |
4368 "<p>{1}</p>").format(vcsSystem, msg)) |
4353 "<p>{1}</p>").format(vcsSystem, msg)) |
4369 vcs = None |
4354 vcs = None |
4370 if forProject: |
4355 if forProject: |
4371 self.pdata["VCS"][0] = 'None' |
4356 self.pdata["VCS"] = 'None' |
4372 self.setDirty(True) |
4357 self.setDirty(True) |
4373 else: |
4358 else: |
4374 vcs.vcsInitConfig(self) |
4359 vcs.vcsInitConfig(self) |
4375 |
4360 |
4376 if vcs and forProject: |
4361 if vcs and forProject: |
4377 # set the vcs options |
4362 # set the vcs options |
4378 if vcs.vcsSupportCommandOptions(): |
4363 if vcs.vcsSupportCommandOptions(): |
4379 try: |
4364 try: |
4380 vcsopt = copy.deepcopy(self.pdata["VCSOPTIONS"][0]) |
4365 vcsopt = copy.deepcopy(self.pdata["VCSOPTIONS"]) |
4381 vcs.vcsSetOptions(vcsopt) |
4366 vcs.vcsSetOptions(vcsopt) |
4382 except LookupError: |
4367 except LookupError: |
4383 pass |
4368 pass |
4384 # set vcs specific data |
4369 # set vcs specific data |
4385 try: |
4370 try: |
4386 vcsother = copy.deepcopy(self.pdata["VCSOTHERDATA"][0]) |
4371 vcsother = copy.deepcopy(self.pdata["VCSOTHERDATA"]) |
4387 vcs.vcsSetOtherData(vcsother) |
4372 vcs.vcsSetOtherData(vcsother) |
4388 except LookupError: |
4373 except LookupError: |
4389 pass |
4374 pass |
4390 |
4375 |
4391 if vcs is None: |
4376 if vcs is None: |
4830 for name in names: |
4814 for name in names: |
4831 if name: |
4815 if name: |
4832 try: |
4816 try: |
4833 self.__createZipDirEntries( |
4817 self.__createZipDirEntries( |
4834 os.path.split(name)[0], archiveFile) |
4818 os.path.split(name)[0], archiveFile) |
4835 if snapshot and name == self.pdata["MAINSCRIPT"][0]: |
4819 if snapshot and name == self.pdata["MAINSCRIPT"]: |
4836 snapshotSource, version = self.__createSnapshotSource( |
4820 snapshotSource, version = self.__createSnapshotSource( |
4837 os.path.join(self.ppath, |
4821 os.path.join(self.ppath, |
4838 self.pdata["MAINSCRIPT"][0])) |
4822 self.pdata["MAINSCRIPT"])) |
4839 archiveFile.writestr(name, snapshotSource) |
4823 archiveFile.writestr(name, snapshotSource) |
4840 else: |
4824 else: |
4841 archiveFile.write(os.path.join(self.ppath, name), name) |
4825 archiveFile.write(os.path.join(self.ppath, name), name) |
4842 if name == self.pdata["MAINSCRIPT"][0]: |
4826 if name == self.pdata["MAINSCRIPT"]: |
4843 version = self.__pluginExtractVersion( |
4827 version = self.__pluginExtractVersion( |
4844 os.path.join(self.ppath, |
4828 os.path.join(self.ppath, |
4845 self.pdata["MAINSCRIPT"][0])) |
4829 self.pdata["MAINSCRIPT"])) |
4846 except OSError as why: |
4830 except OSError as why: |
4847 E5MessageBox.critical( |
4831 E5MessageBox.critical( |
4848 self.ui, |
4832 self.ui, |
4849 self.tr("Create Plugin Archive"), |
4833 self.tr("Create Plugin Archive"), |
4850 self.tr( |
4834 self.tr( |