Skip to content

Commit 3dbeff2

Browse files
discentemhomebysix
authored andcommitted
added support for small-spacer-tile in makeDockAppSpacer (#1)
* added support for small-spacer-tile in makeDockAppSpacer * clearer error message * lol, forgot .format() the first time
1 parent 1ef25de commit 3dbeff2

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Diff for: docklib.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,13 @@ def replaceDockEntry(self, thePath, label=None, section='persistent-apps'):
104104
if found_index > -1:
105105
self.items[section][found_index] = new_item
106106

107-
def makeDockAppSpacer(self):
107+
def makeDockAppSpacer(self, type='spacer-tile'):
108108
'''Makes an empty space in the Dock.'''
109+
if type not in ['spacer-tile', 'small-spacer-tile']:
110+
msg = "{0}: invalid makeDockAppSpacer type.".format(type)
111+
raise ValueError(msg)
109112
return {'tile-data': {},
110-
'tile-type': 'spacer-tile'}
113+
'tile-type': type}
111114

112115
def makeDockAppEntry(self, thePath):
113116
'''returns a dictionary corresponding to a Dock application item'''

0 commit comments

Comments
 (0)