Skip to content

Commit a89a0f2

Browse files
committed
doc: revisions to uix/recycleview/__init__.py
1 parent 6287ee4 commit a89a0f2

File tree

1 file changed

+21
-7
lines changed

1 file changed

+21
-7
lines changed

kivy/uix/recycleview/__init__.py

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
the documentation is not complete at this time.
1010
1111
12-
Data accepted: list of dict.
12+
Data accepted: list of dicts.
1313
1414
TODO:
1515
- Method to clear cached class instances.
@@ -38,6 +38,8 @@
3838
When views are re-used they may not trigger if the data remains the same.
3939
"""
4040

41+
__all__ = ('RecycleViewBehavior', 'RecycleView')
42+
4143
from copy import deepcopy
4244

4345
from kivy.uix.scrollview import ScrollView
@@ -52,8 +54,9 @@
5254

5355

5456
class RecycleViewBehavior(object):
55-
"""RecycleViewBehavior is a flexible view for providing a limited window into
56-
a large data set.
57+
"""RecycleViewBehavior provides a behavioral model upon which the
58+
:class:`RecycleView` is built. Together, they offer an extensible and
59+
flexible way to produce views with limited windows over large data sets.
5760
5861
See module documentation for more informations.
5962
"""
@@ -157,8 +160,8 @@ def refresh_from_viewport(self, *largs):
157160
self._refresh_trigger()
158161

159162
def _dispatch_prop_on_source(self, prop_name, *largs):
160-
'''Dispatches the prop of this class when the view_adapter/layout_manager
161-
property changes.
163+
'''Dispatches the prop of this class when the
164+
view_adapter/layout_manager property changes.
162165
'''
163166
getattr(self.__class__, prop_name).dispatch(self)
164167

@@ -234,8 +237,8 @@ def _set_layout_manager(self, value):
234237

235238
if not isinstance(value, RecycleLayoutManagerBehavior):
236239
raise ValueError(
237-
'Expected object based on RecycleLayoutManagerBehavior, got {}'.
238-
format(value.__class__))
240+
'Expected object based on RecycleLayoutManagerBehavior, '
241+
'got {}'.format(value.__class__))
239242

240243
self._layout_manager = value
241244
value.attach_recycleview(self)
@@ -249,7 +252,11 @@ def _set_layout_manager(self, value):
249252

250253

251254
class RecycleView(RecycleViewBehavior, ScrollView):
255+
"""RecycleView is a flexible view for providing a limited window
256+
into a large data set.
252257
258+
See module documentation for more informations.
259+
"""
253260
def __init__(self, **kwargs):
254261
if self.data_model is None:
255262
kwargs.setdefault('data_model', RecycleDataModel())
@@ -326,21 +333,25 @@ def remove_widget(self, widget, *largs):
326333
def _get_data(self):
327334
d = self.data_model
328335
return d and d.data
336+
329337
def _set_data(self, value):
330338
d = self.data_model
331339
if d is not None:
332340
d.data = value
341+
333342
data = AliasProperty(_get_data, _set_data, bind=["data_model"])
334343
"""Set the data on the current view adapter
335344
"""
336345

337346
def _get_viewclass(self):
338347
a = self.layout_manager
339348
return a and a.viewclass
349+
340350
def _set_viewclass(self, value):
341351
a = self.layout_manager
342352
if a:
343353
a.viewclass = value
354+
344355
viewclass = AliasProperty(_get_viewclass, _set_viewclass,
345356
bind=["layout_manager"])
346357
"""Set the viewclass on the current layout_manager
@@ -349,11 +360,14 @@ def _set_viewclass(self, value):
349360
def _get_key_viewclass(self):
350361
a = self.layout_manager
351362
return a and a.key_viewclass
363+
352364
def _set_key_viewclass(self, value):
353365
a = self.layout_manager
354366
if a:
355367
a.key_viewclass = value
368+
356369
key_viewclass = AliasProperty(_get_key_viewclass, _set_key_viewclass,
357370
bind=["layout_manager"])
358371
"""Set the key viewclass on the current layout_manager
359372
"""
373+

0 commit comments

Comments
 (0)