Index: examples/python_tests/leader_rt1/attr.py
===================================================================
--- examples/python_tests/leader_rt1/attr.py	(revision 7211a95f1601147c8c72a41f8043ef08062de055)
+++ examples/python_tests/leader_rt1/attr.py	(revision 3a867a1e95724a8e45ffb3a18a7b1fbaaa9df0de)
@@ -2,5 +2,6 @@
 
 """
-  to test with python
+See README in this directory for the semantics of the example.  This file
+constructs the credentials described and puts copies into this directory
 
 cmd1:env keystore=`pwd` ./attr.py 
@@ -10,10 +11,12 @@
 import ABAC
 
-keystore=os.environ["keystore"]
-
 ctxt = ABAC.Context()
 print "ABAC version %s" % ctxt.version()
 
-ctxt.load_directory(keystore)
+# Keystore is the directory containing the principal credentials.
+# Load existing principals and/or policy credentials
+if (os.environ.has_key("keystore")) :
+    keystore=os.environ["keystore"]
+    ctxt.load_directory(keystore)
 
 out = ctxt.context_principals()
@@ -29,4 +32,5 @@
 print "\n"
 
+# retrieve principals' keyid value from local credential files
 geniID=ABAC.ID("Geni_ID.pem");
 geniID.id_load_privkey_file("Geni_private.pem");
@@ -46,16 +50,29 @@
 
 ################################################
+# Credential 1, 
 # [keyid:geni].role:leader
 #         <- [keyid:geni].role:equivalent([principal:?P[keyid:geni].role:leader])
 head=ABAC.Role(geni,"leader")
-condoset=ABAC.Role(geni,"leader")
-cond=ABAC.Constraint(condoset)
+
+# initialize the role constraint on a principlal
+condrole=ABAC.Role(geni,"leader")
+cond=ABAC.Constraint(condrole)
+
+# make the data term with the role constraint
 param=ABAC.DataTerm("principal","P", cond)
 tail = ABAC.Role(geni,"equivalent")
 tail.role_add_data_term(param)
+
+# build he attribute policy
 attr=ABAC.Attribute(head, 1800)
 attr.attribute_add_tail(tail)
+
+# finalize the policy
 attr.attribute_bake()
+
+# write the policy out to a credential file
 attr.attribute_write_cert("geni_leader__geni_leader_qP_attr.der")
+
+# load the policy into the context using the credential file
 ctxt.load_attribute_file("geni_leader__geni_leader_qP_attr.der")
 print attr.string() 
@@ -64,4 +81,5 @@
 
 #################################################
+# Credential 2
 # [keyid:geni].role:leader <- [keyid:bob]
 head=ABAC.Role(geni,"leader")
@@ -77,4 +95,5 @@
 
 #################################################
+# Credential 3
 # [keyid:geni].role:equivalent([keyid:bob]) <- [keyid:Joe]
 param=ABAC.DataTerm(bobID)
@@ -92,4 +111,5 @@
 
 #################################################
+# Credential 4
 # [keyid:geni].role:equivalent([keyid:Joe]) <- [keyid:Bob]
 param=ABAC.DataTerm(joeID)
@@ -105,47 +125,2 @@
 print attr.typed_string()
 print "\n"
-
-#################################################
-# [keyid:Bob].role:niceCoworker <- [keyid:Maryann])
-head = ABAC.Role(bob,"niceCoworker")
-tail = ABAC.Role(jack)
-attr=ABAC.Attribute(head, 1800)
-attr.attribute_add_tail(tail)
-attr.attribute_bake()
-attr.attribute_write_cert("Bob_nicecoworker__Maryann_attr.der")
-ctxt.load_attribute_file("Bob_nicecoworker__Maryann_attr.der")
-print attr.string() 
-print attr.typed_string()
-print "\n"
-
-#################################################
-# [keyid:geni].role:evaluatorOf([keyid:Joe]) <-[keyid:Bob]
-param=ABAC.DataTerm(joeID)
-head = ABAC.Role(geni,"evaluatorOf")
-head.role_add_data_term(param)
-tail = ABAC.Role(bob)
-attr=ABAC.Attribute(head, 1800)
-attr.attribute_add_tail(tail)
-attr.attribute_bake()
-attr.attribute_write_cert("Alpha_evaluator_j__Bob_attr.der")
-ctxt.load_attribute_file("Alpha_evaluator_j__Bob_attr.der")
-print attr.string() 
-print attr.typed_string()
-print "\n"
-
-#################################################
-# [keyid:Bob].role:goodPerformance <- [keyid:Joe])
-head = ABAC.Role(bob,"goodPerformance")
-tail = ABAC.Role(joe)
-attr=ABAC.Attribute(head, 1800)
-attr.attribute_add_tail(tail)
-attr.attribute_bake()
-attr.attribute_write_cert("Bob_goodperformance__Joe_attr.der")
-ctxt.load_attribute_file("Bob_goodperformance__Joe_attr.der")
-print attr.string() 
-print attr.typed_string()
-print "\n"
-
-
-ctxt.dump_yap_db()
-##
