Skip to content

Bump docklib to v1.3.0#29

Closed
homebysix wants to merge 1 commit intomacadmins:mainfrom
homebysix:docklib-1.3.0
Closed

Bump docklib to v1.3.0#29
homebysix wants to merge 1 commit intomacadmins:mainfrom
homebysix:docklib-1.3.0

Conversation

@homebysix
Copy link
Copy Markdown
Contributor

@homebysix homebysix commented Jun 11, 2021

Docklib 1.3.0 release includes:

Added

  • A new findExistingEntry function that can find dock items based on several attributes.

    The default behavior of findExistingEntry is to match the provided string on (in order of preference):

    1. label
    2. path
    3. filename with extension
    4. filename without extension

    The match_on parameter can be specified to select only one of those attributes to match, if desired. See the findExistingEntry function docstring for available parameters and values.

Changed

  • The findExistingLabel function is now simply a pointer to the new findExistingEntry function. findExistingLabel will be maintained for backward-compatibility.

  • The removeDockEntry function has a new match_on parameter that mirrors the same parameter in findExistingEntry. Default behavior is to match on the same attributes listed above, in the same order of preference. (This is a change in behavior from previous versions of docklib. If you prefer to continue removing items solely based on label, you should specify match_on="label" in your function call.)

  • The replaceDockEntry function has two new parameters:

    • match_str, which allows specifying the item intended to be replaced in the dock (replaces the now deprecated label parameter).
    • match_on, which mirrors the same parameter in findExistingEntry. Default behavior is to match on the same attributes listed above, in the same order of preference.

Deprecated

  • The label parameter of replaceDockEntry is deprecated, and it's encouraged to use match_str instead. This allows existing items to be replaced based on multiple attributes rather than just label. As stated above, this makes dock customization scripts more reliable in multilingual environments.

    A warning has been added that alerts administrators to this deprecation.

  • This is the last release of docklib that will support Python 2. Future releases will only be tested in Python 3.

    If you haven't started bundling a Python 3 runtime for your management tools, this blog article from @scriptingosx is a good read. Also: a reminder that docklib is already included in the "recommended" flavor of the macadmins/python packages.

@erikng
Copy link
Copy Markdown
Member

erikng commented Jun 11, 2021

Tests are failing due to your lack of access. I need to investigate or just duplicate your PR and see if the full test completes.

@erikng erikng closed this Jul 8, 2021
@erikng
Copy link
Copy Markdown
Member

erikng commented Jul 8, 2021

See #30

@homebysix
Copy link
Copy Markdown
Contributor Author

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants