~pygame/pygame/trunk

« back to all changes in this revision

Viewing changes to test/util/build_page/libs/pywebsite/zdb.py

  • Committer: pygame
  • Date: 2017-01-10 00:31:42 UTC
  • Revision ID: git-v1:2eea4f299a2e791f884608d7ed601558634af73c
commit 1639c41a8cb3433046882ede92c80ce69d59016b
Author: Thomas Kluyver <takowl@gmail.com>
Date:   Sun Jan 8 18:46:46 2017 +0000

    Build newer versions of libogg and libvorbis into Linux base images

    Closes #317
    Closes #323

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
from ZODB import DB, FileStorage
 
2
import transaction
 
3
 
 
4
class ZDB(object):
 
5
    def __init__(self, path):
 
6
        self.storage = FileStorage.FileStorage(path)
 
7
        self.db = DB(self.storage)
 
8
        self.connection = self.db.open()
 
9
        self.root = self.connection.root()
 
10
    
 
11
    def commit(self):
 
12
        transaction.commit()
 
13
 
 
14
    def close(self, commit=True):
 
15
        if commit: self.commit()
 
16
        self.connection.close()
 
17
        self.db.close()
 
18
        self.storage.close()
 
19
 
 
20
__all__ = ['ZDB']
 
 
b'\\ No newline at end of file'