8000 Merge pull request #1242 from stonebig/master · BigNuoLi/winpython@bbb87a3 · GitHub
[go: up one dir, main page]

Skip to content

Commit bbb87a3

Browse files
authored
Merge pull request winpython#1242 from stonebig/master
more utf-8 , more piptree navigation
2 parents 2e27532 + 055f845 commit bbb87a3

File tree

4 files changed

+18
-8
lines changed

4 files changed

+18
-8
lines changed

diff.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,12 @@ def from_file(self, basedir):
9595
/ f"WinPython{self.flavor}-{self.architecture}bit-{self.version}.md"
9696
)
9797

98-
with open(fname, "r") as fdesc: # python3 doesn't like 'rb'
99-
text = fdesc.read()
98+
try:
99+
with open(fname, "r", encoding = 'utf-8') as fdesc: # python3 doesn't like 'rb'
100+
text = fdesc.read()
101+
except:
102+
with open(fname, "r") as fdesc: # python3 doesn't like 'rb'
103+
text = fdesc.read()
100104
self.from_text(text)
101105

102106
def from_text(self, text):

make.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2022,7 +2022,7 @@ def make(
20222022
+ f"{self.winpyver2}.md"
20232023
)
20242024
)
2025-
open(fname, "w").write(self.package_index_wiki)
2025+
open(fname, "w", encoding='utf-8').write(self.package_index_wiki)
20262026
# Copy to winpython/changelogs
20272027
shutil.copyfile(
20282028
fname,

winpython/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,6 @@
2828
OTHER DEALINGS IN THE SOFTWARE.
2929
"""
3030

31-
__version__ = '6.3.20230611'
31+
__version__ = '6.4.20230625'
3232
__license__ = __doc__
3333
__project_url__ = 'http://winpython.github.io/'

winpython/piptree.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,13 @@ def normalize(this):
1414
class pipdata:
1515
"""Wrapper aroud pip inspect"""
1616

17-
def __init__(self):
17+
def __init__(self, Target=None):
1818

1919
# get pip_inpsect raw data in json form
20-
pip_inspect = utils.exec_run_cmd(["pip", "inspect"])
20+
if Target == None:
21+
pip_inspect = utils.exec_run_cmd(["pip", "inspect"])
22+
else:
23+
pip_inspect = utils.exec_run_cmd(["chcp", "65001" ,"&", Target , "-m", "pip", "inspect"])
2124
pip_json = json.loads(pip_inspect)
2225

2326
# create a distro{} dict of Packages
@@ -194,6 +197,9 @@ def description(self, pp):
194197
if pp in self.distro:
195198
return print("\n".join(self.distro[pp]["description"].split(r"\n")))
196199

197-
def pip_list(self):
200+
def pip_list(self, full=False):
198201
"""do like pip list"""
199-
return [(p, self.distro[p]["version"]) for p in sorted(self.distro)]
202+
if full:
203+
return [(p, self.distro[p]["version"], self.distro[p]["summary"]) for p in sorted(self.distro)]
204+
else:
205+
return [(p, self.distro[p]["version"]) for p in sorted(self.distro)]

0 commit comments

Comments
 (0)
0