src/eric7/Plugins/PluginVcsGit.py

branch
eric7
changeset 9624
b47dfa7a137d
parent 9620
9563c83ce83d
child 9653
e67609152c5e
equal deleted inserted replaced
9623:9c1f429cb56b 9624:b47dfa7a137d
10 import contextlib 10 import contextlib
11 import os 11 import os
12 12
13 from PyQt6.QtCore import QByteArray, QCoreApplication, QObject 13 from PyQt6.QtCore import QByteArray, QCoreApplication, QObject
14 14
15 from eric7 import Preferences, Utilities 15 from eric7 import Preferences
16 from eric7.EricWidgets.EricApplication import ericApp 16 from eric7.EricWidgets.EricApplication import ericApp
17 from eric7.Plugins.VcsPlugins.vcsGit.GitUtilities import getConfigPath 17 from eric7.Plugins.VcsPlugins.vcsGit.GitUtilities import getConfigPath
18 from eric7.Preferences.Shortcuts import readShortcuts 18 from eric7.Preferences.Shortcuts import readShortcuts
19 from eric7.SystemUtilities import FileSystemUtilities, OSUtilities
19 from eric7.UI import Info 20 from eric7.UI import Info
20 21
21 # Start-Of-Header 22 # Start-Of-Header
22 name = "Git Plugin" 23 name = "Git Plugin"
23 author = "Detlev Offenbach <detlev@die-offenbachs.de>" 24 author = "Detlev Offenbach <detlev@die-offenbachs.de>"
42 43
43 @return dictionary containing the data to query the presence of 44 @return dictionary containing the data to query the presence of
44 the executable 45 the executable
45 """ 46 """
46 exe = "git" 47 exe = "git"
47 if Utilities.isWindowsPlatform(): 48 if OSUtilities.isWindowsPlatform():
48 exe += ".exe" 49 exe += ".exe"
49 50
50 data = { 51 data = {
51 "programEntry": True, 52 "programEntry": True,
52 "header": QCoreApplication.translate("VcsGitPlugin", "Version Control - Git"), 53 "header": QCoreApplication.translate("VcsGitPlugin", "Version Control - Git"),
69 (string) and vcs display string (string) 70 (string) and vcs display string (string)
70 """ 71 """
71 global pluginTypename 72 global pluginTypename
72 data = {} 73 data = {}
73 exe = "git" 74 exe = "git"
74 if Utilities.isWindowsPlatform(): 75 if OSUtilities.isWindowsPlatform():
75 exe += ".exe" 76 exe += ".exe"
76 if Utilities.isinpath(exe): 77 if FileSystemUtilities.isinpath(exe):
77 data[".git"] = (pluginTypename, displayString()) 78 data[".git"] = (pluginTypename, displayString())
78 data["_git"] = (pluginTypename, displayString()) 79 data["_git"] = (pluginTypename, displayString())
79 return data 80 return data
80 81
81 82
84 Public function to get the display string. 85 Public function to get the display string.
85 86
86 @return display string (string) 87 @return display string (string)
87 """ 88 """
88 exe = "git" 89 exe = "git"
89 if Utilities.isWindowsPlatform(): 90 if OSUtilities.isWindowsPlatform():
90 exe += ".exe" 91 exe += ".exe"
91 if Utilities.isinpath(exe): 92 if FileSystemUtilities.isinpath(exe):
92 return QCoreApplication.translate("VcsGitPlugin", "Git") 93 return QCoreApplication.translate("VcsGitPlugin", "Git")
93 else: 94 else:
94 return "" 95 return ""
95 96
96 97

eric ide

mercurial