bluer-objects 6.231.1__py3-none-any.whl → 6.235.1__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.

Potentially problematic release.


This version of bluer-objects might be problematic. Click here for more details.

@@ -3,13 +3,15 @@
3
3
  function bluer_objects_download() {
4
4
  local options=$1
5
5
  local filename=$(bluer_ai_option "$options" filename)
6
+ local policy=$(bluer_ai_option "$options" policy none)
6
7
 
7
8
  local object_name=$(bluer_ai_clarify_object $2 .)
8
9
 
9
10
  python3 -m bluer_objects.storage \
10
11
  download \
11
12
  --object_name $object_name \
12
- --filename "$filename"
13
+ --filename "$filename" \
14
+ --policy $policy
13
15
  [[ $? -ne 0 ]] && return 1
14
16
 
15
17
  local open_options=$3
@@ -63,6 +63,12 @@ function test_bluer_objects_storage_upload_download() {
63
63
  [[ $? -ne 0 ]] && return 1
64
64
  bluer_ai_hr
65
65
 
66
+ bluer_objects_download \
67
+ policy=doesnt_exist \
68
+ $object_name
69
+ [[ $? -ne 0 ]] && return 1
70
+ bluer_ai_hr
71
+
66
72
  bluer_objects_upload \
67
73
  zip \
68
74
  $object_name
bluer_objects/__init__.py CHANGED
@@ -4,7 +4,7 @@ ICON = "🌀"
4
4
 
5
5
  DESCRIPTION = f"{ICON} Object management in Bash."
6
6
 
7
- VERSION = "6.231.1"
7
+ VERSION = "6.235.1"
8
8
 
9
9
  REPO_NAME = "bluer-objects"
10
10
 
@@ -2,12 +2,24 @@ from typing import List
2
2
 
3
3
  from bluer_options.terminal import show_usage, xtra
4
4
 
5
+ from bluer_objects.storage.policies import DownloadPolicy
6
+
5
7
 
6
8
  def help_download(
7
9
  tokens: List[str],
8
10
  mono: bool,
9
11
  ) -> str:
10
- options = "filename=<filename>"
12
+ options = "".join(
13
+ [
14
+ "filename=<filename>",
15
+ xtra(
16
+ ",policy={}".format(
17
+ "|".join(sorted([policy.name.lower() for policy in DownloadPolicy]))
18
+ ),
19
+ mono=mono,
20
+ ),
21
+ ]
22
+ )
11
23
 
12
24
  open_options = "open,QGIS"
13
25
 
@@ -6,7 +6,7 @@ import os
6
6
 
7
7
  from bluer_options import string
8
8
 
9
- from bluer_objects import file, objects
9
+ from bluer_objects import file, objects, path
10
10
  from bluer_objects.graphics.signature import sign_filename
11
11
 
12
12
  LOG_IMAGE_GRID_COLS = 5
@@ -97,7 +97,10 @@ def log_image_grid(
97
97
  filename,
98
98
  [
99
99
  " | ".join(
100
- objects.signature(file.name_and_extension(filename))
100
+ objects.signature(
101
+ info=file.name_and_extension(filename),
102
+ object_name=path.name(file.path(filename)),
103
+ )
101
104
  + [image_shape]
102
105
  + header
103
106
  )
@@ -5,6 +5,7 @@ from blueness.argparse.generic import sys_exit
5
5
 
6
6
  from bluer_objects import NAME
7
7
  from bluer_objects import storage
8
+ from bluer_objects.storage.policies import DownloadPolicy
8
9
  from bluer_objects.logger import logger
9
10
 
10
11
  NAME = module.name(__file__, NAME)
@@ -59,6 +60,12 @@ parser.add_argument(
59
60
  default=1,
60
61
  help="0 | 1",
61
62
  )
63
+ parser.add_argument(
64
+ "--policy",
65
+ type=str,
66
+ default="none",
67
+ help=" | ".join(sorted([policy.name.lower() for policy in DownloadPolicy])),
68
+ )
62
69
  args = parser.parse_args()
63
70
 
64
71
  delim = " " if args.delim == "space" else args.delim
@@ -72,6 +79,7 @@ elif args.task == "download":
72
79
  success = storage.download(
73
80
  object_name=args.object_name,
74
81
  filename=args.filename,
82
+ policy=DownloadPolicy[args.policy.upper()],
75
83
  )
76
84
  elif args.task == "ls":
77
85
  success, list_of_files = storage.ls(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: bluer_objects
3
- Version: 6.231.1
3
+ Version: 6.235.1
4
4
  Summary: 🌀 Object management in Bash.
5
5
  Home-page: https://github.com/kamangir/bluer-objects
6
6
  Author: Arash Abadpour (Kamangir)
@@ -64,6 +64,6 @@ pip install bluer-objects
64
64
 
65
65
  [![pylint](https://github.com/kamangir/bluer-objects/actions/workflows/pylint.yml/badge.svg)](https://github.com/kamangir/bluer-objects/actions/workflows/pylint.yml) [![pytest](https://github.com/kamangir/bluer-objects/actions/workflows/pytest.yml/badge.svg)](https://github.com/kamangir/bluer-objects/actions/workflows/pytest.yml) [![bashtest](https://github.com/kamangir/bluer-objects/actions/workflows/bashtest.yml/badge.svg)](https://github.com/kamangir/bluer-objects/actions/workflows/bashtest.yml) [![PyPI version](https://img.shields.io/pypi/v/bluer-objects.svg)](https://pypi.org/project/bluer-objects/) [![PyPI - Downloads](https://img.shields.io/pypi/dd/bluer-objects)](https://pypistats.org/packages/bluer-objects)
66
66
 
67
- built by 🌀 [`bluer README`](https://github.com/kamangir/bluer-objects/tree/main/bluer_objects/README), based on 🌀 [`bluer_objects-6.231.1`](https://github.com/kamangir/bluer-objects).
67
+ built by 🌀 [`bluer README`](https://github.com/kamangir/bluer-objects/tree/main/bluer_objects/README), based on 🌀 [`bluer_objects-6.235.1`](https://github.com/kamangir/bluer-objects).
68
68
 
69
69
  built by 🌀 [`blueness-3.118.1`](https://github.com/kamangir/blueness).
@@ -1,4 +1,4 @@
1
- bluer_objects/__init__.py,sha256=ObgK0QNoNgfJkVpVSqCPbWvtul6Np2g-HnsCFjqIArY,315
1
+ bluer_objects/__init__.py,sha256=ofPRcFSzDjaruJ-HFoqSQgBIZQ-3WndwUqgbApttPa8,315
2
2
  bluer_objects/__main__.py,sha256=Yqfov833_hJuRne19WrGhT5DWAPtdffpoMxeSXS7EGw,359
3
3
  bluer_objects/config.env,sha256=RjcpnbKfRqNyGLRB4z7M_OG9z2pOM032ck__53JqXqo,216
4
4
  bluer_objects/env.py,sha256=iw4QvaImqnavlsHwfkUScNHc7afDEJQKJSsHTtVJE78,2019
@@ -14,7 +14,7 @@ bluer_objects/.abcli/alias.sh,sha256=nYrAqpaXkL3xOTc_MQdZGSXB4kuUxxAqeXZrI5-E3e8
14
14
  bluer_objects/.abcli/bluer_objects.sh,sha256=x7qf8hSAp3dAl0Hes4J07vL6qP-mWFUkJhvUXzTJC_8,210
15
15
  bluer_objects/.abcli/clone.sh,sha256=KqC5d4MAXwo7UZGhKnfCq9k9CCSl3I1dpU1igYs0Yrs,1975
16
16
  bluer_objects/.abcli/create_test_asset.sh,sha256=ONIdad_WRjZWdW6V2RalRW2qSJwybEwzU-_KsvaJ9og,245
17
- bluer_objects/.abcli/download.sh,sha256=77Bak3TATDrDNpBWM8bvbU1MdsuTCENyqdBJNx_Wsa0,564
17
+ bluer_objects/.abcli/download.sh,sha256=SKv4JyjcWjOutK95-gurCqbRjpmcrmzxASEEdT23Ob4,650
18
18
  bluer_objects/.abcli/file.sh,sha256=djcHSFS8fqlCsoDyZKmimNTzd-jOUnxbOFpL7xq_hGk,150
19
19
  bluer_objects/.abcli/gif.sh,sha256=sZZZWAvwR7bTf6gF70b0l_1tw4-HOswh93iwUAQilEI,803
20
20
  bluer_objects/.abcli/host.sh,sha256=N-Gdsk-mR2V2MvFlwlIVwaiGkQyV1DoM5UdhQrpUsls,573
@@ -65,7 +65,7 @@ bluer_objects/.abcli/tests/mlflow_logging.sh,sha256=TVzHhk9qRthpP2xdKwu3LwK00S77
65
65
  bluer_objects/.abcli/tests/mlflow_tags.sh,sha256=pX4sEK_z2Vrb7a6Bq4qWurFVPZkvjpS10K4MLx3mf64,811
66
66
  bluer_objects/.abcli/tests/mlflow_test.sh,sha256=7MXxYq2GgD2MEJbQlpx80qLT2HaaVn_PFFMpSA_hWA4,125
67
67
  bluer_objects/.abcli/tests/storage_public_upload.sh,sha256=qwyUSejxDlV5Q1f7jyOLej_ADZt50HwbuSImFcrMWf8,589
68
- bluer_objects/.abcli/tests/storage_upload_download.sh,sha256=l5EO0TwyHw7zVBrJV8xmJub8RburdAiyg80WEH3VjrQ,1476
68
+ bluer_objects/.abcli/tests/storage_upload_download.sh,sha256=GvFZgzRzN9zlAGLM7m-_uDlDyATAUo7KQcW2yXYFaKw,1604
69
69
  bluer_objects/.abcli/tests/version.sh,sha256=k-lXozSjyFgFR58cTzUYla0Ef-upx3sSK641zI5ynfE,169
70
70
  bluer_objects/.abcli/tests/web_is_accessible.sh,sha256=3R33_LQM9PIfl8Bks4HrPHp4ug8cGv9X6LaDscsznEs,405
71
71
  bluer_objects/.abcli/tests/web_where_am_ai.sh,sha256=BJ9G_m4id8cx_UB_l_jV2xY6AfQEpG7O4IBsuVjodxk,104
@@ -92,7 +92,7 @@ bluer_objects/help/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuF
92
92
  bluer_objects/help/__main__.py,sha256=Dxg-JpMOIlYWZklI_J2LyiHnRui5lUwWmfM7FLRzUXA,237
93
93
  bluer_objects/help/clone.py,sha256=PDnQs7zc4sqmoBHPjVRfX7jIaePiohPGCNA5bxeerik,553
94
94
  bluer_objects/help/create_test_asset.py,sha256=oxJORm2qk4b_q7EC6-dEuNu1_pK9Ri60PcHhrE8ruxM,375
95
- bluer_objects/help/download.py,sha256=1fw3ASOXUuXcNhm8y0AK7ZBmXzWwZvdo2hK9ZVbgteA,439
95
+ bluer_objects/help/download.py,sha256=9zC_IvH4p2vMXb_qcAS176CBFp5fJe4Z9DFMPdSGBac,751
96
96
  bluer_objects/help/functions.py,sha256=ghCXmHHMVgdPDkqPHWIK7L64wb--oLYhdfJdZyboZKM,1096
97
97
  bluer_objects/help/gif.py,sha256=gKV6vNT4bEC2Ch3QIb3Yc5DqzAH_UvAVCsuvzXeF1Sc,564
98
98
  bluer_objects/help/host.py,sha256=4t4yrPGjTbnFtODcuBjfIzpA5pmmvc5s4QrjIqPPVsM,988
@@ -108,7 +108,7 @@ bluer_objects/host/__init__.py,sha256=Ko43SWnZNsGKuIPU_l0w17pYrxCgVHQx3_zEoUNaHZ
108
108
  bluer_objects/host/__main__.py,sha256=J0MO2sUzrI_t_X4VVYyM6n41ND0yhhSXOmZSkDAC4rg,1751
109
109
  bluer_objects/host/functions.py,sha256=ADups78hYZDAnC6FlIICQ48WkFd4sPnRMWA0D6X-FV4,1663
110
110
  bluer_objects/logger/__init__.py,sha256=2aGNbx-qBXU3IlX9BDqtrFfN25lO_uarEg22cE3-3dU,102
111
- bluer_objects/logger/image.py,sha256=NUE8biNaW54yuIm9I3m3gmmq4I_J7vZ12y3Cl7FCxSA,2507
111
+ bluer_objects/logger/image.py,sha256=fwDILjYo8g8zWiqz1vMlvur8t1E9DXRxJE7lb_T-5l4,2621
112
112
  bluer_objects/logger/matrix.py,sha256=cPKQIhd347MH_9LaB-Ym7Mix1pqampG9MIgkeh08KA4,5757
113
113
  bluer_objects/metadata/__init__.py,sha256=B8cmMOMMO53mTwD2LJUFbSjvangSkpLqhR3oVIBsoBI,260
114
114
  bluer_objects/metadata/__main__.py,sha256=UAZBsf3AMUo-OHIgg4gS5_OowDOIO2T_zjismL3AfkI,2272
@@ -131,7 +131,7 @@ bluer_objects/storage/WebDAV.py,sha256=UftrpSDzJAtTeMEORNpOTbDhmRYAzgdTNbmrAkgzP
131
131
  bluer_objects/storage/WebDAVrequest.py,sha256=Wp4rtlWif7sdu4VohxenT8YVmf-tmV9gbBYxuKFDR8M,10279
132
132
  bluer_objects/storage/WebDAVzip.py,sha256=EHbERaxnLUQqWSM12dwJYybvXCIqqo66uThvNBE8BHI,4212
133
133
  bluer_objects/storage/__init__.py,sha256=LY3pxxflaZ0KUSJJzlh0GEFH-HpshBntn5qs62uk0WQ,1866
134
- bluer_objects/storage/__main__.py,sha256=6T4gltrJ-3lihce2fm43UeWB1y09VInXHrVBnAAa_R4,2005
134
+ bluer_objects/storage/__main__.py,sha256=GlUQjonf1K0SFdivRntJEdFFRwtF4eP1WtmNEJe5LY4,2269
135
135
  bluer_objects/storage/base.py,sha256=35G51iTsU99N_JQwUS2oatbACudAsiOrQ0E6fIz2cic,2396
136
136
  bluer_objects/storage/policies.py,sha256=xIuIhFjcWH7ptg_jUgfYTNnXqs9xaX4yU5qSOhmmxhI,125
137
137
  bluer_objects/storage/s3.py,sha256=30i9bqj5gGZQZ9YRAqcF5piThlFilsmYqI0eFXnJ3M8,9755
@@ -171,8 +171,8 @@ bluer_objects/tests/test_web_is_accessible.py,sha256=2Y20NAEDMblg0MKnhnqcfw3XVKE
171
171
  bluer_objects/web/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
172
172
  bluer_objects/web/__main__.py,sha256=xf2Ob54FI8JEokfGhFmiyOBdD9nBactwqmZvsKsdioU,624
173
173
  bluer_objects/web/functions.py,sha256=KNufAFOc6N3BYf83lN2rUpKUdsnzb2anWyp9koFRVUo,172
174
- bluer_objects-6.231.1.dist-info/licenses/LICENSE,sha256=ogEPNDSH0_dhiv_lT3ifVIdgIzHAqNA_SemnxUfPBJk,7048
175
- bluer_objects-6.231.1.dist-info/METADATA,sha256=K9N197qOMIX9IXRIdgkJFkIjDATJBrqB_ex64KFfiJ4,3678
176
- bluer_objects-6.231.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
177
- bluer_objects-6.231.1.dist-info/top_level.txt,sha256=RX2TpddbnRkurda3G_pAdyeTztP2IhhRPx949GlEvQo,14
178
- bluer_objects-6.231.1.dist-info/RECORD,,
174
+ bluer_objects-6.235.1.dist-info/licenses/LICENSE,sha256=ogEPNDSH0_dhiv_lT3ifVIdgIzHAqNA_SemnxUfPBJk,7048
175
+ bluer_objects-6.235.1.dist-info/METADATA,sha256=ZhAeBF4uFx-GsQRqsb6RjigVYDjEKbouqpt6JTD3juo,3678
176
+ bluer_objects-6.235.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
177
+ bluer_objects-6.235.1.dist-info/top_level.txt,sha256=RX2TpddbnRkurda3G_pAdyeTztP2IhhRPx949GlEvQo,14
178
+ bluer_objects-6.235.1.dist-info/RECORD,,