hexss 0.26.0__tar.gz → 0.26.2__tar.gz
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.
- {hexss-0.26.0 → hexss-0.26.2}/HexSS.egg-info/PKG-INFO +3 -2
- {hexss-0.26.0 → hexss-0.26.2}/PKG-INFO +3 -2
- {hexss-0.26.0 → hexss-0.26.2}/hexss/__init__.py +2 -2
- {hexss-0.26.0 → hexss-0.26.2}/hexss/__main__.py +77 -60
- {hexss-0.26.0 → hexss-0.26.2}/hexss/image/im.py +1 -1
- hexss-0.26.2/hexss/python/__init__.py +1 -0
- {hexss-0.26.0 → hexss-0.26.2}/hexss/python/packages.py +9 -14
- hexss-0.26.0/hexss/python/__init__.py +0 -1
- {hexss-0.26.0 → hexss-0.26.2}/HexSS.egg-info/SOURCES.txt +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/HexSS.egg-info/dependency_links.txt +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/HexSS.egg-info/entry_points.txt +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/HexSS.egg-info/top_level.txt +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/LICENSE +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/MANIFEST.in +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/README.md +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/hexss/box/__init__.py +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/hexss/box/box.py +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/hexss/box/box_only.py +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/hexss/config.py +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/hexss/constants/__init__.py +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/hexss/constants/terminal_color.py +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/hexss/control_robot/__init__.py +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/hexss/control_robot/app.py +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/hexss/control_robot/pretty_dataframe.py +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/hexss/control_robot/robot.py +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/hexss/control_robot/server.py +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/hexss/control_robot/static/css/dashboard.css +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/hexss/control_robot/static/css/global.css +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/hexss/control_robot/static/css/light.css +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/hexss/control_robot/static/css/primer-primitives.css +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/hexss/control_robot/static/css/primer.css +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/hexss/control_robot/static/handsontable.full.min.css +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/hexss/control_robot/static/handsontable.full.min.js +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/hexss/control_robot/static/header.css +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/hexss/control_robot/static/jquery-3.6.0.min.js +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/hexss/control_robot/static/styles.css +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/hexss/control_robot/templates/head_import.html +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/hexss/control_robot/templates/header.html +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/hexss/control_robot/templates/index.html +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/hexss/control_robot/templates/register.html +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/hexss/control_robot/templates/table_editor.html +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/hexss/detector/__init__.py +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/hexss/detector/object_detector.py +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/hexss/download/__init__.py +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/hexss/download/download.py +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/hexss/draw_app/__init__.py +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/hexss/draw_app/app.py +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/hexss/draw_app/convert_data.py +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/hexss/draw_app/media_sequence.py +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/hexss/draw_app/server.py +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/hexss/draw_app/static/canvas.js +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/hexss/draw_app/static/media_control.js +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/hexss/draw_app/static/script.js +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/hexss/draw_app/templates/index.html +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/hexss/env.py +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/hexss/example/__init__.py +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/hexss/example/camera_server.py +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/hexss/example/detector.py +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/hexss/example/image.py +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/hexss/example/templates/index.html +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/hexss/example/threading1.py +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/hexss/example/threading2.py +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/hexss/example/threading_app.py +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/hexss/frame_publisher/__init__.py +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/hexss/frame_publisher/publisher.py +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/hexss/frame_publisher/server.py +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/hexss/git/__init__.py +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/hexss/git/test.py +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/hexss/github/__init__.py +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/hexss/github/download.py +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/hexss/image/__init__.py +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/hexss/image/capture.py +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/hexss/image/classifier.py +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/hexss/image/detector.py +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/hexss/image/func.py +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/hexss/image/im_box.py +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/hexss/image/pygame.py +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/hexss/image2/__init__.py +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/hexss/image2/capture.py +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/hexss/image2/classifier.py +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/hexss/image2/detector.py +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/hexss/image2/im.py +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/hexss/json/__init__.py +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/hexss/kill.py +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/hexss/latex.py +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/hexss/modbus/__init__.py +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/hexss/modbus/serial/__init__.py +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/hexss/modbus/serial/app.py +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/hexss/modbus/serial/robot.py +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/hexss/modbus/serial/run.py +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/hexss/modbus/serial/templates/header.html +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/hexss/modbus/serial/templates/index.html +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/hexss/modbus/serial/templates/register.html +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/hexss/multiprocessing/__init__.py +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/hexss/multiprocessing/func.py +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/hexss/multiprocessing/multicore.py +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/hexss/network.py +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/hexss/num/__init__.py +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/hexss/numpy/__init__.py +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/hexss/pandas/__init__.py +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/hexss/pandas/dataframe_transformation.py +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/hexss/path.py +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/hexss/pyconfig/__init__.py +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/hexss/pyconfig/_config.py +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/hexss/raspberrypi/__init__.py +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/hexss/raspberrypi/gpio.py +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/hexss/serial/__init__.py +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/hexss/server/__init__.py +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/hexss/server/camera_server.py +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/hexss/server/file_manager_server.py +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/hexss/server/processes.py +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/hexss/server/static/jquery-3.6.0.min.js +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/hexss/server/static/script.js +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/hexss/server/static/styles.css +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/hexss/server/templates/camera.html +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/hexss/server/templates/file_manager.html +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/hexss/server/templates/file_manager2.html +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/hexss/server/templates/process.html +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/hexss/string/__init__.py +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/hexss/threading/__init__.py +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/hexss/threading/mutithread.py +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/hexss/windows/__init__.py +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/hexss/windows/admin.py +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/hexss/windows/hotspot.py +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/hexss/windows/wifi.py +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/setup.cfg +0 -0
- {hexss-0.26.0 → hexss-0.26.2}/setup.py +0 -0
|
@@ -4,7 +4,7 @@ from .json import json_load, json_dump, json_update
|
|
|
4
4
|
from .network import open_url, get_ipv4, is_port_available, close_port
|
|
5
5
|
from .kill import kill
|
|
6
6
|
from .string import secure_filename, random_str
|
|
7
|
-
from .python import check_packages, install,
|
|
7
|
+
from .python import check_packages, install, upgrade
|
|
8
8
|
from .path import get_hexss_dir
|
|
9
9
|
from . import env
|
|
10
10
|
from .pyconfig import Config
|
|
@@ -33,7 +33,7 @@ def get_config(file_name):
|
|
|
33
33
|
return config
|
|
34
34
|
|
|
35
35
|
|
|
36
|
-
__version__ = '0.26.
|
|
36
|
+
__version__ = '0.26.2'
|
|
37
37
|
hostname = get_hostname()
|
|
38
38
|
username = get_username()
|
|
39
39
|
hexss_dir = get_hexss_dir()
|
|
@@ -136,12 +136,78 @@ def run_config(args):
|
|
|
136
136
|
update_config(file_name, keys, new_val)
|
|
137
137
|
|
|
138
138
|
|
|
139
|
+
def run_install(args):
|
|
140
|
+
"""Handler for 'install' command: install one or more packages."""
|
|
141
|
+
mod = importlib.import_module('hexss.python')
|
|
142
|
+
names = args.name or ['hexss']
|
|
143
|
+
mod.install(*names)
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
def run_upgrade(args):
|
|
147
|
+
"""Handler for 'upgrade' command: upgrade one or more packages."""
|
|
148
|
+
mod = importlib.import_module('hexss.python')
|
|
149
|
+
names = args.name or ['hexss']
|
|
150
|
+
mod.upgrade(*names)
|
|
151
|
+
|
|
152
|
+
|
|
139
153
|
def print_env():
|
|
140
154
|
"""Print all environment variables."""
|
|
141
155
|
for k, v in os.environ.items():
|
|
142
156
|
print(f'{k:25}: {v}')
|
|
143
157
|
|
|
144
158
|
|
|
159
|
+
def get_details():
|
|
160
|
+
print('--general--')
|
|
161
|
+
print('hostname :', hexss.hostname)
|
|
162
|
+
print('username :', hexss.username)
|
|
163
|
+
print('system :', hexss.system)
|
|
164
|
+
print('proxies :', hexss.proxies)
|
|
165
|
+
print()
|
|
166
|
+
print('--path--')
|
|
167
|
+
print('hexss dir :', hexss_dir)
|
|
168
|
+
print('venv :', hexss.path.get_venv_dir())
|
|
169
|
+
print('python exec :', hexss.path.get_python_path())
|
|
170
|
+
print('main python exec :', hexss.path.get_main_python_path())
|
|
171
|
+
print('working dir :', hexss.path.get_current_working_dir())
|
|
172
|
+
print('script dir :', hexss.path.get_script_dir())
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
def show_menu():
|
|
176
|
+
options = [
|
|
177
|
+
'camera_server',
|
|
178
|
+
'file_manager_server',
|
|
179
|
+
|
|
180
|
+
'upgrade',
|
|
181
|
+
'config',
|
|
182
|
+
'set_proxy_env',
|
|
183
|
+
'unset_proxy_env',
|
|
184
|
+
|
|
185
|
+
'details'
|
|
186
|
+
]
|
|
187
|
+
print("Choose an option:")
|
|
188
|
+
for i, option in enumerate(options, 1):
|
|
189
|
+
print(f"({i:{int(len(options) / 10) + 1}}) {option}")
|
|
190
|
+
|
|
191
|
+
try:
|
|
192
|
+
choice = input(">> ").strip()
|
|
193
|
+
choice = int(choice)
|
|
194
|
+
if choice == 0:
|
|
195
|
+
print("Exiting.")
|
|
196
|
+
return
|
|
197
|
+
|
|
198
|
+
elif choice <= len(options):
|
|
199
|
+
action = options[choice - 1]
|
|
200
|
+
main_args = [action]
|
|
201
|
+
|
|
202
|
+
import sys
|
|
203
|
+
sys.argv = [sys.argv[0]] + main_args
|
|
204
|
+
main()
|
|
205
|
+
else:
|
|
206
|
+
print("Invalid choice. Exiting.")
|
|
207
|
+
except:
|
|
208
|
+
pass
|
|
209
|
+
|
|
210
|
+
|
|
145
211
|
def main():
|
|
146
212
|
parser = argparse.ArgumentParser(
|
|
147
213
|
prog='hexss',
|
|
@@ -155,7 +221,7 @@ def main():
|
|
|
155
221
|
parser.add_argument(
|
|
156
222
|
'-u', '-U', '--upgrade',
|
|
157
223
|
action='store_true',
|
|
158
|
-
help='upgrade hexss'
|
|
224
|
+
help='upgrade hexss (same as: hexss upgrade)'
|
|
159
225
|
)
|
|
160
226
|
|
|
161
227
|
subparsers = parser.add_subparsers(
|
|
@@ -189,12 +255,14 @@ def main():
|
|
|
189
255
|
fm.set_defaults(func=lambda args: importlib.import_module('hexss.server.file_manager_server').run())
|
|
190
256
|
|
|
191
257
|
# install
|
|
192
|
-
inst = subparsers.add_parser('install', help='install
|
|
193
|
-
inst.
|
|
258
|
+
inst = subparsers.add_parser('install', help='install one or more packages')
|
|
259
|
+
inst.add_argument('name', nargs='*', help='package name(s) to install, e.g. numpy')
|
|
260
|
+
inst.set_defaults(func=run_install)
|
|
194
261
|
|
|
195
262
|
# upgrade
|
|
196
|
-
upg = subparsers.add_parser('upgrade', help='upgrade
|
|
197
|
-
upg.
|
|
263
|
+
upg = subparsers.add_parser('upgrade', help='upgrade one or more packages')
|
|
264
|
+
upg.add_argument('name', nargs='*', help='package name(s) to upgrade, e.g. numpy')
|
|
265
|
+
upg.set_defaults(func=run_upgrade)
|
|
198
266
|
|
|
199
267
|
# environ
|
|
200
268
|
env = subparsers.add_parser('environ', aliases=['env'], help='show environment variables')
|
|
@@ -203,7 +271,7 @@ def main():
|
|
|
203
271
|
# set_proxy_env
|
|
204
272
|
sp_env = subparsers.add_parser('set_proxy_env', help='print commands to set proxy env vars')
|
|
205
273
|
sp_env.set_defaults(func=lambda args: importlib.import_module('hexss.env').set_proxy(persistent=True))
|
|
206
|
-
unsp_env = subparsers.add_parser('unset_proxy_env', help='print commands to
|
|
274
|
+
unsp_env = subparsers.add_parser('unset_proxy_env', help='print commands to unset proxy env vars')
|
|
207
275
|
unsp_env.set_defaults(func=lambda args: importlib.import_module('hexss.env').unset_proxy(persistent=True))
|
|
208
276
|
|
|
209
277
|
# hostname
|
|
@@ -229,8 +297,9 @@ def main():
|
|
|
229
297
|
# Parse arguments
|
|
230
298
|
args = parser.parse_args()
|
|
231
299
|
|
|
232
|
-
|
|
233
|
-
|
|
300
|
+
# global -u / --upgrade flag (upgrade hexss)
|
|
301
|
+
if args.upgrade and (args.action is None):
|
|
302
|
+
importlib.import_module('hexss.python').upgrade('hexss')
|
|
234
303
|
return
|
|
235
304
|
|
|
236
305
|
# If no arguments are provided, display a menu
|
|
@@ -240,57 +309,5 @@ def main():
|
|
|
240
309
|
args.func(args)
|
|
241
310
|
|
|
242
311
|
|
|
243
|
-
def get_details():
|
|
244
|
-
print('--general--')
|
|
245
|
-
print('hostname :', hexss.hostname)
|
|
246
|
-
print('username :', hexss.username)
|
|
247
|
-
print('system :', hexss.system)
|
|
248
|
-
print('proxies :', hexss.proxies)
|
|
249
|
-
print()
|
|
250
|
-
print('--path--')
|
|
251
|
-
print('hexss dir :', hexss_dir)
|
|
252
|
-
print('venv :', hexss.path.get_venv_dir())
|
|
253
|
-
print('python exec :', hexss.path.get_python_path())
|
|
254
|
-
print('main python exec :', hexss.path.get_main_python_path())
|
|
255
|
-
print('working dir :', hexss.path.get_current_working_dir())
|
|
256
|
-
print('script dir :', hexss.path.get_script_dir())
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
def show_menu():
|
|
260
|
-
options = [
|
|
261
|
-
'camera_server',
|
|
262
|
-
'file_manager_server',
|
|
263
|
-
|
|
264
|
-
'upgrade',
|
|
265
|
-
'config',
|
|
266
|
-
'set_proxy_env',
|
|
267
|
-
'unset_proxy_env',
|
|
268
|
-
|
|
269
|
-
'details'
|
|
270
|
-
]
|
|
271
|
-
print("Choose an option:")
|
|
272
|
-
for i, option in enumerate(options, 1):
|
|
273
|
-
print(f"({i:{int(len(options) / 10) + 1}}) {option}")
|
|
274
|
-
|
|
275
|
-
try:
|
|
276
|
-
choice = input(">> ").strip()
|
|
277
|
-
choice = int(choice)
|
|
278
|
-
if choice == 0:
|
|
279
|
-
print("Exiting.")
|
|
280
|
-
return
|
|
281
|
-
|
|
282
|
-
elif choice <= len(options):
|
|
283
|
-
action = options[choice - 1]
|
|
284
|
-
main_args = [action]
|
|
285
|
-
|
|
286
|
-
import sys
|
|
287
|
-
sys.argv = [sys.argv[0]] + main_args
|
|
288
|
-
main()
|
|
289
|
-
else:
|
|
290
|
-
print("Invalid choice. Exiting.")
|
|
291
|
-
except:
|
|
292
|
-
pass
|
|
293
|
-
|
|
294
|
-
|
|
295
312
|
if __name__ == '__main__':
|
|
296
313
|
main()
|
|
@@ -16,8 +16,8 @@ from PIL import Image as PILImage
|
|
|
16
16
|
from PIL import ImageDraw as PILImageDraw
|
|
17
17
|
from PIL import ImageFilter, ImageGrab, ImageWin, ImageFont, ImageEnhance
|
|
18
18
|
from PIL.Image import Transpose, Transform, Resampling, Dither, Palette, Quantize, SupportsArrayInterface
|
|
19
|
-
from PIL.ImageDraw import _Ink
|
|
20
19
|
|
|
20
|
+
_Ink = Union[float, Tuple[int, ...], str]
|
|
21
21
|
Array2 = np.ndarray
|
|
22
22
|
Coord4 = Union[Tuple[float, float, float, float], Sequence[float]]
|
|
23
23
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
from .packages import check_packages, install, upgrade
|
|
@@ -132,29 +132,24 @@ def install(*packages: str, verbose: bool = True) -> None:
|
|
|
132
132
|
"""
|
|
133
133
|
missing = missing_packages(*packages)
|
|
134
134
|
if not missing:
|
|
135
|
-
if verbose:
|
|
135
|
+
if verbose:
|
|
136
|
+
print(f"{GREEN.BOLD}{', '.join(packages)}{END} "
|
|
137
|
+
f"{GREEN}{'is' if len(packages) == 1 else 'are'} already installed.{END}")
|
|
136
138
|
return
|
|
137
139
|
if verbose: print(f"{YELLOW}Installing: {BOLD}{', '.join(missing)}{END}")
|
|
138
140
|
command = generate_install_command(missing)
|
|
139
|
-
if run_command(command, verbose=verbose)
|
|
140
|
-
if verbose: print(f"{GREEN.BOLD}{', '.join(packages)}{END} {GREEN}installation complete.{END}")
|
|
141
|
-
else:
|
|
141
|
+
if run_command(command, verbose=verbose) != 0:
|
|
142
142
|
print(f"{RED}Failed to install {BOLD}{', '.join(packages)}{END}. {RED}Check errors.{END}")
|
|
143
143
|
|
|
144
144
|
|
|
145
|
-
def
|
|
145
|
+
def upgrade(*packages: str, verbose: bool = True) -> None:
|
|
146
146
|
"""
|
|
147
|
-
|
|
147
|
+
upgrades the specified packages.
|
|
148
148
|
"""
|
|
149
|
-
|
|
150
|
-
# pip_command = generate_install_command(["pip"], upgrade=True)
|
|
151
|
-
# run_command(pip_command, verbose=verbose)
|
|
152
|
-
if verbose: print(f"{YELLOW}Installing or upgrading: {BOLD}{' '.join(packages)}{END}")
|
|
149
|
+
if verbose: print(f"{YELLOW}Upgrading: {BOLD}{', '.join(packages)}{END}")
|
|
153
150
|
command = generate_install_command(packages, upgrade=True)
|
|
154
|
-
if run_command(command, verbose=verbose)
|
|
155
|
-
|
|
156
|
-
else:
|
|
157
|
-
print(f"{RED}Failed to install/upgrade {BOLD}{', '.join(packages)}{END}. {RED}Check errors.{END}")
|
|
151
|
+
if run_command(command, verbose=verbose) != 0:
|
|
152
|
+
print(f"{RED}Failed to upgrade {BOLD}{', '.join(packages)}{END}. {RED}Check errors.{END}")
|
|
158
153
|
|
|
159
154
|
|
|
160
155
|
def check_packages(*packages: str, auto_install: bool = False, venv_only: bool = True, verbose: bool = True) -> None:
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
from .packages import check_packages, install, install_upgrade
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|