[tracker] data-generate: Make scripts scalable and default to 2000 items



commit f5126df3cb100049c75e4c56be261aa0dee24ca0
Author: Martyn Russell <martyn lanedo com>
Date:   Wed Dec 2 18:48:53 2009 +0200

    data-generate: Make scripts scalable and default to 2000 items

 utils/data-generators/generate-all.sh            |   14 +++++++++-----
 utils/data-generators/generate-data-for-music.py |    8 ++++----
 2 files changed, 13 insertions(+), 9 deletions(-)
---
diff --git a/utils/data-generators/generate-all.sh b/utils/data-generators/generate-all.sh
index aa6f394..e03e452 100755
--- a/utils/data-generators/generate-all.sh
+++ b/utils/data-generators/generate-all.sh
@@ -4,7 +4,7 @@
 
 if [ -z $1 ]
 then
-entries=100
+entries=2000
 else
 entries=$1
 fi
@@ -15,8 +15,12 @@ for generator in `ls generate-data-for-*.py`
 do
    echo "Running $generator"
    dest=`echo $generator | sed -s "s/\.py/\.ttl/"`
-  ./$generator $entries > $dest
-done
 
-#cat contacts.ttl
-#rm -f contacts.ttl
+   if test "x$generator" = "xgenerate-data-for-music.py"; then
+       args="-T $entries"
+   else
+       args="$entries"
+   fi
+
+   ./$generator $args > $dest
+done
diff --git a/utils/data-generators/generate-data-for-music.py b/utils/data-generators/generate-data-for-music.py
index 2c52e38..03ab400 100755
--- a/utils/data-generators/generate-data-for-music.py
+++ b/utils/data-generators/generate-data-for-music.py
@@ -169,17 +169,17 @@ if __name__ == '__main__':
                 if not options.__dict__[m]:  
                         # Set defaults
                         if m == "TotalTracks":
-                                options.TotalTracks = 5000
+                                options.TotalTracks = 100
                         elif m == "ArtistCount":
-                                options.ArtistCount = 60
+                                options.ArtistCount = 2
                         elif m == "AlbumCount":
-                                options.AlbumCount = 60
+                                options.AlbumCount = 10
 
 	settings['TotalTracks'] = options.TotalTracks
 	if settings['TotalTracks'] < (options.ArtistCount * options.AlbumCount):
 		sys.exit('InputError: TotalTracks should be greater than or equal to  ArtistCount * AlbumCount')
 
-	settings['TitlesPerAlbum'] = settings['TotalTracks'] / (int(options.ArtistCount) * int(options.AlbumCount))
+	settings['TitlesPerAlbum'] = int(settings['TotalTracks']) / (int(options.ArtistCount) * int(options.AlbumCount))
 	#print 'settings[\'TitlesPerAlbum\'] %d' %settings['TitlesPerAlbum']
 	settings['ArtistCount'] = int(options.ArtistCount)
 	settings['AlbumCount'] = int(options.AlbumCount)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]