Skip to content

Commit b36bf53

Browse files
authored
Merge pull request #29 from homebysix/1.2.1
v1.2.1 merge to master
2 parents 3af5ac9 + 38e8783 commit b36bf53

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ All notable changes to this project will be documented in this file. This projec
77

88
Nothing yet.
99

10+
## [1.2.1] - 2021-03-01
11+
12+
### Fixed
13+
14+
- Fixed issue preventing `findExistingLabel()` from finding URLs' labels
1015

1116
## [1.2.0] - 2020-10-15
1217

@@ -86,7 +91,8 @@ Nothing yet.
8691
- Initial release
8792

8893

89-
[Unreleased]: https://github.com/homebysix/docklib/compare/v1.2.0...HEAD
94+
[Unreleased]: https://github.com/homebysix/docklib/compare/v1.2.1...HEAD
95+
[1.2.0]: https://github.com/homebysix/docklib/compare/v1.2.0...v1.2.1
9096
[1.2.0]: https://github.com/homebysix/docklib/compare/v1.0.5...v1.2.0
9197
[1.0.5]: https://github.com/homebysix/docklib/compare/v1.0.4...v1.0.5
9298
[1.0.4]: https://github.com/homebysix/docklib/compare/v1.0.3...v1.0.4

docklib/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
from .docklib import *
22

3-
__version__ = "1.2.0"
3+
__version__ = "1.2.1"

docklib/docklib.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,11 @@ def findExistingLabel(self, test_label, section="persistent-apps"):
118118
found."""
119119
section_items = self.items[section]
120120
if section_items:
121-
for index, item in enumerate(section_items):
122-
if item["tile-data"].get("file-label") == test_label:
123-
return index
121+
# Most dock items use "file-label", but URLs use "label"
122+
for label_key in ("file-label", "label"):
123+
for index, item in enumerate(section_items):
124+
if item["tile-data"].get(label_key) == test_label:
125+
return index
124126

125127
return -1
126128

0 commit comments

Comments
 (0)