Back to index

plone3  3.1.7
Functions | Variables
ExtendedPathIndex.ptests.createData Namespace Reference

Functions

def buildTree

Variables

string epi_path = '/'
int LIMIT = 500
int DEPTHLIMIT = 5
tuple storage = FileStorage(file_name='EPI.fs', create=True)
tuple db = DB(storage)
tuple conn = db.open()
tuple root = conn.root()
tuple index = ExtendedPathIndex( 'path' )
tuple plone = Root('plone')

Function Documentation

def ExtendedPathIndex.ptests.createData.buildTree (   index,
  f1 = 20,
  f2 = 20,
  f3 = 1 
)

Definition at line 31 of file createData.py.

00031 
00032 def buildTree(index, f1=20, f2=20, f3=1):
00033     count = 0
00034     for i in range(f1):
00035         f1id = 'f-%d' % i
00036         folder1 = Dummy("/plone/%s" % f1id)
00037         count += 1
00038         index.index_object(count, folder1)
00039 
00040         for j in range(f2):
00041             transaction.commit(1)
00042             f2id = 'f-%d-%d' % (i, j)
00043             folder2 = Dummy("/plone/%s/%s" % (f1id, f2id))
00044             count += 1
00045             index.index_object(count, folder2)
00046 
00047             for k in range(f3):
00048                 f3id = 'f-%d-%d-%d' % (i, j, k)
00049                 folder3 = Dummy("/plone/%s/%s/%s" % (f1id, f2id, f3id))
00050                 count += 1
00051                 index.index_object(count, folder3)
00052 
00053                 for m in range(500):
00054                     docid = 'f-%d-%d-%d-%d' % (i, j, k, m)
00055                     doc = Dummy("/plone/%s/%s/%s/%s" % (f1id, f2id, f3id, docid))
00056                     count += 1
00057                     index.index_object(count, doc)
00058     print 'Created %s entries' % count
00059 
00060 buildTree(index, 20,20)


Variable Documentation

Definition at line 24 of file createData.py.

Definition at line 21 of file createData.py.

Definition at line 17 of file createData.py.

Definition at line 13 of file createData.py.

tuple ExtendedPathIndex.ptests.createData.index = ExtendedPathIndex( 'path' )

Definition at line 27 of file createData.py.

Definition at line 16 of file createData.py.

Definition at line 61 of file createData.py.

Definition at line 25 of file createData.py.

tuple ExtendedPathIndex.ptests.createData.storage = FileStorage(file_name='EPI.fs', create=True)

Definition at line 20 of file createData.py.