addftool 0.0.1__py3-none-any.whl → 0.0.3__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.
- addftool/blob.py +30 -1
- {addftool-0.0.1.dist-info → addftool-0.0.3.dist-info}/METADATA +1 -1
- addftool-0.0.3.dist-info/RECORD +9 -0
- {addftool-0.0.1.dist-info → addftool-0.0.3.dist-info}/WHEEL +1 -1
- addftool-0.0.1.dist-info/RECORD +0 -9
- {addftool-0.0.1.dist-info → addftool-0.0.3.dist-info}/LICENSE +0 -0
- {addftool-0.0.1.dist-info → addftool-0.0.3.dist-info}/entry_points.txt +0 -0
- {addftool-0.0.1.dist-info → addftool-0.0.3.dist-info}/top_level.txt +0 -0
addftool/blob.py
CHANGED
|
@@ -45,7 +45,29 @@ def create_dir_for_current_user(dir_path, sudo=False):
|
|
|
45
45
|
execute_command(command)
|
|
46
46
|
|
|
47
47
|
|
|
48
|
+
def check_package_installed(package):
|
|
49
|
+
command = f"dpkg -l | grep {package}"
|
|
50
|
+
result = execute_command(command)
|
|
51
|
+
if result is not None and package in result:
|
|
52
|
+
return True
|
|
53
|
+
return False
|
|
54
|
+
|
|
55
|
+
|
|
48
56
|
def install_main(args):
|
|
57
|
+
|
|
58
|
+
to_install = []
|
|
59
|
+
for package in args.packages.split():
|
|
60
|
+
if check_package_installed(package):
|
|
61
|
+
print(f"{package} is already installed")
|
|
62
|
+
continue
|
|
63
|
+
to_install.append(package)
|
|
64
|
+
|
|
65
|
+
if len(to_install) == 0:
|
|
66
|
+
print("All packages are already installed")
|
|
67
|
+
return
|
|
68
|
+
else:
|
|
69
|
+
args.packages = " ".join(to_install)
|
|
70
|
+
|
|
49
71
|
# generate install script
|
|
50
72
|
if args.output_script is not None:
|
|
51
73
|
script_writer = open(args.output_script, "w")
|
|
@@ -73,7 +95,9 @@ def install_main(args):
|
|
|
73
95
|
command = "sudo " + command
|
|
74
96
|
execute_command(command, script_writer)
|
|
75
97
|
|
|
76
|
-
|
|
98
|
+
print("Install packages: ", args.packages)
|
|
99
|
+
|
|
100
|
+
command = f"apt-get install {args.packages} -y"
|
|
77
101
|
if args.sudo:
|
|
78
102
|
command = "sudo " + command
|
|
79
103
|
execute_command(command, script_writer)
|
|
@@ -166,6 +190,7 @@ def main():
|
|
|
166
190
|
subparsers = parser.add_subparsers(dest='command', help='Sub-command help')
|
|
167
191
|
install_parser = subparsers.add_parser('install', help='Install help')
|
|
168
192
|
install_parser.add_argument("-o", "--output_script", help="output script", default=None)
|
|
193
|
+
install_parser.add_argument("--packages", help="packages", default="fuse3 blobfuse2 azcopy")
|
|
169
194
|
install_parser.add_argument("--sudo", help="sudo", action="store_true")
|
|
170
195
|
|
|
171
196
|
mount_parser = subparsers.add_parser('mount', help='Mount help')
|
|
@@ -180,6 +205,10 @@ def main():
|
|
|
180
205
|
|
|
181
206
|
args = parser.parse_args()
|
|
182
207
|
|
|
208
|
+
# check current user, set --sudo if current user is not root
|
|
209
|
+
if os.getuid() != 0:
|
|
210
|
+
args.sudo = True
|
|
211
|
+
|
|
183
212
|
if args.command == 'install':
|
|
184
213
|
install_main(args)
|
|
185
214
|
elif args.command == 'mount':
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
addftool/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
+
addftool/blob.py,sha256=iD4CJgMhk4ooFZ1rb7NLHxXT6aG--_QrjqFlecGWSeE,7017
|
|
3
|
+
addftool/util.py,sha256=gx-pqNJk31tmWtRJvZrIkI15ER7QZg9FtaM_OyP0JqU,975
|
|
4
|
+
addftool-0.0.3.dist-info/LICENSE,sha256=7EI8xVBu6h_7_JlVw-yPhhOZlpY9hP8wal7kHtqKT_E,1074
|
|
5
|
+
addftool-0.0.3.dist-info/METADATA,sha256=ov_H_kPjm_Rw2Ihdb_MNsrtHSxEiXWpu5R29NrIeLWo,149
|
|
6
|
+
addftool-0.0.3.dist-info/WHEEL,sha256=P9jw-gEje8ByB7_hXoICnHtVCrEwMQh-630tKvQWehc,91
|
|
7
|
+
addftool-0.0.3.dist-info/entry_points.txt,sha256=H3Z3iWsLB1CFdckedIA652_3tWaNS5Rl7fFWgFaFRIc,48
|
|
8
|
+
addftool-0.0.3.dist-info/top_level.txt,sha256=jqj56-plrBbyzY0tIxB6wPzjAA8kte4hUlajyyQygN4,9
|
|
9
|
+
addftool-0.0.3.dist-info/RECORD,,
|
addftool-0.0.1.dist-info/RECORD
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
addftool/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
-
addftool/blob.py,sha256=d36wu7acIyfF6mcm2iQqVDZ-kg1cvDr3rSFCyPQpdpA,6175
|
|
3
|
-
addftool/util.py,sha256=gx-pqNJk31tmWtRJvZrIkI15ER7QZg9FtaM_OyP0JqU,975
|
|
4
|
-
addftool-0.0.1.dist-info/LICENSE,sha256=7EI8xVBu6h_7_JlVw-yPhhOZlpY9hP8wal7kHtqKT_E,1074
|
|
5
|
-
addftool-0.0.1.dist-info/METADATA,sha256=RoIRgv0J85qVBp0-OXQC1lRsnBDZE4ecgnyXUJsJ93A,149
|
|
6
|
-
addftool-0.0.1.dist-info/WHEEL,sha256=cVxcB9AmuTcXqmwrtPhNK88dr7IR_b6qagTj0UvIEbY,91
|
|
7
|
-
addftool-0.0.1.dist-info/entry_points.txt,sha256=H3Z3iWsLB1CFdckedIA652_3tWaNS5Rl7fFWgFaFRIc,48
|
|
8
|
-
addftool-0.0.1.dist-info/top_level.txt,sha256=jqj56-plrBbyzY0tIxB6wPzjAA8kte4hUlajyyQygN4,9
|
|
9
|
-
addftool-0.0.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|