Skip to content

Commit

Permalink
rename reset function
Browse files Browse the repository at this point in the history
  • Loading branch information
willmcgugan committed Mar 27, 2023
1 parent 886fa89 commit 6aa2527
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 15 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [13.3.3] - Unreleased
## [13.3.3] - 2023-02-27

### Added

Expand Down
19 changes: 5 additions & 14 deletions rich/style.py
Original file line number Diff line number Diff line change
Expand Up @@ -646,12 +646,8 @@ def copy(self) -> "Style":
return style

@lru_cache(maxsize=128)
def reset(self, link: bool = True, meta: bool = True) -> "Style":
"""Get a copy of this style with optionally link and meta reset to default.
Args:
link (bool, optional): Reset links. Defaults to True.
meta (bool, optional): Reset meta. Defaults to True.
def clear_meta_and_links(self) -> "Style":
"""Get a copy of this style with link and meta information removed.
Returns:
Style: New style object.
Expand All @@ -665,16 +661,11 @@ def reset(self, link: bool = True, meta: bool = True) -> "Style":
style._bgcolor = self._bgcolor
style._attributes = self._attributes
style._set_attributes = self._set_attributes
if link:
style._link = None
style._link_id = ""
else:
style._link = self._link
style._link_id = f"{randint(0, 999999)}" if self._link else ""
style._link = None
style._link_id = ""
style._hash = self._hash
style._null = False

style._meta = None if meta else self._meta
style._meta = None
return style

def update_link(self, link: Optional[str] = None) -> "Style":
Expand Down

0 comments on commit 6aa2527

Please sign in to comment.