[Pkg-bazaar-commits] ./bzr/unstable r488: - new helper function kind_marker()

Martin Pool mbp at sourcefrog.net
Fri Apr 10 08:19:00 UTC 2009


------------------------------------------------------------
revno: 488
committer: Martin Pool <mbp at sourcefrog.net>
timestamp: Thu 2005-05-12 12:14:35 +1000
message:
  - new helper function kind_marker()
modified:
  bzrlib/osutils.py
-------------- next part --------------
=== modified file 'bzrlib/osutils.py'
--- a/bzrlib/osutils.py	2005-05-11 10:14:09 +0000
+++ b/bzrlib/osutils.py	2005-05-12 02:14:35 +0000
@@ -56,7 +56,18 @@
     elif S_ISLNK(mode):
         return 'symlink'
     else:
-        raise BzrError("can't handle file kind with mode %o of %r" % (mode, f)) 
+        raise BzrError("can't handle file kind with mode %o of %r" % (mode, f))
+
+
+def kind_marker(kind):
+    if kind == 'file':
+        return ''
+    elif kind == 'directory':
+        return '/'
+    elif kind == 'symlink':
+        return '@'
+    else:
+        raise BzrError('invalid file kind %r' % kind)
 
 
 



More information about the Pkg-bazaar-commits mailing list