Re: script to generate blog categories and entries (test data)
Bill Mill <[email protected]>
| Newsgroups | gmane.comp.web.pyblosxom.devel |
|---|---|
| Message-ID | <[email protected]> |
########### gibberish.py:
import random, os
iters = 3500
dircount = 0
filecount = 0
depth = 0
count = 0
for i in xrange(iters):
r = random.randint(0,99)
if r < 10:
dircount += 1
d = 'gibberdir' + str(dircount)
try: os.mkdir(d)
except OSError: continue #why do I get "file not found" errors?
os.chdir(d)
depth += 1
elif r < 20:
if depth > 0:
os.chdir('..')
depth -= 1
else:
filecount += 1
fname = 'gibber' + str(filecount) + '.txt'
f = file(fname, 'w')
gibberish = 'lorem ipsum set amet dolor motherf$%^er!\n'
f.write(gibberish * (r*29))
if i%100 == 0: print "%d iters" % i
print "%d files, %d dirs" % (filecount, dircount)
On Wed, 19 Jan 2005 22:34:19 +0100, Steven Armstrong <[email protected]> wrote:
> Hi all
>
> I believe I once read that someone has written such a script.
> Would you mind to share it?
>
> thanx
> & regards
> Steven
>
> -------------------------------------------------------
> This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
> Tool for open source databases. Create drag-&-drop reports. Save time
> by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
> Download a FREE copy at http://www.intelliview.com/go/osdn_nl
> _______________________________________________
> Pyblosxom-devel mailing list
> Pyblosxom-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
> https://lists.sourceforge.net/lists/listinfo/pyblosxom-devel
>
-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl