comparison mercurial/pure/osutil.py @ 10282:08a0f04b56bd

many, many trivial check-code fixups
author Matt Mackall <mpm@selenic.com>
date Mon, 25 Jan 2010 00:05:27 -0600
parents 25e572394f5c
children 5f091fc1bab7
comparison
equal deleted inserted replaced
10281:e7d3b509af8b 10282:08a0f04b56bd
9 import stat as _stat 9 import stat as _stat
10 10
11 posixfile = open 11 posixfile = open
12 12
13 def _mode_to_kind(mode): 13 def _mode_to_kind(mode):
14 if _stat.S_ISREG(mode): return _stat.S_IFREG 14 if _stat.S_ISREG(mode):
15 if _stat.S_ISDIR(mode): return _stat.S_IFDIR 15 return _stat.S_IFREG
16 if _stat.S_ISLNK(mode): return _stat.S_IFLNK 16 if _stat.S_ISDIR(mode):
17 if _stat.S_ISBLK(mode): return _stat.S_IFBLK 17 return _stat.S_IFDIR
18 if _stat.S_ISCHR(mode): return _stat.S_IFCHR 18 if _stat.S_ISLNK(mode):
19 if _stat.S_ISFIFO(mode): return _stat.S_IFIFO 19 return _stat.S_IFLNK
20 if _stat.S_ISSOCK(mode): return _stat.S_IFSOCK 20 if _stat.S_ISBLK(mode):
21 return _stat.S_IFBLK
22 if _stat.S_ISCHR(mode):
23 return _stat.S_IFCHR
24 if _stat.S_ISFIFO(mode):
25 return _stat.S_IFIFO
26 if _stat.S_ISSOCK(mode):
27 return _stat.S_IFSOCK
21 return mode 28 return mode
22 29
23 def listdir(path, stat=False, skip=None): 30 def listdir(path, stat=False, skip=None):
24 '''listdir(path, stat=False) -> list_of_tuples 31 '''listdir(path, stat=False) -> list_of_tuples
25 32