vscode-offline 0.1.7__py3-none-any.whl → 0.1.8__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- vscode_offline/_version.py +2 -2
- vscode_offline/app.py +5 -5
- vscode_offline/download.py +3 -2
- vscode_offline/utils.py +3 -5
- {vscode_offline-0.1.7.dist-info → vscode_offline-0.1.8.dist-info}/METADATA +2 -2
- vscode_offline-0.1.8.dist-info/RECORD +13 -0
- vscode_offline-0.1.7.dist-info/RECORD +0 -13
- {vscode_offline-0.1.7.dist-info → vscode_offline-0.1.8.dist-info}/WHEEL +0 -0
- {vscode_offline-0.1.7.dist-info → vscode_offline-0.1.8.dist-info}/entry_points.txt +0 -0
- {vscode_offline-0.1.7.dist-info → vscode_offline-0.1.8.dist-info}/licenses/LICENSE +0 -0
vscode_offline/_version.py
CHANGED
@@ -28,7 +28,7 @@ version_tuple: VERSION_TUPLE
|
|
28
28
|
commit_id: COMMIT_ID
|
29
29
|
__commit_id__: COMMIT_ID
|
30
30
|
|
31
|
-
__version__ = version = '0.1.
|
32
|
-
__version_tuple__ = version_tuple = (0, 1,
|
31
|
+
__version__ = version = '0.1.8'
|
32
|
+
__version_tuple__ = version_tuple = (0, 1, 8)
|
33
33
|
|
34
34
|
__commit_id__ = commit_id = None
|
vscode_offline/app.py
CHANGED
@@ -37,7 +37,7 @@ def cmd_download_server(args: Namespace) -> None:
|
|
37
37
|
|
38
38
|
download_vscode_server(
|
39
39
|
args.code_version,
|
40
|
-
output=args.installer /
|
40
|
+
output=args.installer / args.code_version.replace(":", "-"),
|
41
41
|
platform=get_server_platform(args.platform),
|
42
42
|
)
|
43
43
|
extensions_config = Path(args.extensions_config).expanduser()
|
@@ -63,7 +63,7 @@ def cmd_install_server(args: Namespace) -> None:
|
|
63
63
|
) from None
|
64
64
|
|
65
65
|
vscode_server_home = install_vscode_server(
|
66
|
-
server_installer=args.installer /
|
66
|
+
server_installer=args.installer / args.code_version.replace(":", "-"),
|
67
67
|
platform=get_server_platform(host_platform),
|
68
68
|
)
|
69
69
|
install_vscode_extensions(
|
@@ -104,7 +104,7 @@ def cmd_download_client(args: Namespace) -> None:
|
|
104
104
|
|
105
105
|
download_vscode_client(
|
106
106
|
args.code_version,
|
107
|
-
output=args.installer /
|
107
|
+
output=args.installer / args.code_version.replace(":", "-"),
|
108
108
|
platform=get_client_platform(args.platform),
|
109
109
|
)
|
110
110
|
extensions_config = Path(args.extensions_config).expanduser()
|
@@ -127,12 +127,12 @@ def cmd_download_all(args: Namespace) -> None:
|
|
127
127
|
|
128
128
|
download_vscode_server(
|
129
129
|
args.code_version,
|
130
|
-
output=args.installer /
|
130
|
+
output=args.installer / args.code_version.replace(":", "-"),
|
131
131
|
platform=get_server_platform(args.server_platform),
|
132
132
|
)
|
133
133
|
download_vscode_client(
|
134
134
|
args.code_version,
|
135
|
-
output=args.installer /
|
135
|
+
output=args.installer / args.code_version.replace(":", "-"),
|
136
136
|
platform=get_client_platform(args.client_platform),
|
137
137
|
)
|
138
138
|
extensions_config = Path(args.extensions_config).expanduser()
|
vscode_offline/download.py
CHANGED
@@ -4,7 +4,6 @@ import json
|
|
4
4
|
import os
|
5
5
|
from collections.abc import Set as AbstractSet
|
6
6
|
from gzip import GzipFile
|
7
|
-
from io import DEFAULT_BUFFER_SIZE
|
8
7
|
from pathlib import Path
|
9
8
|
from urllib.error import HTTPError
|
10
9
|
from urllib.request import urlopen
|
@@ -12,6 +11,8 @@ from urllib.request import urlopen
|
|
12
11
|
from vscode_offline.loggers import logger
|
13
12
|
from vscode_offline.utils import extract_filename_from_headers, get_cli_platform
|
14
13
|
|
14
|
+
_DOWNLOAD_CHUNK_SIZE = 4 * 1024 * 1024 # 4 MiB
|
15
|
+
|
15
16
|
|
16
17
|
def _download_file_once(
|
17
18
|
url: str,
|
@@ -45,7 +46,7 @@ def _download_file_once(
|
|
45
46
|
tmp_file_path = Path(directory).joinpath(f"{filename}.tmp")
|
46
47
|
with reader, tmp_file_path.open("wb") as fp:
|
47
48
|
while True:
|
48
|
-
chunk = reader.read(
|
49
|
+
chunk = reader.read(_DOWNLOAD_CHUNK_SIZE)
|
49
50
|
if not chunk:
|
50
51
|
break
|
51
52
|
fp.write(chunk)
|
vscode_offline/utils.py
CHANGED
@@ -38,9 +38,7 @@ def get_vscode_extensions_config() -> os.PathLike[str]:
|
|
38
38
|
def get_vscode_version_from_server_installer(
|
39
39
|
installer: os.PathLike[str], platform: str
|
40
40
|
) -> str:
|
41
|
-
directories = list(
|
42
|
-
Path(installer).glob(f"server-*/vscode-server-{platform}.tar.gz")
|
43
|
-
)
|
41
|
+
directories = list(Path(installer).glob(f"*/vscode-server-{platform}.tar.gz"))
|
44
42
|
if len(directories) > 1:
|
45
43
|
raise ValueError(
|
46
44
|
f"Multiple matching installers found in {installer} for platform {platform}"
|
@@ -50,9 +48,9 @@ def get_vscode_version_from_server_installer(
|
|
50
48
|
f"No matching installer found in {installer} for platform {platform}"
|
51
49
|
)
|
52
50
|
|
53
|
-
version = directories[0].parent.name
|
51
|
+
version = directories[0].parent.name
|
54
52
|
logger.info(f"Getting version from {platform} installer: {version}")
|
55
|
-
return version
|
53
|
+
return version.replace("commit-", "commit:")
|
56
54
|
|
57
55
|
|
58
56
|
def get_default_code_version() -> str | None:
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: vscode-offline
|
3
|
-
Version: 0.1.
|
3
|
+
Version: 0.1.8
|
4
4
|
Summary: Download and install VS Code for offline environments
|
5
5
|
Project-URL: Homepage, https://github.com/fanck0605/vscode-offline
|
6
6
|
Author-email: Chuck Fan <fanck0605@qq.com>
|
@@ -51,7 +51,7 @@ pip install -U vscode-offline
|
|
51
51
|
vscode-offline download-all --client-platform win32-x64 --server-platform linux-x64
|
52
52
|
```
|
53
53
|
|
54
|
-
(3)复制 `./vscode-offline-installer` 到内网 Windows 机器,安装
|
54
|
+
(3)复制 `./vscode-offline-installer` 到内网 Windows 机器,安装 `./vscode-offline-installer/<version>` 下的 VS Code,然后执行如下命令安装所有插件
|
55
55
|
|
56
56
|
```shell
|
57
57
|
vscode-offline install-extensions --installer ./vscode-offline-installer
|
@@ -0,0 +1,13 @@
|
|
1
|
+
vscode_offline/__init__.py,sha256=-TweZdViMkxGYKEAvUN-6g0oUKnKapeC8ytTsWgxjRk,210
|
2
|
+
vscode_offline/_version.py,sha256=Zaz3s9gl_rzsS46-ymJOALojMxviW77EJq_agE8knLk,704
|
3
|
+
vscode_offline/app.py,sha256=XMq400ghmtlaTfLbtTTI7TRk56ZOjFTd6VzIRGDQl60,9951
|
4
|
+
vscode_offline/download.py,sha256=l10xenEUoE4rp4Uy1lWHjy_cYGYWFLwPeJ81oLrV3PQ,6060
|
5
|
+
vscode_offline/install.py,sha256=plZxKrlwy5FgyEAtDWRt0ZfvPWTB2tMRf54_kzVK5h0,4320
|
6
|
+
vscode_offline/loggers.py,sha256=vX91NMtNo1xfxq5y4BCtm_uhCTKtCODqBJHNvcT7JdQ,104
|
7
|
+
vscode_offline/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
8
|
+
vscode_offline/utils.py,sha256=YhDydIllSMSJfICJLqmdiIcKfEihct63woVFBGj80Ew,8581
|
9
|
+
vscode_offline-0.1.8.dist-info/METADATA,sha256=KDQK_DgRiBov3RnjC1txFVIlCVHa4gedFH22qoyIVEQ,6050
|
10
|
+
vscode_offline-0.1.8.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
11
|
+
vscode_offline-0.1.8.dist-info/entry_points.txt,sha256=XyuZLe7bgm2RmZp9oh9qCxcrAwHypD8XrTnm4G0_CzM,55
|
12
|
+
vscode_offline-0.1.8.dist-info/licenses/LICENSE,sha256=pUIXFkLeTS986b7dopOVLyuw72fJsUxhl8H3rEMIycA,1053
|
13
|
+
vscode_offline-0.1.8.dist-info/RECORD,,
|
@@ -1,13 +0,0 @@
|
|
1
|
-
vscode_offline/__init__.py,sha256=-TweZdViMkxGYKEAvUN-6g0oUKnKapeC8ytTsWgxjRk,210
|
2
|
-
vscode_offline/_version.py,sha256=szvPIs2C82UunpzuvVg3MbF4QhzbBYTsVJ8DmPfq6_E,704
|
3
|
-
vscode_offline/app.py,sha256=yI8yXURX99etpXTvvMvTElIq60VDoZPfqKd99UMEpJ8,9993
|
4
|
-
vscode_offline/download.py,sha256=CSFeNP8Ql7bdDqJ4neXvuzq3719UmxipLB9DJUIaz30,6045
|
5
|
-
vscode_offline/install.py,sha256=plZxKrlwy5FgyEAtDWRt0ZfvPWTB2tMRf54_kzVK5h0,4320
|
6
|
-
vscode_offline/loggers.py,sha256=vX91NMtNo1xfxq5y4BCtm_uhCTKtCODqBJHNvcT7JdQ,104
|
7
|
-
vscode_offline/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
8
|
-
vscode_offline/utils.py,sha256=YxOy5y_HqFkTI6IRe2kPrIOLh9Dg2G0SV3XalbkK83Y,8590
|
9
|
-
vscode_offline-0.1.7.dist-info/METADATA,sha256=F9rqNxLwq3CQ4w33Qtp42Jg9WHqRRt6gHyW_N78l4dw,6030
|
10
|
-
vscode_offline-0.1.7.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
11
|
-
vscode_offline-0.1.7.dist-info/entry_points.txt,sha256=XyuZLe7bgm2RmZp9oh9qCxcrAwHypD8XrTnm4G0_CzM,55
|
12
|
-
vscode_offline-0.1.7.dist-info/licenses/LICENSE,sha256=pUIXFkLeTS986b7dopOVLyuw72fJsUxhl8H3rEMIycA,1053
|
13
|
-
vscode_offline-0.1.7.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|