addftool 0.2.15__py3-none-any.whl → 0.2.16__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.
@@ -1,7 +1,7 @@
1
1
  from addftool.util import need_sudo, execute_command, install_packages
2
2
 
3
3
 
4
- def deploy_vscode_server(install_tunnel=True):
4
+ def deploy_vscode_server(install_tunnel=True, install_method="wget"):
5
5
  """
6
6
  Deploy Visual Studio Code and optionally start VS Code Tunnel.
7
7
 
@@ -9,29 +9,40 @@ def deploy_vscode_server(install_tunnel=True):
9
9
  install_tunnel (bool): Whether to start VS Code Tunnel after installation
10
10
  """
11
11
  command_prefix = "sudo " if need_sudo() else ""
12
-
13
- # Install prerequisites
14
- print("Installing prerequisites...")
15
- execute_command(command_prefix + "apt-get install -y wget gpg")
16
-
17
- # Add Microsoft's GPG key
18
- print("Adding Microsoft's GPG key...")
19
- execute_command("wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg")
20
- execute_command(command_prefix + "install -D -o root -g root -m 644 packages.microsoft.gpg /etc/apt/keyrings/packages.microsoft.gpg")
21
-
22
- # Add VS Code repository
23
- print("Adding VS Code repository...")
24
- execute_command(command_prefix + "sh -c 'echo \"deb [arch=amd64,arm64,armhf signed-by=/etc/apt/keyrings/packages.microsoft.gpg] "
25
- "https://packages.microsoft.com/repos/code stable main\" > /etc/apt/sources.list.d/vscode.list'")
26
-
27
- # Clean up
28
- execute_command("rm -f packages.microsoft.gpg")
29
-
30
- # Install VS Code
31
- print("Installing VS Code...")
32
- execute_command(command_prefix + "apt install -y apt-transport-https")
33
- execute_command(command_prefix + "apt update")
34
- execute_command(command_prefix + "apt install -y code")
12
+ if install_method == "apt":
13
+ # Install prerequisites
14
+ print("Installing prerequisites...")
15
+ execute_command(command_prefix + "apt-get install -y wget gpg")
16
+
17
+ # Add Microsoft's GPG key
18
+ print("Adding Microsoft's GPG key...")
19
+ execute_command("wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg")
20
+ execute_command(command_prefix + "install -D -o root -g root -m 644 packages.microsoft.gpg /etc/apt/keyrings/packages.microsoft.gpg")
21
+
22
+ # Add VS Code repository
23
+ print("Adding VS Code repository...")
24
+ execute_command(command_prefix + "sh -c 'echo \"deb [arch=amd64,arm64,armhf signed-by=/etc/apt/keyrings/packages.microsoft.gpg] "
25
+ "https://packages.microsoft.com/repos/code stable main\" > /etc/apt/sources.list.d/vscode.list'")
26
+
27
+ # Clean up
28
+ execute_command("rm -f packages.microsoft.gpg")
29
+
30
+ # Install VS Code
31
+ print("Installing VS Code...")
32
+ execute_command(command_prefix + "apt install -y apt-transport-https")
33
+ execute_command(command_prefix + "apt update")
34
+ execute_command(command_prefix + "apt install -y code")
35
+ else:
36
+ # check if wget is installed
37
+ print("Checking if wget is installed...")
38
+ install_packages(["wget"])
39
+ # wget https://go.microsoft.com/fwlink/?LinkID=760868 -O /tmp/vscode-server.deb
40
+ # sudo DEBIAN_FRONTEND=noninteractive apt-get install -y --allow-downgrades /tmp/vscode-server.deb
41
+ print("Downloading VS Code .deb package...")
42
+ execute_command("wget https://go.microsoft.com/fwlink/?LinkID=760868 -O /tmp/vscode-server.deb")
43
+ print("Installing VS Code from .deb package...")
44
+ execute_command(command_prefix + "DEBIAN_FRONTEND=noninteractive apt-get install -y --allow-downgrades /tmp/vscode-server.deb")
45
+ execute_command("rm -f /tmp/vscode-server.deb")
35
46
 
36
47
  # Start VS Code Tunnel if requested
37
48
  if install_tunnel:
@@ -50,6 +61,8 @@ def add_deploy_vscode_server_args(parser):
50
61
  """
51
62
  parser.add_argument("--no-tunnel", dest="install_tunnel", action="store_false",
52
63
  help="Skip starting VS Code Tunnel after installation")
64
+ parser.add_argument("--install_method", type=str, default="wget", choices=["apt", "wget"],
65
+ help="Method to install VS Code (default: wget)")
53
66
  parser.set_defaults(install_tunnel=True)
54
67
 
55
68
 
@@ -60,7 +73,7 @@ def deploy_vscode_server_main(args):
60
73
  Args:
61
74
  args: Parsed command-line arguments
62
75
  """
63
- deploy_vscode_server(install_tunnel=args.install_tunnel)
76
+ deploy_vscode_server(install_tunnel=args.install_tunnel, install_method=args.install_method)
64
77
 
65
78
 
66
79
  if __name__ == "__main__":
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: addftool
3
- Version: 0.2.15
3
+ Version: 0.2.16
4
4
  Requires-Dist: cryptography
5
5
  Requires-Dist: requests
6
6
  Requires-Dist: PyYAML
@@ -9,12 +9,12 @@ addftool/util.py,sha256=zlNLu8Be8cGIpNRqBw8_0q7nFxWlsJ9cToN62ohjdXE,2335
9
9
  addftool/deploy/__init__.py,sha256=UL8b-Idt7lStlMiOm8oTZ65fdzYz99Fgzq2Gaw8WsZc,1544
10
10
  addftool/deploy/azure.py,sha256=_o_9Eh8cVwLDAqvfyRYBtQRHs_Gul-nCs2ZXttwO1bk,1301
11
11
  addftool/deploy/ssh_server.py,sha256=7glpJJNROskpqPkeYrTc2MbVzRendUZLv-ZgPs6HCq8,5641
12
- addftool/deploy/vscode_server.py,sha256=tLtSvlcK2fEOaw6udWt8dNELVhwv9F59hF5DJJ-1Nak,2666
12
+ addftool/deploy/vscode_server.py,sha256=VNH4i5PTa1FH2Yk1S95fNCJEzwe380GAj5vc-h7cdWk,3740
13
13
  addftool/process/__init__.py,sha256=Dze8OrcyjQlAbPrjE_h8bMi8W4b3OJyZOjTucPrkJvM,3721
14
14
  addftool/process/utils.py,sha256=JldxnwanLJOgxaPgmCJh7SeBRaaj5rFxWWxh1hpsvbA,2609
15
15
  addftool/ssh/__init__.py,sha256=h5_rCO0A6q2Yw9vFguQZZp_ApAJsT1dcnKnbKKZ0cDM,4409
16
- addftool-0.2.15.dist-info/METADATA,sha256=MNHj48rJ5avJsWZ7x6mN7m4vX-7C8d9EOpICgeIb9Gk,221
17
- addftool-0.2.15.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
18
- addftool-0.2.15.dist-info/entry_points.txt,sha256=9lkmuWMInwUAtev8w8poNkNd7iML9Bjd5CBCFVxg2b8,111
19
- addftool-0.2.15.dist-info/top_level.txt,sha256=jqj56-plrBbyzY0tIxB6wPzjAA8kte4hUlajyyQygN4,9
20
- addftool-0.2.15.dist-info/RECORD,,
16
+ addftool-0.2.16.dist-info/METADATA,sha256=7nrWr3OjjsF48YajTsvjLi_MXJbf1zUBXfifVu-RYP8,221
17
+ addftool-0.2.16.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
18
+ addftool-0.2.16.dist-info/entry_points.txt,sha256=9lkmuWMInwUAtev8w8poNkNd7iML9Bjd5CBCFVxg2b8,111
19
+ addftool-0.2.16.dist-info/top_level.txt,sha256=jqj56-plrBbyzY0tIxB6wPzjAA8kte4hUlajyyQygN4,9
20
+ addftool-0.2.16.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.9.0)
2
+ Generator: setuptools (80.10.2)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5