@@ -102,9 +102,6 @@ def _get_python_zip_file(self) -> Path:
102102 @property
103103 def package_index_markdown (self ) -> str :
104104 """Generates a Markdown formatted package index page."""
105- installed_tools_markdown = self ._get_installed_tools_markdown ()
106- installed_packages_markdown = self ._get_installed_packages_markdown ()
107-
108105 return f"""## WinPython { self .winpyver2 + self .flavor }
109106
110107The following packages are included in WinPython-{ self .architecture_bits } bit v{ self .winpyver2 + self .flavor } { self .release_level } .
@@ -115,49 +112,17 @@ def package_index_markdown(self) -> str:
115112
116113Name | Version | Description
117114-----|---------|------------
118- { installed_tools_markdown }
115+ { utils . get_installed_tools_markdown ( utils . get_python_executable ( self . python_executable_directory )) }
119116
120117### Python packages
121118
122119Name | Version | Description
123120-----|---------|------------
124- [Python](http://www.python.org/) | { self .python_full_version } | Python programming language with standard library
125- { installed_packages_markdown }
121+ { self .distribution .get_installed_packages_markdown ()}
126122
127123</details>
128124"""
129125
130- def _get_installed_tools_markdown (self ) -> str :
131- """Generates Markdown for installed tools section in package index."""
132- tool_lines = []
133-
134- if (nodejs_path := self .winpython_directory / NODEJS_RELATIVE_PATH ).exists ():
135- version = utils .exec_shell_cmd ("node -v" , nodejs_path ).splitlines ()[0 ]
136- tool_lines .append (f"[Nodejs](https://nodejs.org) | { version } | xa JavaScript runtime built on Chrome's V8 JavaScript engine" )
137- version = utils .exec_shell_cmd ("npm -v" , nodejs_path ).splitlines ()[0 ]
138- tool_lines .append (f"[npmjs](https://www.npmjs.com) | { version } | a package manager for JavaScript" )
139-
140- if (pandoc_exe := self .winpython_directory / "t" / "pandoc.exe" ).exists ():
141- version = utils .exec_shell_cmd ("pandoc -v" , pandoc_exe .parent ).splitlines ()[0 ].split (" " )[- 1 ]
142- tool_lines .append (f"[Pandoc](https://pandoc.org) | { version } | an universal document converter" )
143-
144- if vscode_exe := (self .winpython_directory / "t" / "VSCode" / "Code.exe" ).exists ():
145- version = utils .getFileProperties (str (vscode_exe ))["FileVersion" ]
146- tool_lines .append (f"[VSCode](https://code.visualstudio.com) | { version } | a source-code editor developed by Microsoft" )
147-
148- return "\n " .join (tool_lines )
149-
150- def _get_installed_packages_markdown (self ) -> str :
151- """Generates Markdown for installed packages section in package index."""
152- if not self .distribution :
153- return "" # Distribution not initialized yet.
154- self .installed_packages = self .distribution .get_installed_packages (update = True )
155- package_lines = [
156- f"[{ pkg .name } ]({ pkg .url } ) | { pkg .version } | { pkg .description } "
157- for pkg in sorted (self .installed_packages , key = lambda p : p .name .lower ())
158- ]
159- return "\n " .join (package_lines )
160-
161126 @property
162127 def winpython_version_name (self ) -> str :
163128 """Returns the full WinPython version string."""
0 commit comments