Skip to content

Commit 159055f

Browse files
authored
Rename TagDecorator to StatusTag (#155)
1 parent 6c07fe7 commit 159055f

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

HISTORY.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Release History
66
0.6.2
77
+++++
88
* Adds ability to declare that command groups, commands, and arguments are in a preview status and therefore might change or be removed. This is done by passing the kwarg `is_preview=True`.
9-
* Adds a generic `TagDecorator` class to `knack.util` that allows you to create your own colorized tags like `[Preview]` and `[Deprecated]`.
9+
* Adds a generic `StatusTag` class to `knack.util` that allows you to create your own colorized tags like `[Preview]` and `[Deprecated]`.
1010
* When an incorrect command name is entered, Knack will now attempt to suggest the closest alternative.
1111

1212
0.6.1

knack/deprecation.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
from six import string_types as STRING_TYPES
77

8-
from .util import TagDecorator
8+
from .util import StatusTag
99

1010
DEFAULT_DEPRECATED_TAG = '[Deprecated]'
1111

@@ -31,7 +31,7 @@ def _get_command_group(name):
3131

3232

3333
# pylint: disable=too-many-instance-attributes
34-
class Deprecated(TagDecorator):
34+
class Deprecated(StatusTag):
3535

3636
@staticmethod
3737
def ensure_new_style_deprecation(cli_ctx, kwargs, object_type):

knack/preview.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Licensed under the MIT License. See License.txt in the project root for license information.
44
# --------------------------------------------------------------------------------------------
55

6-
from .util import TagDecorator
6+
from .util import StatusTag
77

88
_PREVIEW_TAG = '[Preview]'
99
_preview_kwarg = 'preview_info'
@@ -30,7 +30,7 @@ def _get_command_group(name):
3030

3131

3232
# pylint: disable=too-many-instance-attributes
33-
class PreviewItem(TagDecorator):
33+
class PreviewItem(StatusTag):
3434

3535
def __init__(self, cli_ctx=None, object_type='', target=None, tag_func=None, message_func=None, **kwargs):
3636
""" Create a collection of preview metadata.

knack/util.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def __str__(self):
5252
return self._color + self._message + colorama.Fore.RESET
5353

5454

55-
class TagDecorator(object):
55+
class StatusTag(object):
5656

5757
# pylint: disable=unused-argument
5858
def __init__(self, cli_ctx, object_type, target, tag_func, message_func, color, **kwargs):

0 commit comments

Comments
 (0)