/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: John Ferlito
  • Date: 2009-09-02 04:31:45 UTC
  • mto: (4665.7.1 serve-init)
  • mto: This revision was merged to the branch mainline in revision 4913.
  • Revision ID: johnf@inodes.org-20090902043145-gxdsfw03ilcwbyn5
Add a debian init script for bzr --serve

Show diffs side-by-side

added added

removed removed

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