# this is so recursive, it hurts
for topdir in args:
for root, dirs, files in os.walk(topdir):
for file in files:
for regexp in patterns:
if re.search(regexp, file):
file = os.path.join(root, file)
if verbose:
sys.stdout.write("file name: %st" % file)
p = os.stat(file)
a, m, t = (
time.strftime("%Y-%m-%dT%H:%M:%S",
time.gmtime(p.st_atime)),
time.strftime("%Y-%m-%dT%H:%M:%S",
time.gmtime(p.st_mtime)),
time.strftime("%Y-%m-%dT%H:%M:%S", time.gmtime()), )
sys.stdout.write( "atime: %stmtime: %stnow: %sn" %
(a,m,t))
else:
print file
What a huge, ugly, monster, I’m glad the finished code doesn’t look like that lol.
I've elected to declassify this one, because it is just so darn funny lol — was wondering where I saved the snippet of `the worst code I've ever written`