Skip to content
Merged
Show file tree
Hide file tree
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
18 changes: 16 additions & 2 deletions make.py
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,7 @@ def get_tool_path(relpath, checkfunc):
installed_tools += [('Nodejs', nodever)]
npmver = utils.get_npmjs_version(nodepath)
installed_tools += [('npmjs', npmver)]

pandocexe = get_tool_path(
r'\t\pandoc.exe', osp.isfile
)
Expand All @@ -393,6 +394,12 @@ def get_tool_path(relpath, checkfunc):
osp.dirname(pandocexe)
)
installed_tools += [('Pandoc', pandocver)]

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

tools = []
for name, ver in installed_tools:
metadata = wppm.get_package_metadata(
Expand Down Expand Up @@ -1006,7 +1013,8 @@ def _create_batch_scripts_initial(self):
+ self.winpyver
+ r"""
set HOME=%WINPYDIRBASE%\settings
set USERPROFILE=%HOME%
rem read https://github.com/winpython/winpython/issues/839
rem set USERPROFILE=%HOME%
rem set WINPYDIRBASE=
set JUPYTER_DATA_DIR=%HOME%
set WINPYARCH=WIN32
Expand Down Expand Up @@ -1093,6 +1101,7 @@ def _create_batch_scripts_initial(self):
rem WinPython.ini part (removed from nsis)
rem ******************
if not exist "%WINPYDIRBASE%\settings" mkdir "%WINPYDIRBASE%\settings"
if not exist "%WINPYDIRBASE%\settings\Roaming" mkdir "%WINPYDIRBASE%\settings\Roaming"
set winpython_ini=%WINPYDIRBASE%\settings\winpython.ini
if not exist "%winpython_ini%" (
echo [debug]
Expand Down Expand Up @@ -1144,7 +1153,10 @@ def _create_batch_scripts_initial(self):
+ self.winpyver
+ r"""'
$env:HOME = "$env:WINPYDIRBASE\settings"
$env:USERPROFILE = "$env:HOME"

# rem read https://github.com/winpython/winpython/issues/839
# $env:USERPROFILE = "$env:HOME"

$env:WINPYDIRBASE = ""
$env:JUPYTER_DATA_DIR = "$env:HOME"
$env:WINPYARCH = 'WIN32'
Expand Down Expand Up @@ -1232,6 +1244,7 @@ def _create_batch_scripts_initial(self):
### WinPython.ini part (removed from nsis)
#####################
if (-not (Test-Path "$env:WINPYDIR\..\settings")) { md -Path "$env:WINPYDIR\..\settings" }
if (-not (Test-Path "$env:WINPYDIR\..\settings\Roaming")) { md -Path "$env:WINPYDIR\..\settings\Roaming" }
$env:winpython_ini = "$env:WINPYDIR\..\settings\winpython.ini"
if (-not (Test-Path $env:winpython_ini)) {
"[debug]" | Add-Content -Path $env:winpython_ini
Expand Down Expand Up @@ -1894,6 +1907,7 @@ def make(
# scripts before using an executable launcher, because the latter
# is creating the directory automatically)
os.mkdir(osp.join(self.winpydir, 'settings'))
os.mkdir(osp.join(self.winpydir, 'settings', 'Roaming'))
self._print_done()

if remove_existing and not self.simulation:
Expand Down
2 changes: 1 addition & 1 deletion winpython/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@
OTHER DEALINGS IN THE SOFTWARE.
"""

__version__ = '2.4.20200417'
__version__ = '2.4.20200425'
__license__ = __doc__
__project_url__ = 'http://winpython.github.io/'
45 changes: 45 additions & 0 deletions winpython/data/packages.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2554,3 +2554,48 @@ description = Distribution utilities
[flask-sqlalchemy]
description = Adds SQLAlchemy support to your Flask application.

[pipdeptree]
description = Command line utility to show dependency tree of packages

[flask-smorest]
description = Flask/Marshmallow-based REST API framework

[webargs]
description = Declarative parsing and validation of HTTP request objects, with built-in support for popular web frameworks, including Flask, Django, Bottle, Tornado, Pyramid, webapp2, Falcon, and aiohttp.

[pytest-trio]
description = Pytest plugin for trio

[poetry]
description = Python dependency management and packaging made easy.

[tomlkit]
description = Style preserving TOML library

[cachy]
description = Cachy provides a simple yet effective caching library.

[cachecontrol]
description = httplib2 caching for requests

[cleo]
description = Cleo allows you to create beautiful and testable command-line interfaces.

[shellingham]
description = Tool to Detect Surrounding Shell

[clikit]
description = CliKit is a group of utilities to build beautiful and testable command line interfaces.

[lockfile]
description = Platform-independent file locking module

[pylev]
description = A pure Python Levenshtein implementation that's not freaking GPL'd.

[pastel]
description = Bring colors to your terminal.

[mergedeep]
description = A deep merge function for 🐍.

41 changes: 41 additions & 0 deletions winpython/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,47 @@ def set_env(name, value, current=True):
)


#==============================================================================
# https://stackoverflow.com/questions/580924/how-to-access-a-files-properties-on-windows
def getFileProperties(fname):
#==============================================================================
"""
Read all properties of the given file return them as a dictionary.
"""
import win32api
propNames = ('Comments', 'InternalName', 'ProductName',
'CompanyName', 'LegalCopyright', 'ProductVersion',
'FileDescription', 'LegalTrademarks', 'PrivateBuild',
'FileVersion', 'OriginalFilename', 'SpecialBuild')

props = {'FixedFileInfo': None, 'StringFileInfo': None, 'FileVersion': None}

try:
# backslash as parm returns dictionary of numeric info corresponding to VS_FIXEDFILEINFO struc
fixedInfo = win32api.GetFileVersionInfo(fname, '\\')
props['FixedFileInfo'] = fixedInfo
props['FileVersion'] = "%d.%d.%d.%d" % (fixedInfo['FileVersionMS'] / 65536,
fixedInfo['FileVersionMS'] % 65536, fixedInfo['FileVersionLS'] / 65536,
fixedInfo['FileVersionLS'] % 65536)

# \VarFileInfo\Translation returns list of available (language, codepage)
# pairs that can be used to retreive string info. We are using only the first pair.
lang, codepage = win32api.GetFileVersionInfo(fname, '\\VarFileInfo\\Translation')[0]

# any other must be of the form \StringfileInfo\%04X%04X\parm_name, middle
# two are language/codepage pair returned from above

strInfo = {}
for propName in propNames:
strInfoPath = u'\\StringFileInfo\\%04X%04X\\%s' % (lang, codepage, propName)
## print str_info
strInfo[propName] = win32api.GetFileVersionInfo(fname, strInfoPath)

props['StringFileInfo'] = strInfo
except:
pass

return props
# =============================================================================
# Shortcuts, start menu
# =============================================================================
Expand Down