Skip to content

Commit

Permalink
Updaing script name from delete to regenerate
Browse files Browse the repository at this point in the history
  • Loading branch information
tommyg-cld committed Aug 3, 2023
1 parent 6d6a3bf commit 5ffb4f0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions cloudinary_cli/modules/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
from .migrate import migrate
from .sync import sync
from .upload_dir import upload_dir
from .delete_all_derived_by_transformation import delete_all_derived_by_transformation
from .regenerate_all_derived_by_transformation import regenerate_all_derived_by_transformation

commands = [
upload_dir,
make,
migrate,
sync,
delete_all_derived_by_transformation
regenerate_all_derived_by_transformation
]
18 changes: 9 additions & 9 deletions cloudinary_cli/modules/delete_all_derived_by_transformation.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@
DEFAULT_MAX_RESULTS = 500

curr_dt = datetime.today().strftime('%Y-%m-%d')
filename = f'delete_derived_public_ids_{curr_dt}.log'
filename = f'regenerate_derived_public_ids_{curr_dt}.log'
logging.basicConfig(filename=filename,
level=logging.INFO,
format='%(asctime)s %(levelname)s - %(message)s')


@command("delete_all_derived_by_transformation",
short_help="""Delete all derived of a transformation.""",
@command("regenerate_all_derived_by_transformation",
short_help="""Regenerate all derived of a transformation.""",
help="""
\b
Delete all derived versions of a named transformations.
Format: cld delete_all_derived_by_transformation <transformation_name> <command options>
e.g. cld delete_all_derived_by_transformation t_named -A -ea -enu http://mywebhook.com
Regenerate all derived versions of a named transformations.
Format: cld regenerate_all_derived_by_transformation <transformation_name> <command options>
e.g. cld regenerate_all_derived_by_transformation t_named -A -ea -enu http://mywebhook.com
""")
@argument("trans_str")
@option("-enu", "--eager_notification_url", help="Webhook notification URL.")
Expand All @@ -38,7 +38,7 @@
@option("-n", "--max_results", nargs=1, default=10,
help="""The maximum number of derived results to return.
Default: 10, maximum: 500.""")
def delete_all_derived_by_transformation(trans_str, eager_notification_url,
def regenerate_all_derived_by_transformation(trans_str, eager_notification_url,
eager_async, auto_paginate, force,
force_initial, max_results):
if not any(trans_str):
Expand All @@ -48,7 +48,7 @@ def delete_all_derived_by_transformation(trans_str, eager_notification_url,
if not confirm_action(
f"Running this module will explicity "
f"re-generate all the derived versions "
f"which will cause an increase in your trasnformation costs "
f"which will cause an increase in your transformation costs "
f"based on the number of derived re-generated.\n"
f"Continue? (y/N)"):
logger.info("Stopping.")
Expand Down Expand Up @@ -86,7 +86,7 @@ def delete_all_derived_by_transformation(trans_str, eager_notification_url,

try:
exp_res = handle_command(params, (), (), module=upload_api,
module_name="delete_all_derived_by_transformation")
module_name="regenerate_all_derived_by_transformation")
except Exception as e:
error_data = (f'public_id={public_id}, type={delivery_type}, '
f'resource_type={res_type}: {e}')
Expand Down

0 comments on commit 5ffb4f0

Please sign in to comment.