Skip to content

Commit a81ff5f

Browse files
author
stonebig
committed
more generic .bat launchers
1 parent b9db88f commit a81ff5f

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

winpython/wppm.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -483,21 +483,22 @@ def patch_standard_packages(self, package_name=''):
483483
"'check_updates_on_startup': False,")
484484

485485
# workaround bad installers
486-
if package_name.lower() == "theano" or package_name == '':
487-
self.create_pybat(['theano-cache', 'theano-nose', 'theano-test'])
488-
if package_name.lower() == "numba" or package_name == '':
486+
if package_name.lower() == "numba":
489487
self.create_pybat(['numba', 'pycc'])
490-
for checklist in("odo", "vitables", "cxfreeze"):
491-
if package_name.lower() == checklist or package_name == '':
492-
self.create_pybat(checklist)
488+
else:
489+
self.create_pybat(package_name.lower())
493490

494491

495-
def create_pybat(self, names, contents="""@echo off
496-
python "%~dpn0" %*"""):
492+
def create_pybat(self, names='', contents=r"""@echo off
493+
..\python "%~dpn0" %*"""):
497494
"""Create launcher batch script when missing"""
498495

499496
scriptpy = osp.join(self.target, 'Scripts') # std Scripts of python
500-
my_list = names if list(names) == names else [names]
497+
if not list(names) == names:
498+
my_list = [f for f in os.listdir(scriptpy) if '.' not in f
499+
and f.startswith(names)]
500+
else:
501+
my_list = names
501502
for name in my_list:
502503
if osp.isdir(scriptpy) and osp.isfile(osp.join(scriptpy, name)):
503504
if (not osp.isfile(osp.join(scriptpy, name + '.exe')) and

0 commit comments

Comments
 (0)