/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: Vincent Ladeuil
  • Date: 2011-11-24 10:47:43 UTC
  • mto: (6321.1.1 trunk)
  • mto: This revision was merged to the branch mainline in revision 6322.
  • Revision ID: v.ladeuil+lp@free.fr-20111124104743-rxqwhmzqu5k17f24
First cut at a working plugin to avoid conflicts in .po files by shelling out to msgmerge.

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