From: Kevin McCarthy Date: Thu, 31 May 2012 09:11:14 +0000 (-1000) Subject: PEP8 cleanup and make files.py work in python2.5 X-Git-Tag: v0.1.0~99 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=29a793a0d208c725e8d8e2f24a3fd47deb0874e9;p=vcrpy.git PEP8 cleanup and make files.py work in python2.5 --- diff --git a/vcr/files.py b/vcr/files.py index 7e036c0..3864ccf 100644 --- a/vcr/files.py +++ b/vcr/files.py @@ -1,17 +1,18 @@ +from __future__ import with_statement import os import yaml + def load_cassette(cassette_path): try: return yaml.load(open(cassette_path)) except IOError: return None -def save_cassette(cassette_path,cassette): - dirname,filename = os.path.split(cassette_path) + +def save_cassette(cassette_path, cassette): + dirname, filename = os.path.split(cassette_path) if not os.path.exists(dirname): os.makedirs(dirname) - with open(cassette_path,'wc') as cassette_file: + with open(cassette_path, 'wc') as cassette_file: cassette_file.write(cassette.serialize()) - -