[tracker/subqueries] data-generators: WIP
- From: Jürg Billeter <juergbi src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [tracker/subqueries] data-generators: WIP
- Date: Sun, 6 Dec 2009 20:50:08 +0000 (UTC)
commit 437e665027429435041761124c1862dbf058f08c
Author: Jürg Billeter <j bitron ch>
Date: Fri Dec 4 20:29:36 2009 +0100
data-generators: WIP
utils/data-generators/generate-data-for-gossip.py | 27 +++++++++-----------
1 files changed, 12 insertions(+), 15 deletions(-)
---
diff --git a/utils/data-generators/generate-data-for-gossip.py b/utils/data-generators/generate-data-for-gossip.py
index 02780b0..832af84 100755
--- a/utils/data-generators/generate-data-for-gossip.py
+++ b/utils/data-generators/generate-data-for-gossip.py
@@ -183,14 +183,18 @@ def generate_me ():
#print_property ("nmo:folderParameters", "?")
def generate_im_messages (n_convs, n_channels, msgs_per_convs, friends_list, n_friends):
- if n_friends < 2:
- same_friend = get_random_in_list(friends_list)
- else:
- same_friend = None
+ for i in range (0, len(friends_list)):
+ same_friend = friends_list[i]
- for i in range (0, n_channels):
channel_id = get_random_uuid_uri()
- print_instance (channel_id, "nmo:CommunicationChannel", final = True)
+ print_instance (channel_id, "nmo:CommunicationChannel")
+
+ if same_friend:
+ print_anon_node ("nmo:hasParticipant",
+ "nco:IMContact",
+ "nco:hasIMAccount",
+ same_friend,
+ t = "uri", final = True)
for j in range (0, n_convs):
conversation_id = get_random_uuid_uri()
@@ -234,13 +238,6 @@ def generate_im_messages (n_convs, n_channels, msgs_per_convs, friends_list, n_f
"nco:hasIMAccount",
addresses[(k + 1) % 2],
t = "uri", final = True)
- if same_friend:
- print_instance (channel_id, "nmo:CommunicationChannel")
- print_anon_node ("nmo:hasParticipant",
- "nco:IMContact",
- "nco:hasIMAccount",
- same_friend,
- t = "uri", final = True)
def generate_im_group_chats (amount, friends_list):
@@ -345,7 +342,7 @@ if __name__ == "__main__":
print_namespaces ()
generate_me ()
- known_accounts = generate_accounts (5)
- generate_im_messages (25, 10, entries, known_accounts, 1)
+ known_accounts = generate_accounts (1000)
+ generate_im_messages (2, 10, entries, known_accounts, 1)
# generate_im_group_chats (entries, known_accounts)
# generate_mail (entries, known_emails)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]