From 6d34ef1fe7b218e27c287fd0f0bad1c8dd2bc61e Mon Sep 17 00:00:00 2001
From: Branson Stephens <stephenb@uwm.edu>
Date: Wed, 22 Jan 2014 11:30:04 -0600
Subject: [PATCH] Oops. This should have been lumped together with the previous
 commit. Here, self.version is set on the VersionedFile object.

---
 utils/vfile.py | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/utils/vfile.py b/utils/vfile.py
index e6020db98..f393b7d68 100644
--- a/utils/vfile.py
+++ b/utils/vfile.py
@@ -50,8 +50,12 @@ class VersionedFile(file):
             self.log.debug(
                     "opening file '{0}' with mode '{1}'"
                     .format(actual_name, mode))
+            # XXX I, Branson, want version to be a property of the file object.
+            # It is probably stupid to have the local 'version' too (i.e., the
+            # one scoped inside of this __init__). But I'm reluctant to mess with
+            # Brian's code too much.
+            self.version = version
             file.__init__(self, actual_name, *args, **kwargs)
-            return
 
         # Otherwise...
 
@@ -113,6 +117,9 @@ class VersionedFile(file):
 
         if failedAttempts >= 5:
             raise IOError("Too many attempts to open file")
+        # XXX As above in the writing case. We simply want version to 
+        # be an accessible property of the file object.
+        self.version = version
 
     def _name_for_version(self, version):
         if version is None:
-- 
GitLab