Index: examples/python_tests/alumni3_rt1/attr.py
===================================================================
--- examples/python_tests/alumni3_rt1/attr.py	(revision 7211a95f1601147c8c72a41f8043ef08062de055)
+++ examples/python_tests/alumni3_rt1/attr.py	(revision 3a867a1e95724a8e45ffb3a18a7b1fbaaa9df0de)
@@ -2,8 +2,8 @@
 
 """
-  Setup access policy attribute rules
+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 
-
 """
 
@@ -11,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()
@@ -30,4 +32,5 @@
 print "\n"
 
+# retrieve principals' keyid value from local credential files
 stateUID=ABAC.ID("StateU_ID.pem")
 stateUID.id_load_privkey_file("StateU_private.pem")
@@ -56,23 +59,44 @@
 
 ################################################
+# Credential 1, this policy has two range constraints on different parameters
 # [keyid:stateU].role:foundingAlumni
 #              <- [keyid:stateU].role:diploma([string:?D:['mathmatics','psychology']],
 #                                             [integer:?Year:[1960,1961,1963]])
 head = ABAC.Role(stateU,"foundingAlumni")
+
+# initialize a string range constraint
 cond=ABAC.Constraint("string")
+
+# add specific string values to the constraint
 cond.constraint_add_string_target("'mathmatics'")
 cond.constraint_add_string_target("'psychology'")
+
+# create the parameter with the string range constraint
 param1=ABAC.DataTerm("string", "D", cond)
+
+# initialize another constratnt that is of integer type
 cond=ABAC.Constraint("integer")
+
+# add specific integer values to the constraint
 cond.constraint_add_integer_target(1960)
 cond.constraint_add_integer_target(1961)
 cond.constraint_add_integer_target(1963)
+
+# create the parameter with the integer range constraint
 param2=ABAC.DataTerm("integer", "Year", cond)
 tail = ABAC.Role(stateU,"diploma")
+
+# add the parameter with conditions to a role
 tail.role_add_data_term(param1)
 tail.role_add_data_term(param2)
+
+# build up the policy rule
 attr=ABAC.Attribute(head, 1800)
 attr.attribute_add_tail(tail)
+
+# finalize the policy rule
 attr.attribute_bake()
+
+# save it to a credential file
 attr.attribute_write_cert("StateU_foundingAlumni__stateU_diploma_q_qY_attr.der")
 ctxt.load_attribute_file("StateU_foundingAlumni__stateU_diploma_q_qY_attr.der")
@@ -82,4 +106,5 @@
 
 #################################################
+# Credential 2
 # [keyid:stateU].role:diploma([string:'mathmatics'],[integer:1961]) <- [keyid:bob]
 param1=ABAC.DataTerm("string", "'mathmatics'")
@@ -99,4 +124,5 @@
 
 #################################################
+# Credential 3
 # [keyid:stateU].role:diploma([string:'mathmatics'],[integer:1965]) <- [keyid:mark]
 param1=ABAC.DataTerm("string", "'mathmatics'")
@@ -116,4 +142,5 @@
 
 #################################################
+# Credential 4
 # [keyid:stateU].role:diploma([string:'zoology'],[integer:1961]) <- [keyid:joe]
 param1=ABAC.DataTerm("string", "'zoology'")
@@ -133,5 +160,7 @@
 
 #################################################
-# [keyid:stateU].role:diploma([string:'psychology'],[integer:1962]) <- [keyid:maryann]
+# Credential 5
+# [keyid:stateU].role:diploma([string:'psychology'],[integer:1962])
+#                             <- [keyid:maryann]
 param1=ABAC.DataTerm("string", "'psychology'")
 param2=ABAC.DataTerm("integer", "1962")
@@ -151,5 +180,7 @@
 
 #################################################
-# [keyid:stateU].role:diploma([string:'psychology'],[integer:1960]) <- [keyid:jan]
+# Credential 6
+# [keyid:stateU].role:diploma([string:'psychology'],[integer:1960])
+#                              <- [keyid:jan]
 param1=ABAC.DataTerm("string", "'psychology'")
 param2=ABAC.DataTerm("integer", "1960")
@@ -167,5 +198,2 @@
 print "\n"
 
-
-ctxt.dump_yap_db()
-##
