Graphics Reference
In-Depth Information
for name in names:
name = name.strip()
if (name!=""):
distlist.append(name)
Theoveralldatapreparation tocreatethedistribution listforthisonee-mail
looks like this:
for i in range(0,3):
names =
row[i].replace('"','').split(';')
for name in names:
name = name.strip()
if (name!=""):
distlist.append(name)
Creating Nodes
Now you can create the nodes, one for each person in the distribution list for
this e-mail, along with additional information such as the size of this e-mail,
using the addNode function as shown here:
# create the nodes
for name in distlist:
addNode(name,kb)
At this point, let's review the addNode function at the beginning of the
script file. It is similar to the previous science fiction example, but with
a slight modification. This time, addNode has two parameters passed to
it—the node name and the size of the e-mail. In addition to name and count,
the node data will also track the total e-mail size.
def addNode(key, kbytes):
if key in nodemap:
node = nodemap[key]
node["count"] += 1
node["size"] += kbytes
else:
node = {"id": key, "count": 1, "size":
kbytes}
Search WWH ::




Custom Search