[tracker/rss-enclosures] Small fixes to the data generators



commit 31335ad60d7422d77217b798ac1e9280d54e9e1e
Author: Mikael Ottela <mikael ottela ixonos com>
Date:   Wed Apr 14 09:34:28 2010 +0300

    Small fixes to the data generators
    
    Add large test set configuration max.cfg

 utils/data-generators/cc/generate                  |   38 +++++++-------
 utils/data-generators/cc/max.cfg                   |   51 ++++++++++++++++++++
 utils/data-generators/cc/mfo.py                    |    4 +-
 .../cc/template/mfo_FeedMessage.tmpl               |   12 ++--
 4 files changed, 78 insertions(+), 27 deletions(-)
---
diff --git a/utils/data-generators/cc/generate b/utils/data-generators/cc/generate
index a468634..0abe7d9 100755
--- a/utils/data-generators/cc/generate
+++ b/utils/data-generators/cc/generate
@@ -69,7 +69,7 @@ print "Loaded", templates_count, "templates"
 
 print "Generating Contacts",
 count_contacts = config.getint('counts','contacts')
-for contact in range(1, count_contacts):
+for contact in range(1, count_contacts+1):
   if (contact % 10 == 0):
     sys.stdout.write('.')
     sys.stdout.flush()
@@ -83,30 +83,30 @@ print "Generate Emails",
 count_accounts = config.getint('counts','accounts')
 count_folders = config.getint('counts','folders')
 count_emails = config.getint('counts','emails')
-for account in range(1, count_accounts):
+for account in range(1, count_accounts+1):
   sys.stdout.write('.')
   sys.stdout.flush()
   nmo.generateMailAccount( account*count_folders*count_emails )
-  for folder in range(1, count_folders):
+  for folder in range(1, count_folders+1):
     nmo.generateMailFolder( account*count_folders*count_emails+folder*count_emails )
-    for email in range(1, count_emails):
+    for email in range(1, count_emails+1):
       nmo.generateEmail( account*count_folders*count_emails+folder*count_emails+email )
 print "Done"
 
 print "Generate IM messages",
 count_comchans = config.getint('counts','comchans')
 count_ims = config.getint('counts','ims')
-for comchannel in range(1, count_comchans):
+for comchannel in range(1, count_comchans+1):
   sys.stdout.write('.')
   sys.stdout.flush()
   nmo.generateCommunicationChannel( comchannel*count_ims )
-  for im in range(1, count_ims):
+  for im in range(1, count_ims+1):
     nmo.generateIMMessage( comchannel*count_ims+im )
 print "Done"
 
 print "Generate SMS messages",
 count_sms = config.getint('counts','sms')
-for sms in range(1, count_sms):
+for sms in range(1, count_sms+1):
   if (sms % 10 == 0):
     sys.stdout.write('.')
     sys.stdout.flush()
@@ -115,7 +115,7 @@ print "Done"
 
 print "Generate calls",
 count_calls = config.getint('counts','calls')
-for call in range(1, count_calls):
+for call in range(1, count_calls+1):
   if (call % 10 == 0):
     sys.stdout.write('.')
     sys.stdout.flush()
@@ -126,7 +126,7 @@ print "* Starting with file system based content"
 
 print "Generate volumes",
 count_volumes = config.getint('counts','volumes')
-for volume in range(1, count_volumes):
+for volume in range(1, count_volumes+1):
   sys.stdout.write('.')
   sys.stdout.flush()
   tracker.generateVolume( volume )
@@ -136,19 +136,19 @@ print "Generating Music",
 count_artists = config.getint('counts','artists')
 count_albums = config.getint('counts','albums')
 count_songs = config.getint('counts','songs')
-for artist in range(1, count_artists):
+for artist in range(1, count_artists+1):
   sys.stdout.write('.')
   sys.stdout.flush()
   nmm.generateArtist( artist*count_albums*count_songs )
-  for album in range(1, count_albums):
+  for album in range(1, count_albums+1):
     nmm.generateAlbum( artist*count_albums*count_songs+album )
-    for song in range(1, count_songs):
+    for song in range(1, count_songs+1):
       nmm.generateMusicPiece( artist*count_albums*count_songs+album*count_songs+song )
 print "Done"
 
 print "Generate Photos",
 count_images = config.getint('counts','images')
-for photo in range(1, count_images):
+for photo in range(1, count_images+1):
   if (photo % 10 == 0):
     sys.stdout.write('.')
     sys.stdout.flush()
@@ -157,7 +157,7 @@ print "Done"
 
 print "Generate plain text documents",
 count_docs = config.getint('counts','docs')
-for doc in range(1, count_docs):
+for doc in range(1, count_docs+1):
   if (doc % 10 == 0):
     sys.stdout.write('.')
     sys.stdout.flush()
@@ -167,28 +167,28 @@ print "Done"
 print "Generate feeds",
 count_fchans = config.getint('counts','fchans')
 count_fms = config.getint('counts','fms')
-for fchan in range(1, count_fchans):
+for fchan in range(1, count_fchans+1):
   sys.stdout.write('.')
   sys.stdout.flush()
   mfo.generateFeedChannel( fchan*count_fms )
-  for fm in range(1, count_fms):
+  for fm in range(1, count_fms+1):
     mfo.generateFeedMessage( fchan*count_fms+fm )
 print "Done"
 
 print "Generate software",
 count_softcats = config.getint('counts','softcats')
 count_softapps = config.getint('counts','softapps')
-for softcat in range(1, count_softcats):
+for softcat in range(1, count_softcats+1):
   sys.stdout.write('.')
   sys.stdout.flush()
   nfo.generateSoftwareCategory( softcat*count_softapps )
-  for softapp in range(1, count_softapps):
+  for softapp in range(1, count_softapps+1):
     nfo.generateSoftwareApplication( softcat*count_softapps+softapp )
 print "Done"
 
 print "Generate something for the rest",
 count_others = config.getint('counts','others')
-for index in range(1,count_others):
+for index in range(1,count_others+1):
   if (index % 10 == 0):
     sys.stdout.write('.')
     sys.stdout.flush()
diff --git a/utils/data-generators/cc/max.cfg b/utils/data-generators/cc/max.cfg
new file mode 100644
index 0000000..9500edc
--- /dev/null
+++ b/utils/data-generators/cc/max.cfg
@@ -0,0 +1,51 @@
+[counts]
+
+# Content creation counts
+
+# Contacts
+contacts : 1000
+
+# Emails
+accounts : 5
+folders  : 2
+emails   : 1000
+
+# IM Messages
+comchans : 200
+ims      : 500
+
+# SMS messages
+sms      : 10000
+
+# Calls
+calls    : 1000
+
+# Feeds
+fchans   : 10
+fms      : 1000
+
+# Software
+softcats : 10
+softapps : 100
+
+# FILE SYSTEM BASED CONTENT
+
+# Volumes
+volumes  : 5
+
+# Music
+artists  : 50
+albums   : 20
+songs    : 10
+
+# Images
+images   : 10000
+
+# Videos
+videos   : 1000
+
+# Text documents
+docs     : 1000
+
+# Others
+others   : 100
diff --git a/utils/data-generators/cc/mfo.py b/utils/data-generators/cc/mfo.py
index 2315200..6b8c91c 100644
--- a/utils/data-generators/cc/mfo.py
+++ b/utils/data-generators/cc/mfo.py
@@ -4,7 +4,7 @@ import tools
 
 ####################################################################################
 def generateFeedChannel(index):
-  feed_channel_uri         = 'http://feed%d.feed.com/feed%d.rss' % (index % 1000, index % 1000)
+  feed_channel_uri         = 'http://feed%d.feed.com/feed%d.rss' % (index % 1000, index)
   feed_channel_title       = 'Feed %d' % index
   feed_channel_description = 'Description %d' % (index % 1000)
 
@@ -22,7 +22,7 @@ def generateFeedChannel(index):
 
 ####################################################################################
 def generateFeedMessage(index):
-  feed_message_uri         = 'http://feed%d.feed.com/message%d.html' % (index % 1000, index % 1000)
+  feed_message_uri         = 'http://feed%d.feed.com/message%d.html' % (index % 1000, index)
   feed_message_title       = 'Message %d' % index
   feed_message_description = 'Description %d' % (index % 1000)
   feed_message_comment     = 'Comment %d' % index
diff --git a/utils/data-generators/cc/template/mfo_FeedMessage.tmpl b/utils/data-generators/cc/template/mfo_FeedMessage.tmpl
index 054d5c1..070697f 100644
--- a/utils/data-generators/cc/template/mfo_FeedMessage.tmpl
+++ b/utils/data-generators/cc/template/mfo_FeedMessage.tmpl
@@ -1,7 +1,7 @@
 <${feed_message_uri}> a mfo:FeedMessage ;
-  nie:title           "${feed_message_title}" ;
-  nie:relatedTo       <${feed_message_uri}> ;
-  nie:description     "${feed_message_description}" ;
-  nie:links           <${feed_message_uri}> ;
-  nie:comment         "${feed_message_comment}" ;
-  nie:isLogicalPartOf <${feed_message_channel}> .
+  nie:title                "${feed_message_title}" ;
+  nie:relatedTo            <${feed_message_uri}> ;
+  nie:description          "${feed_message_description}" ;
+  nie:links                <${feed_message_uri}> ;
+  nie:comment              "${feed_message_comment}" ;
+  nmo:communicationChannel <${feed_message_channel}> .



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