MCPcopy Create free account
hub / github.com/SLiCAP/SLiCAP_python / _find_LTspice_wine

Function _find_LTspice_wine

SLiCAP/SLiCAPconfigure.py:184–210  ·  view source on GitHub ↗

Searches for LTspice under Linux or MacOS Returns ------- LTspice command

()

Source from the content-addressed store, hash-verified

182 return commands
183
184def _find_LTspice_wine():
185 """
186 Searches for LTspice under Linux or MacOS
187
188 Returns
189 -------
190 LTspice command
191 """
192 cmd = ''
193 try:
194 home = expanduser("~")
195 drives = [os.path.join(home, '.wine', 'drive_c')]
196 for drive in drives:
197 drive = os.path.join(drive, 'Program Files')
198 for root, dirs, files in os.walk(drive, topdown=True):
199 for name in dirs:
200 if re.match('LT(S|s)pice*', name, flags=0):
201 if os.path.exists(os.path.join(root,name,'XVIIx64.exe')):
202 cmd = os.path.join(root,name,'XVIIx64.exe')
203 elif os.path.exists(os.path.join(root,name,'LTspice.exe')):
204 cmd = os.path.join(root,name,'LTspice.exe')
205 elif os.path.exists(os.path.join(root,name,'ltspice.exe')):
206 cmd = os.path.join(root,name,'ltspice.exe')
207 return cmd
208 except:
209 pass
210 return cmd
211
212def _find_installed_software():
213 system = platform.system()

Callers 1

_find_installed_softwareFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected