@@ -18,8 +18,6 @@ namespace Flow.Launcher.Core.Plugin
18
18
{
19
19
public static class PluginsLoader
20
20
{
21
- public const string PATH = "PATH" ;
22
- public const string Python = "python" ;
23
21
public const string PythonExecutable = "pythonw.exe" ;
24
22
25
23
public static List < PluginPair > Plugins ( List < PluginMetadata > metadatas , PluginsSettings settings )
@@ -117,62 +115,6 @@ public static IEnumerable<PluginPair> PythonPlugins(List<PluginMetadata> source,
117
115
if ( ! source . Any ( o => o . Language . ToUpper ( ) == AllowedLanguage . Python ) )
118
116
return new List < PluginPair > ( ) ;
119
117
120
- // Try setting Constant.PythonPath first, either from
121
- // PATH or from the given pythonDirectory
122
- if ( string . IsNullOrEmpty ( settings . PythonDirectory ) )
123
- {
124
- var whereProcess = Process . Start ( new ProcessStartInfo
125
- {
126
- FileName = "where.exe" ,
127
- Arguments = "pythonw" ,
128
- RedirectStandardOutput = true ,
129
- CreateNoWindow = true ,
130
- UseShellExecute = false
131
- } ) ;
132
-
133
- var pythonPath = whereProcess ? . StandardOutput . ReadToEnd ( ) . Trim ( ) ;
134
-
135
- if ( ! string . IsNullOrEmpty ( pythonPath ) )
136
- {
137
- pythonPath = FilesFolders . GetPreviousExistingDirectory ( FilesFolders . LocationExists , pythonPath ) ;
138
- }
139
-
140
- if ( string . IsNullOrEmpty ( pythonPath ) )
141
- {
142
- var paths = Environment . GetEnvironmentVariable ( PATH ) ;
143
-
144
- pythonPath = paths ?
145
- . Split ( ';' )
146
- . FirstOrDefault ( p => p . ToLower ( ) . Contains ( Python ) ) ;
147
- }
148
-
149
- if ( ! string . IsNullOrEmpty ( pythonPath ) )
150
- {
151
- Constant . PythonPath = Path . Combine ( pythonPath , PythonExecutable ) ;
152
- settings . PythonDirectory =
153
- FilesFolders . GetPreviousExistingDirectory ( FilesFolders . LocationExists , Constant . PythonPath ) ;
154
- }
155
- else
156
- {
157
- Log . Error ( "PluginsLoader" ,
158
- "Failed to set Python path despite the environment variable PATH is found" ,
159
- "PythonPlugins" ) ;
160
- }
161
- }
162
- else
163
- {
164
- var path = Path . Combine ( settings . PythonDirectory , PythonExecutable ) ;
165
- if ( File . Exists ( path ) )
166
- {
167
- Constant . PythonPath = path ;
168
- }
169
- else
170
- {
171
- Log . Error ( "PluginsLoader" , $ "Tried to automatically set from Settings.PythonDirectory " +
172
- $ "but can't find python executable in { path } ", "PythonPlugins" ) ;
173
- }
174
- }
175
-
176
118
if ( string . IsNullOrEmpty ( settings . PythonDirectory ) )
177
119
{
178
120
if ( MessageBox . Show ( "Flow detected you have installed Python plugins, " +
0 commit comments