/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/_readdir_py.py

  • Committer: Marius Kruger
  • Date: 2010-07-10 21:28:56 UTC
  • mto: (5384.1.1 integration)
  • mto: This revision was merged to the branch mainline in revision 5385.
  • Revision ID: marius.kruger@enerweb.co.za-20100710212856-uq4ji3go0u5se7hx
* Update documentation
* add NEWS

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
"""Python implementation of readdir interface."""
18
18
 
 
19
 
19
20
import stat
20
21
 
21
22
 
29
30
_unknown = 'unknown'
30
31
 
31
32
_formats = {
32
 
    stat.S_IFDIR: 'directory',
33
 
    stat.S_IFCHR: 'chardev',
34
 
    stat.S_IFBLK: 'block',
35
 
    stat.S_IFREG: 'file',
36
 
    stat.S_IFIFO: 'fifo',
37
 
    stat.S_IFLNK: 'symlink',
38
 
    stat.S_IFSOCK: 'socket',
 
33
    stat.S_IFDIR:'directory',
 
34
    stat.S_IFCHR:'chardev',
 
35
    stat.S_IFBLK:'block',
 
36
    stat.S_IFREG:'file',
 
37
    stat.S_IFIFO:'fifo',
 
38
    stat.S_IFLNK:'symlink',
 
39
    stat.S_IFSOCK:'socket',
39
40
}
40
41
 
41
42
 
45
46
    It's performance is critical: Do not mutate without careful benchmarking.
46
47
    """
47
48
    try:
48
 
        return _formats[stat_mode & 0o170000]
 
49
        return _formats[stat_mode & 0170000]
49
50
    except KeyError:
50
51
        return _unknown