]> khamidou — GitHub mirrors - vcrpy.git/commitdiff
Begin work on implementing configuration interface
authorKevin McCarthy <me@kevinmccarthy.org>
Tue, 20 Aug 2013 04:48:23 +0000 (18:48 -1000)
committerKevin McCarthy <me@kevinmccarthy.org>
Tue, 20 Aug 2013 05:49:05 +0000 (19:49 -1000)
vcr/__init__.py
vcr/config.py [new file with mode: 0644]

index efa5e94afb82191b33cdc255b61b0aca8e24e93b..14c6028ba7f924fbeec2081dc7f6cf3293c4a521 100644 (file)
@@ -1,6 +1,7 @@
-# Import Cassette to make it available at the top level
-from .cassette import Cassette
+from config import VCR
+
+default_vcr = VCR()
 
 # Also, make a 'load' function available
 def use_cassette(path, **kwargs):
-    return Cassette.load(path, **kwargs)
+    return default_vcr.use_cassette(path, **kwargs)
diff --git a/vcr/config.py b/vcr/config.py
new file mode 100644 (file)
index 0000000..a708994
--- /dev/null
@@ -0,0 +1,9 @@
+from .cassette import Cassette
+
+class VCR(object):
+    def __init__(self, serializer='yaml', cassette_library_dir=None):
+        self.serializer = serializer
+        self.cassette_library_dir = cassette_library_dir
+
+    def use_cassette(self, path, **kwargs):
+        return Cassette.load(path, **kwargs)