From 720e40f652111da7e6ce1f84b75acb1fe268d2cb Mon Sep 17 00:00:00 2001 From: Catherine Devlin Date: Sat, 26 May 2012 20:02:41 -0400 Subject: Indicate change in repository host to bitbucket --- docs/pycon2010/fileutil.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 docs/pycon2010/fileutil.py (limited to 'docs/pycon2010/fileutil.py') diff --git a/docs/pycon2010/fileutil.py b/docs/pycon2010/fileutil.py new file mode 100644 index 00000000..5e754b5a --- /dev/null +++ b/docs/pycon2010/fileutil.py @@ -0,0 +1,12 @@ +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() -- cgit v1.2.1