Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(122)

Unified Diff: third_party/twisted_8_1/twisted/conch/ls.py

Issue 12261012: Remove third_party/twisted_8_1 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/twisted_8_1/twisted/conch/ls.py
diff --git a/third_party/twisted_8_1/twisted/conch/ls.py b/third_party/twisted_8_1/twisted/conch/ls.py
deleted file mode 100644
index ebc962f5f23ae8464134ee3a436b645d47145ecd..0000000000000000000000000000000000000000
--- a/third_party/twisted_8_1/twisted/conch/ls.py
+++ /dev/null
@@ -1,55 +0,0 @@
-# Copyright (c) 2001-2005 Twisted Matrix Laboratories.
-# See LICENSE for details.
-
-import array
-import stat
-import time
-
-def lsLine(name, s):
- mode = s.st_mode
- perms = array.array('c', '-'*10)
- ft = stat.S_IFMT(mode)
- if stat.S_ISDIR(ft): perms[0] = 'd'
- elif stat.S_ISCHR(ft): perms[0] = 'c'
- elif stat.S_ISBLK(ft): perms[0] = 'b'
- elif stat.S_ISREG(ft): perms[0] = '-'
- elif stat.S_ISFIFO(ft): perms[0] = 'f'
- elif stat.S_ISLNK(ft): perms[0] = 'l'
- elif stat.S_ISSOCK(ft): perms[0] = 's'
- else: perms[0] = '!'
- # user
- if mode&stat.S_IRUSR:perms[1] = 'r'
- if mode&stat.S_IWUSR:perms[2] = 'w'
- if mode&stat.S_IXUSR:perms[3] = 'x'
- # group
- if mode&stat.S_IRGRP:perms[4] = 'r'
- if mode&stat.S_IWGRP:perms[5] = 'w'
- if mode&stat.S_IXGRP:perms[6] = 'x'
- # other
- if mode&stat.S_IROTH:perms[7] = 'r'
- if mode&stat.S_IWOTH:perms[8] = 'w'
- if mode&stat.S_IXOTH:perms[9] = 'x'
- # suid/sgid
- if mode&stat.S_ISUID:
- if perms[3] == 'x': perms[3] = 's'
- else: perms[3] = 'S'
- if mode&stat.S_ISGID:
- if perms[6] == 'x': perms[6] = 's'
- else: perms[6] = 'S'
- l = perms.tostring()
- l += str(s.st_nlink).rjust(5) + ' '
- un = str(s.st_uid)
- l += un.ljust(9)
- gr = str(s.st_gid)
- l += gr.ljust(9)
- sz = str(s.st_size)
- l += sz.rjust(8)
- l += ' '
- sixmo = 60 * 60 * 24 * 7 * 26
- if s.st_mtime + sixmo < time.time(): # last edited more than 6mo ago
- l += time.strftime("%b %2d %Y ", time.localtime(s.st_mtime))
- else:
- l += time.strftime("%b %2d %H:%S ", time.localtime(s.st_mtime))
- l += name
- return l
-
« no previous file with comments | « third_party/twisted_8_1/twisted/conch/interfaces.py ('k') | third_party/twisted_8_1/twisted/conch/manhole.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698