summaryrefslogtreecommitdiff
path: root/scripts/ledger-du
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2008-08-05 13:17:04 -0400
committerJohn Wiegley <johnw@newartisans.com>2008-08-05 18:05:49 -0400
commitf6f4a46cf5b14f9a2170cd6475958efbf320caec (patch)
tree05bc1defcdebc201de3dd10477483d906a842821 /scripts/ledger-du
parentb7970b29855563e4c67f85af8b31233eda80c22a (diff)
downloadfork-ledger-f6f4a46cf5b14f9a2170cd6475958efbf320caec.tar.gz
fork-ledger-f6f4a46cf5b14f9a2170cd6475958efbf320caec.tar.bz2
fork-ledger-f6f4a46cf5b14f9a2170cd6475958efbf320caec.zip
Moved around most of the files so that source code is in src/, documentation
is in doc/, etc.
Diffstat (limited to 'scripts/ledger-du')
-rwxr-xr-xscripts/ledger-du49
1 files changed, 0 insertions, 49 deletions
diff --git a/scripts/ledger-du b/scripts/ledger-du
deleted file mode 100755
index f5d7dd7d..00000000
--- a/scripts/ledger-du
+++ /dev/null
@@ -1,49 +0,0 @@
-#!/usr/bin/env python
-
-import string
-import sys
-import os
-import time
-
-from stat import *
-from os.path import *
-
-def report_file(path):
- dir_elems = string.split(dirname(path), os.sep)
- if dir_elems[0] == "." or dir_elems[0] == "":
- dir_elems = dir_elems[1 :]
- account = string.join(dir_elems, ":")
-
- info = os.stat(path)
- print time.strftime("%Y/%m/%d", time.localtime(info[ST_MTIME])),
-
- print basename(path)
- print " ", account, " ", info[ST_SIZE], "b"
- print " Equity:Files"
- print
-
-def find_files(path):
- entries = os.listdir(path)
- for entry in entries:
- entry = join(path, entry)
- if not islink(entry):
- if isdir(entry) and entry != "/proc":
- find_files(entry)
- else:
- report_file(entry)
-
-args = sys.argv[1:]
-if len(args):
- paths = args
-else:
- paths = ["."]
-
-print """
-C 1.00 Kb = 1024 b
-C 1.00 Mb = 1024 Kb
-C 1.00 Gb = 1024 Mb
-C 1.00 Tb = 1024 Gb
-"""
-
-for path in paths:
- find_files(path)