def browse_sortkey_reverse(prop):
if prop.startswith('<STR_LIT:->'):<EOL><INDENT>prop = prop[<NUM_LIT:1>:]<EOL>reverse = True<EOL><DEDENT>else:<EOL><INDENT>reverse = False<EOL><DEDENT>if prop == '<STR_LIT:text>':<EOL><INDENT>return (<EOL>lambda x: (<EOL>x.is_directory == reverse,<EOL>x.link.text.lower() if x.link and x.link.text else x.name<EOL>),<EOL>reverse<EOL>)<EOL><DEDENT>if prop == '<STR_LIT:size>':<EOL><INDENT>return (<EOL>lambda x: (<EOL>x.is_directory == reverse,<EOL>x.stats.st_size<EOL>),<EOL>reverse<EOL>)<EOL><DEDENT>return (<EOL>lambda x: (<EOL>x.is_directory == reverse,<EOL>getattr(x, prop, None)<EOL>),<EOL>reverse<EOL>)<EOL>
Get sorting function for directory listing based on given attribute
name, with some caveats:
* Directories will be first.
* If *name* is given, link widget lowercase text will be used istead.
* If *size* is given, bytesize will be used.

:param prop: file attribute name
:returns: tuple with sorting gunction and reverse bool
:rtype: tuple of a dict and a bool