Skip to content

Commit de4fa4f

Browse files
committedSep 13, 2015
Automatically create options dictionary
1 parent a193831 commit de4fa4f

File tree

1 file changed

+17
-39
lines changed

1 file changed

+17
-39
lines changed
 

‎v7/nanogallery_directive/nanogallery_directive.py

+17-39
Original file line numberDiff line numberDiff line change
@@ -140,45 +140,23 @@ def _sanitize_options(self):
140140
# We need to convert all the lowercase options (rst make them
141141
# lowercase automatically) to the correct ones -supported by
142142
# nanoGALLERY Javascript function
143-
js_options = OrderedDict([
144-
('theme', 'theme'),
145-
('colorscheme', 'colorScheme'),
146-
('rtl', 'RTL'),
147-
('maxitemsperline', 'maxItemsPerLine'),
148-
('maxwidth', 'maxWidth'),
149-
('paginationdots', 'paginationDots'),
150-
('paginationmaxlinesperpage', 'paginationMaxLinesPerPage'),
151-
('paginationswipe', 'paginationSwipe'),
152-
('locationhash', 'locationHash'),
153-
('itemsselectable', 'itemsSelectable'),
154-
('showcheckboxes', 'showCheckboxes'),
155-
('checkboxstyle', 'checkboxStyle'),
156-
('keepselection', 'keepSelection'),
157-
('i18n', 'i18n'),
158-
('lazybuild', 'lazyBuild'),
159-
('lazybuildtreshold', 'lazyBuildTreshold'),
160-
('openonstart', 'openOnStart'),
161-
('breakpointsizesm', 'breakpointSizeSM'),
162-
('breakpointsizeme', 'breakpointSizeME'),
163-
('breakpointsizela', 'breakpointSizeLA'),
164-
('breakpointsizexl', 'breakpointSizeXL'),
165-
('thumbnailheight', 'thumbnailHeight'),
166-
('thumbnailwidth', 'thumbnailWidth'),
167-
('thumbnailalignment', 'thumbnailAlignment'),
168-
('thumbnailgutterwidth', 'thumbnailGutterWidth'),
169-
('thumbnailgutterheight', 'thumbnailGutterHeight'),
170-
('thumbnailopenimage', 'thumbnailOpenImage'),
171-
('thumbnaillabel', 'thumbnailLabel'),
172-
('thumbnailhovereffect', 'thumbnailHoverEffect'),
173-
('touchanimation', 'touchAnimation'),
174-
('touchautoopendelay', 'touchAutoOpenDelay'),
175-
('thumbnaildisplayinterval', 'thumbnailDisplayInterval'),
176-
('thumbnaildisplaytransition', 'thumbnailDisplayTransition'),
177-
('thumbnaillazyload', 'thumbnailLazyLoad'),
178-
('thumbnaillazyloadtreshold', 'thumbnailLazyLoadTreshold'),
179-
('thumbnailadjustlastrowheight', 'thumbnailAdjustLastRowHeight'),
180-
('thumbnailalbumdisplayimage', 'thumbnailAlbumDisplayImage')
181-
])
143+
js_options = [
144+
'theme', 'colorScheme', 'RTL', 'maxItemsPerLine',
145+
'maxWidth', 'paginationDots', 'paginationMaxLinesPerPage',
146+
'paginationSwipe', 'locationHash', 'itemsSelectable',
147+
'showCheckboxes', 'checkboxStyle', 'keepSelection',
148+
'i18n', 'lazyBuild', 'lazyBuildTreshold', 'openOnStart',
149+
'breakpointSizeSM', 'breakpointSizeME', 'breakpointSizeLA',
150+
'breakpointSizeXL', 'thumbnailHeight', 'thumbnailWidth',
151+
'thumbnailAlignment', 'thumbnailGutterWidth',
152+
'thumbnailGutterHeight', 'thumbnailOpenImage',
153+
'thumbnailLabel', 'thumbnailHoverEffect',
154+
'touchAnimation', 'touchAutoOpenDelay',
155+
'thumbnailDisplayInterval', 'thumbnailDisplayTransition',
156+
'thumbnailLazyLoad', 'thumbnailLazyLoadTreshold',
157+
'thumbnailAdjustLastRowHeight', 'thumbnailAlbumDisplayImage'
158+
]
159+
js_options = {o.lower(): o for o in js_options}
182160

183161
options = {}
184162
for k in defaults:

0 commit comments

Comments
 (0)
Please sign in to comment.