Skip to content

remove osp from make.py #1159

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 23, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 26 additions & 16 deletions make.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from __future__ import print_function

import os
import os.path as osp
# import os.path as osp
from pathlib import Path
import re
import subprocess
Expand Down Expand Up @@ -385,51 +385,61 @@ def package_index_wiki(self):
"""Return Package Index page in Wiki format"""
installed_tools = []

def get_tool_path(relpath, checkfunc):
def get_tool_path_file(relpath):
if self.simulation:
for dirname in self.toolsdirs:
path = dirname + relpath.replace(
r'\t', ''
)
if checkfunc(path):
if Path(path).is_file():
return path
else:
path = self.winpydir + relpath
if checkfunc(path):
if Path(path).is_file():
return path

if get_tool_path(r'\t\SciTE.exe', osp.isfile):
def get_tool_path_dir(relpath):
if self.simulation:
for dirname in self.toolsdirs:
path = dirname + relpath.replace(
r'\t', ''
)
if Path(path).is_dir():
return path
else:
path = self.winpydir + relpath
if Path(path).is_dir():
return path

if get_tool_path_file(r'\t\SciTE.exe'):
installed_tools += [('SciTE', '3.3.7')]
rpath = get_tool_path(self.R_PATH, osp.isdir)

rpath = get_tool_path_dir(self.R_PATH)
if rpath is not None:
rver = utils.get_r_version(rpath)
installed_tools += [('R', rver)]
juliapath = get_tool_path(
self.JULIA_PATH, osp.isdir
)

juliapath = get_tool_path_dir(self.JULIA_PATH)
if juliapath is not None:
juliaver = utils.get_julia_version(juliapath)
installed_tools += [('Julia', juliaver)]
nodepath = get_tool_path(
self.NODEJS_PATH, osp.isdir
)

nodepath = get_tool_path_dir(self.NODEJS_PATH)
if nodepath is not None:
nodever = utils.get_nodejs_version(nodepath)
installed_tools += [('Nodejs', nodever)]
npmver = utils.get_npmjs_version(nodepath)
installed_tools += [('npmjs', npmver)]

pandocexe = get_tool_path(
r'\t\pandoc.exe', osp.isfile
)
pandocexe = get_tool_path_file(r'\t\pandoc.exe')
if pandocexe is not None:
pandocver = utils.get_pandoc_version(
#osp.dirname(pandocexe)
str(Path(pandocexe).parent)
)
installed_tools += [('Pandoc', pandocver)]

vscodeexe = get_tool_path(r'\t\VSCode\Code.exe', osp.isfile)
vscodeexe = get_tool_path_file(r'\t\VSCode\Code.exe')
if vscodeexe is not None:
installed_tools += [('VSCode',
utils.getFileProperties(vscodeexe)['FileVersion'])]
Expand Down