/usr/share/pyshared/grokcore/component/tests/order/combined_orderdirective.py is in python-grokcore.component 2.5-0ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | """
If the grok.order directive is specified with other classes that don't
have the order specified, then the order will be determined by first
sorting on the order specified, and then by the definition order.
>>> components = [First(), Second(), Third(), Fourth(), Fifth()]
>>> from grokcore.component import sort_components
>>> sort_components(components)
[<...Third object at ...>,
<...Fourth object at ...>,
<...Second object at ...>,
<...Fifth object at ...>,
<...First object at ...>]
"""
import grokcore.component as grok
class First(object):
grok.order(2)
class Second(object):
grok.order(1)
class Third(object):
grok.order()
class Fourth(object):
grok.order()
class Fifth(object):
grok.order(1)
|