view docs/pycon2010/fileutil.py @ 421:fc63f0aad022

Additional support for native pbcopy for clipboard redirect (">") on MacOSX.
author Jason Ledbetter <jasonbrent@gmail.com
date Wed, 22 Jun 2011 21:56:20 -0400
parents e84703583996
children
line wrap: on
line source

import glob
import os.path

for fullfilename in glob.glob('/home/cat/proj/cmd2/*.py'):
    (dirpath, fname) = os.path.split(fullfilename)
    stats = os.stat(fullfilename)
    binds['path'] = dirpath
    binds['name'] = fname
    binds['bytes'] = stats.st_size
    cmd("""INSERT INTO cat.files (path, name, bytes)
           VALUES (%(path)s, %(name)s, %(bytes)s)""")
quit()