incubator-heraldry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ket...@apache.org
Subject svn commit: r463036 [2/4] - in /incubator/heraldry/libraries/python/yadis/trunk: ./ admin/ doc/ examples/ examples/apache/ yadis/ yadis/test/ yadis/test/data/
Date Wed, 11 Oct 2006 23:09:14 GMT
Added: incubator/heraldry/libraries/python/yadis/trunk/doc/retrieval.dia
URL: http://svn.apache.org/viewvc/incubator/heraldry/libraries/python/yadis/trunk/doc/retrieval.dia?view=auto&rev=463036
==============================================================================
--- incubator/heraldry/libraries/python/yadis/trunk/doc/retrieval.dia (added)
+++ incubator/heraldry/libraries/python/yadis/trunk/doc/retrieval.dia Wed Oct 11 16:09:11 2006
@@ -0,0 +1,1068 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<dia:diagram xmlns:dia="http://www.lysator.liu.se/~alla/dia/">
+  <dia:diagramdata>
+    <dia:attribute name="background">
+      <dia:color val="#ffffff"/>
+    </dia:attribute>
+    <dia:attribute name="pagebreak">
+      <dia:color val="#000099"/>
+    </dia:attribute>
+    <dia:attribute name="paper">
+      <dia:composite type="paper">
+        <dia:attribute name="name">
+          <dia:string>#Letter#</dia:string>
+        </dia:attribute>
+        <dia:attribute name="tmargin">
+          <dia:real val="2.5399999618530273"/>
+        </dia:attribute>
+        <dia:attribute name="bmargin">
+          <dia:real val="2.5399999618530273"/>
+        </dia:attribute>
+        <dia:attribute name="lmargin">
+          <dia:real val="2.5399999618530273"/>
+        </dia:attribute>
+        <dia:attribute name="rmargin">
+          <dia:real val="2.5399999618530273"/>
+        </dia:attribute>
+        <dia:attribute name="is_portrait">
+          <dia:boolean val="false"/>
+        </dia:attribute>
+        <dia:attribute name="scaling">
+          <dia:real val="1"/>
+        </dia:attribute>
+        <dia:attribute name="fitto">
+          <dia:boolean val="false"/>
+        </dia:attribute>
+      </dia:composite>
+    </dia:attribute>
+    <dia:attribute name="grid">
+      <dia:composite type="grid">
+        <dia:attribute name="width_x">
+          <dia:real val="1"/>
+        </dia:attribute>
+        <dia:attribute name="width_y">
+          <dia:real val="1"/>
+        </dia:attribute>
+        <dia:attribute name="visible_x">
+          <dia:int val="1"/>
+        </dia:attribute>
+        <dia:attribute name="visible_y">
+          <dia:int val="1"/>
+        </dia:attribute>
+        <dia:composite type="color"/>
+      </dia:composite>
+    </dia:attribute>
+    <dia:attribute name="color">
+      <dia:color val="#d8e5e5"/>
+    </dia:attribute>
+    <dia:attribute name="guides">
+      <dia:composite type="guides">
+        <dia:attribute name="hguides"/>
+        <dia:attribute name="vguides"/>
+      </dia:composite>
+    </dia:attribute>
+  </dia:diagramdata>
+  <dia:layer name="Background" visible="true">
+    <dia:object type="Flowchart - Diamond" version="0" id="O0">
+      <dia:attribute name="obj_pos">
+        <dia:point val="2,2"/>
+      </dia:attribute>
+      <dia:attribute name="obj_bb">
+        <dia:rectangle val="1.97,1.97;11.03,11.03"/>
+      </dia:attribute>
+      <dia:attribute name="elem_corner">
+        <dia:point val="2,2"/>
+      </dia:attribute>
+      <dia:attribute name="elem_width">
+        <dia:real val="9"/>
+      </dia:attribute>
+      <dia:attribute name="elem_height">
+        <dia:real val="9"/>
+      </dia:attribute>
+      <dia:attribute name="border_width">
+        <dia:real val="0.059999999999999998"/>
+      </dia:attribute>
+      <dia:attribute name="show_background">
+        <dia:boolean val="true"/>
+      </dia:attribute>
+      <dia:attribute name="padding">
+        <dia:real val="0.35355339059327379"/>
+      </dia:attribute>
+      <dia:attribute name="text">
+        <dia:composite type="text">
+          <dia:attribute name="string">
+            <dia:string>#Is the Content-Type
+ header
+"application:xrds+xml"?#</dia:string>
+          </dia:attribute>
+          <dia:attribute name="font">
+            <dia:font family="sans" style="0" name="Helvetica"/>
+          </dia:attribute>
+          <dia:attribute name="height">
+            <dia:real val="0.47999999999999998"/>
+          </dia:attribute>
+          <dia:attribute name="pos">
+            <dia:point val="6.5,6.105"/>
+          </dia:attribute>
+          <dia:attribute name="color">
+            <dia:color val="#000000"/>
+          </dia:attribute>
+          <dia:attribute name="alignment">
+            <dia:enum val="1"/>
+          </dia:attribute>
+        </dia:composite>
+      </dia:attribute>
+    </dia:object>
+    <dia:object type="Flowchart - Manual Input" version="0" id="O1">
+      <dia:attribute name="obj_pos">
+        <dia:point val="-4,-2"/>
+      </dia:attribute>
+      <dia:attribute name="obj_bb">
+        <dia:rectangle val="-4.03,-2.04287;-0.811487,0.908511"/>
+      </dia:attribute>
+      <dia:attribute name="elem_corner">
+        <dia:point val="-4,-2"/>
+      </dia:attribute>
+      <dia:attribute name="elem_width">
+        <dia:real val="3.1585130311865481"/>
+      </dia:attribute>
+      <dia:attribute name="elem_height">
+        <dia:real val="2.8785113019775794"/>
+      </dia:attribute>
+      <dia:attribute name="line_width">
+        <dia:real val="0.059999999999999998"/>
+      </dia:attribute>
+      <dia:attribute name="line_colour">
+        <dia:color val="#000000"/>
+      </dia:attribute>
+      <dia:attribute name="fill_colour">
+        <dia:color val="#ffffff"/>
+      </dia:attribute>
+      <dia:attribute name="show_background">
+        <dia:boolean val="true"/>
+      </dia:attribute>
+      <dia:attribute name="line_style">
+        <dia:enum val="0"/>
+        <dia:real val="1"/>
+      </dia:attribute>
+      <dia:attribute name="text">
+        <dia:composite type="text">
+          <dia:attribute name="string">
+            <dia:string>#User entered 
+Identity URL.#</dia:string>
+          </dia:attribute>
+          <dia:attribute name="font">
+            <dia:font family="sans" style="0" name="Helvetica"/>
+          </dia:attribute>
+          <dia:attribute name="height">
+            <dia:real val="0.47999999999999998"/>
+          </dia:attribute>
+          <dia:attribute name="pos">
+            <dia:point val="-2.42074,-0.140042"/>
+          </dia:attribute>
+          <dia:attribute name="color">
+            <dia:color val="#000000"/>
+          </dia:attribute>
+          <dia:attribute name="alignment">
+            <dia:enum val="1"/>
+          </dia:attribute>
+        </dia:composite>
+      </dia:attribute>
+      <dia:attribute name="flip_horizontal">
+        <dia:boolean val="false"/>
+      </dia:attribute>
+      <dia:attribute name="flip_vertical">
+        <dia:boolean val="false"/>
+      </dia:attribute>
+    </dia:object>
+    <dia:object type="Standard - Line" version="0" id="O2">
+      <dia:attribute name="obj_pos">
+        <dia:point val="-2.42074,0.878511"/>
+      </dia:attribute>
+      <dia:attribute name="obj_bb">
+        <dia:rectangle val="-2.999,0.846517;-1.99725,2.06435"/>
+      </dia:attribute>
+      <dia:attribute name="conn_endpoints">
+        <dia:point val="-2.42074,0.878511"/>
+        <dia:point val="-2.49812,2"/>
+      </dia:attribute>
+      <dia:attribute name="numcp">
+        <dia:int val="1"/>
+      </dia:attribute>
+      <dia:attribute name="line_width">
+        <dia:real val="0.059999999999999998"/>
+      </dia:attribute>
+      <dia:attribute name="end_arrow">
+        <dia:enum val="22"/>
+      </dia:attribute>
+      <dia:attribute name="end_arrow_length">
+        <dia:real val="0.5"/>
+      </dia:attribute>
+      <dia:attribute name="end_arrow_width">
+        <dia:real val="0.5"/>
+      </dia:attribute>
+      <dia:connections>
+        <dia:connection handle="0" to="O1" connection="14"/>
+        <dia:connection handle="1" to="O3" connection="2"/>
+      </dia:connections>
+    </dia:object>
+    <dia:object type="Flowchart - Box" version="0" id="O3">
+      <dia:attribute name="obj_pos">
+        <dia:point val="-5,2"/>
+      </dia:attribute>
+      <dia:attribute name="obj_bb">
+        <dia:rectangle val="-5.03,1.97;0.03375,4.53"/>
+      </dia:attribute>
+      <dia:attribute name="elem_corner">
+        <dia:point val="-5,2"/>
+      </dia:attribute>
+      <dia:attribute name="elem_width">
+        <dia:real val="5.0037500000000001"/>
+      </dia:attribute>
+      <dia:attribute name="elem_height">
+        <dia:real val="2.5"/>
+      </dia:attribute>
+      <dia:attribute name="border_width">
+        <dia:real val="0.059999999999999998"/>
+      </dia:attribute>
+      <dia:attribute name="show_background">
+        <dia:boolean val="true"/>
+      </dia:attribute>
+      <dia:attribute name="padding">
+        <dia:real val="0.5"/>
+      </dia:attribute>
+      <dia:attribute name="text">
+        <dia:composite type="text">
+          <dia:attribute name="string">
+            <dia:string>#HTTP redirects result
+ in normalized URL;
+the "claimed identity."#</dia:string>
+          </dia:attribute>
+          <dia:attribute name="font">
+            <dia:font family="sans" style="0" name="Helvetica"/>
+          </dia:attribute>
+          <dia:attribute name="height">
+            <dia:real val="0.47999999999999998"/>
+          </dia:attribute>
+          <dia:attribute name="pos">
+            <dia:point val="-2.49812,2.855"/>
+          </dia:attribute>
+          <dia:attribute name="color">
+            <dia:color val="#000000"/>
+          </dia:attribute>
+          <dia:attribute name="alignment">
+            <dia:enum val="1"/>
+          </dia:attribute>
+        </dia:composite>
+      </dia:attribute>
+    </dia:object>
+    <dia:object type="Standard - Line" version="0" id="O4">
+      <dia:attribute name="obj_pos">
+        <dia:point val="-2.49812,4.5"/>
+      </dia:attribute>
+      <dia:attribute name="obj_bb">
+        <dia:rectangle val="-3.21137,4.46606;-2.21293,6.10033"/>
+      </dia:attribute>
+      <dia:attribute name="conn_endpoints">
+        <dia:point val="-2.49812,4.5"/>
+        <dia:point val="-2.71215,6"/>
+      </dia:attribute>
+      <dia:attribute name="numcp">
+        <dia:int val="1"/>
+      </dia:attribute>
+      <dia:attribute name="line_width">
+        <dia:real val="0.059999999999999998"/>
+      </dia:attribute>
+      <dia:attribute name="end_arrow">
+        <dia:enum val="22"/>
+      </dia:attribute>
+      <dia:attribute name="end_arrow_length">
+        <dia:real val="0.5"/>
+      </dia:attribute>
+      <dia:attribute name="end_arrow_width">
+        <dia:real val="0.5"/>
+      </dia:attribute>
+      <dia:connections>
+        <dia:connection handle="0" to="O3" connection="13"/>
+        <dia:connection handle="1" to="O5" connection="2"/>
+      </dia:connections>
+    </dia:object>
+    <dia:object type="Flowchart - Document" version="0" id="O5">
+      <dia:attribute name="obj_pos">
+        <dia:point val="-6,6"/>
+      </dia:attribute>
+      <dia:attribute name="obj_bb">
+        <dia:rectangle val="-6.03,5.97;0.605701,7.74595"/>
+      </dia:attribute>
+      <dia:attribute name="elem_corner">
+        <dia:point val="-6,6"/>
+      </dia:attribute>
+      <dia:attribute name="elem_width">
+        <dia:real val="6.5757005311865475"/>
+      </dia:attribute>
+      <dia:attribute name="elem_height">
+        <dia:real val="1.7459494936611664"/>
+      </dia:attribute>
+      <dia:attribute name="line_width">
+        <dia:real val="0.059999999999999998"/>
+      </dia:attribute>
+      <dia:attribute name="line_colour">
+        <dia:color val="#000000"/>
+      </dia:attribute>
+      <dia:attribute name="fill_colour">
+        <dia:color val="#ffffff"/>
+      </dia:attribute>
+      <dia:attribute name="show_background">
+        <dia:boolean val="true"/>
+      </dia:attribute>
+      <dia:attribute name="line_style">
+        <dia:enum val="0"/>
+        <dia:real val="1"/>
+      </dia:attribute>
+      <dia:attribute name="text">
+        <dia:composite type="text">
+          <dia:attribute name="string">
+            <dia:string>#Document retrieved from URL.#</dia:string>
+          </dia:attribute>
+          <dia:attribute name="font">
+            <dia:font family="sans" style="0" name="Helvetica"/>
+          </dia:attribute>
+          <dia:attribute name="height">
+            <dia:real val="0.47999999999999998"/>
+          </dia:attribute>
+          <dia:attribute name="pos">
+            <dia:point val="-2.71215,6.70855"/>
+          </dia:attribute>
+          <dia:attribute name="color">
+            <dia:color val="#000000"/>
+          </dia:attribute>
+          <dia:attribute name="alignment">
+            <dia:enum val="1"/>
+          </dia:attribute>
+        </dia:composite>
+      </dia:attribute>
+      <dia:attribute name="flip_horizontal">
+        <dia:boolean val="false"/>
+      </dia:attribute>
+      <dia:attribute name="flip_vertical">
+        <dia:boolean val="false"/>
+      </dia:attribute>
+    </dia:object>
+    <dia:object type="Standard - Line" version="0" id="O6">
+      <dia:attribute name="obj_pos">
+        <dia:point val="0.575701,6.74826"/>
+      </dia:attribute>
+      <dia:attribute name="obj_bb">
+        <dia:rectangle val="0.540995,6.00228;2.11541,6.99772"/>
+      </dia:attribute>
+      <dia:attribute name="conn_endpoints">
+        <dia:point val="0.575701,6.74826"/>
+        <dia:point val="2,6.5"/>
+      </dia:attribute>
+      <dia:attribute name="numcp">
+        <dia:int val="1"/>
+      </dia:attribute>
+      <dia:attribute name="line_width">
+        <dia:real val="0.059999999999999998"/>
+      </dia:attribute>
+      <dia:attribute name="end_arrow">
+        <dia:enum val="22"/>
+      </dia:attribute>
+      <dia:attribute name="end_arrow_length">
+        <dia:real val="0.5"/>
+      </dia:attribute>
+      <dia:attribute name="end_arrow_width">
+        <dia:real val="0.5"/>
+      </dia:attribute>
+      <dia:connections>
+        <dia:connection handle="0" to="O5" connection="10"/>
+        <dia:connection handle="1" to="O0" connection="12"/>
+      </dia:connections>
+    </dia:object>
+    <dia:object type="Standard - Line" version="0" id="O7">
+      <dia:attribute name="obj_pos">
+        <dia:point val="11,6.5"/>
+      </dia:attribute>
+      <dia:attribute name="obj_bb">
+        <dia:rectangle val="10.97,6;12.03,7"/>
+      </dia:attribute>
+      <dia:attribute name="conn_endpoints">
+        <dia:point val="11,6.5"/>
+        <dia:point val="12,6.5"/>
+      </dia:attribute>
+      <dia:attribute name="numcp">
+        <dia:int val="1"/>
+      </dia:attribute>
+      <dia:attribute name="line_width">
+        <dia:real val="0.059999999999999998"/>
+      </dia:attribute>
+      <dia:attribute name="end_arrow">
+        <dia:enum val="22"/>
+      </dia:attribute>
+      <dia:attribute name="end_arrow_length">
+        <dia:real val="0.5"/>
+      </dia:attribute>
+      <dia:attribute name="end_arrow_width">
+        <dia:real val="0.5"/>
+      </dia:attribute>
+      <dia:connections>
+        <dia:connection handle="0" to="O0" connection="4"/>
+        <dia:connection handle="1" to="O9" connection="12"/>
+      </dia:connections>
+    </dia:object>
+    <dia:object type="Standard - Text" version="0" id="O8">
+      <dia:attribute name="obj_pos">
+        <dia:point val="11.5,6.5"/>
+      </dia:attribute>
+      <dia:attribute name="obj_bb">
+        <dia:rectangle val="11.0242,6.175;11.5,6.73781"/>
+      </dia:attribute>
+      <dia:attribute name="text">
+        <dia:composite type="text">
+          <dia:attribute name="string">
+            <dia:string>#No#</dia:string>
+          </dia:attribute>
+          <dia:attribute name="font">
+            <dia:font family="sans" style="0" name="Helvetica"/>
+          </dia:attribute>
+          <dia:attribute name="height">
+            <dia:real val="0.47999999999999998"/>
+          </dia:attribute>
+          <dia:attribute name="pos">
+            <dia:point val="11.5,6.5"/>
+          </dia:attribute>
+          <dia:attribute name="color">
+            <dia:color val="#000000"/>
+          </dia:attribute>
+          <dia:attribute name="alignment">
+            <dia:enum val="2"/>
+          </dia:attribute>
+        </dia:composite>
+      </dia:attribute>
+      <dia:connections>
+        <dia:connection handle="0" to="O7" connection="0"/>
+      </dia:connections>
+    </dia:object>
+    <dia:object type="Flowchart - Diamond" version="0" id="O9">
+      <dia:attribute name="obj_pos">
+        <dia:point val="12,2"/>
+      </dia:attribute>
+      <dia:attribute name="obj_bb">
+        <dia:rectangle val="11.97,1.97;21.03,11.03"/>
+      </dia:attribute>
+      <dia:attribute name="elem_corner">
+        <dia:point val="12,2"/>
+      </dia:attribute>
+      <dia:attribute name="elem_width">
+        <dia:real val="9"/>
+      </dia:attribute>
+      <dia:attribute name="elem_height">
+        <dia:real val="9"/>
+      </dia:attribute>
+      <dia:attribute name="border_width">
+        <dia:real val="0.059999999999999998"/>
+      </dia:attribute>
+      <dia:attribute name="show_background">
+        <dia:boolean val="true"/>
+      </dia:attribute>
+      <dia:attribute name="padding">
+        <dia:real val="0.35355339059327379"/>
+      </dia:attribute>
+      <dia:attribute name="text">
+        <dia:composite type="text">
+          <dia:attribute name="string">
+            <dia:string>#Is a "X-YADIS-Location"
+header present?#</dia:string>
+          </dia:attribute>
+          <dia:attribute name="font">
+            <dia:font family="sans" style="0" name="Helvetica"/>
+          </dia:attribute>
+          <dia:attribute name="height">
+            <dia:real val="0.47999999999999998"/>
+          </dia:attribute>
+          <dia:attribute name="pos">
+            <dia:point val="16.5,6.345"/>
+          </dia:attribute>
+          <dia:attribute name="color">
+            <dia:color val="#000000"/>
+          </dia:attribute>
+          <dia:attribute name="alignment">
+            <dia:enum val="1"/>
+          </dia:attribute>
+        </dia:composite>
+      </dia:attribute>
+    </dia:object>
+    <dia:object type="Flowchart - Terminal" version="0" id="O10">
+      <dia:attribute name="obj_pos">
+        <dia:point val="25,0"/>
+      </dia:attribute>
+      <dia:attribute name="obj_bb">
+        <dia:rectangle val="24.97,-0.03;27.2201,1.27711"/>
+      </dia:attribute>
+      <dia:attribute name="elem_corner">
+        <dia:point val="25,0"/>
+      </dia:attribute>
+      <dia:attribute name="elem_width">
+        <dia:real val="2.1901132967798214"/>
+      </dia:attribute>
+      <dia:attribute name="elem_height">
+        <dia:real val="1.2471067811865475"/>
+      </dia:attribute>
+      <dia:attribute name="line_width">
+        <dia:real val="0.059999999999999998"/>
+      </dia:attribute>
+      <dia:attribute name="line_colour">
+        <dia:color val="#000000"/>
+      </dia:attribute>
+      <dia:attribute name="fill_colour">
+        <dia:color val="#ffffff"/>
+      </dia:attribute>
+      <dia:attribute name="show_background">
+        <dia:boolean val="true"/>
+      </dia:attribute>
+      <dia:attribute name="line_style">
+        <dia:enum val="0"/>
+        <dia:real val="1"/>
+      </dia:attribute>
+      <dia:attribute name="text">
+        <dia:composite type="text">
+          <dia:attribute name="string">
+            <dia:string>#Die.#</dia:string>
+          </dia:attribute>
+          <dia:attribute name="font">
+            <dia:font family="sans" style="0" name="Helvetica"/>
+          </dia:attribute>
+          <dia:attribute name="height">
+            <dia:real val="0.47999999999999998"/>
+          </dia:attribute>
+          <dia:attribute name="pos">
+            <dia:point val="26.0951,0.708553"/>
+          </dia:attribute>
+          <dia:attribute name="color">
+            <dia:color val="#000000"/>
+          </dia:attribute>
+          <dia:attribute name="alignment">
+            <dia:enum val="1"/>
+          </dia:attribute>
+        </dia:composite>
+      </dia:attribute>
+      <dia:attribute name="flip_horizontal">
+        <dia:boolean val="false"/>
+      </dia:attribute>
+      <dia:attribute name="flip_vertical">
+        <dia:boolean val="false"/>
+      </dia:attribute>
+    </dia:object>
+    <dia:object type="Standard - Text" version="0" id="O11">
+      <dia:attribute name="obj_pos">
+        <dia:point val="22,6.5"/>
+      </dia:attribute>
+      <dia:attribute name="obj_bb">
+        <dia:rectangle val="21.5242,6.175;22,6.73781"/>
+      </dia:attribute>
+      <dia:attribute name="text">
+        <dia:composite type="text">
+          <dia:attribute name="string">
+            <dia:string>#No#</dia:string>
+          </dia:attribute>
+          <dia:attribute name="font">
+            <dia:font family="sans" style="0" name="Helvetica"/>
+          </dia:attribute>
+          <dia:attribute name="height">
+            <dia:real val="0.47999999999999998"/>
+          </dia:attribute>
+          <dia:attribute name="pos">
+            <dia:point val="22,6.5"/>
+          </dia:attribute>
+          <dia:attribute name="color">
+            <dia:color val="#000000"/>
+          </dia:attribute>
+          <dia:attribute name="alignment">
+            <dia:enum val="2"/>
+          </dia:attribute>
+        </dia:composite>
+      </dia:attribute>
+      <dia:connections>
+        <dia:connection handle="0" to="O19" connection="0"/>
+      </dia:connections>
+    </dia:object>
+    <dia:object type="Flowchart - Document" version="0" id="O12">
+      <dia:attribute name="obj_pos">
+        <dia:point val="13,13"/>
+      </dia:attribute>
+      <dia:attribute name="obj_bb">
+        <dia:rectangle val="12.97,12.97;17.2596,15"/>
+      </dia:attribute>
+      <dia:attribute name="elem_corner">
+        <dia:point val="13,13"/>
+      </dia:attribute>
+      <dia:attribute name="elem_width">
+        <dia:real val="4.2296067811865479"/>
+      </dia:attribute>
+      <dia:attribute name="elem_height">
+        <dia:real val="2"/>
+      </dia:attribute>
+      <dia:attribute name="line_width">
+        <dia:real val="0.059999999999999998"/>
+      </dia:attribute>
+      <dia:attribute name="line_colour">
+        <dia:color val="#000000"/>
+      </dia:attribute>
+      <dia:attribute name="fill_colour">
+        <dia:color val="#ffffff"/>
+      </dia:attribute>
+      <dia:attribute name="show_background">
+        <dia:boolean val="true"/>
+      </dia:attribute>
+      <dia:attribute name="line_style">
+        <dia:enum val="0"/>
+        <dia:real val="1"/>
+      </dia:attribute>
+      <dia:attribute name="text">
+        <dia:composite type="text">
+          <dia:attribute name="string">
+            <dia:string>#Retrieve document.#</dia:string>
+          </dia:attribute>
+          <dia:attribute name="font">
+            <dia:font family="sans" style="0" name="Helvetica"/>
+          </dia:attribute>
+          <dia:attribute name="height">
+            <dia:real val="0.47999999999999998"/>
+          </dia:attribute>
+          <dia:attribute name="pos">
+            <dia:point val="15.1148,13.7993"/>
+          </dia:attribute>
+          <dia:attribute name="color">
+            <dia:color val="#000000"/>
+          </dia:attribute>
+          <dia:attribute name="alignment">
+            <dia:enum val="1"/>
+          </dia:attribute>
+        </dia:composite>
+      </dia:attribute>
+      <dia:attribute name="flip_horizontal">
+        <dia:boolean val="false"/>
+      </dia:attribute>
+      <dia:attribute name="flip_vertical">
+        <dia:boolean val="false"/>
+      </dia:attribute>
+    </dia:object>
+    <dia:object type="Standard - Line" version="0" id="O13">
+      <dia:attribute name="obj_pos">
+        <dia:point val="16.5,11"/>
+      </dia:attribute>
+      <dia:attribute name="obj_bb">
+        <dia:rectangle val="14.6867,10.9583;16.5417,13.3093"/>
+      </dia:attribute>
+      <dia:attribute name="conn_endpoints">
+        <dia:point val="16.5,11"/>
+        <dia:point val="15.1148,13"/>
+      </dia:attribute>
+      <dia:attribute name="numcp">
+        <dia:int val="1"/>
+      </dia:attribute>
+      <dia:attribute name="line_width">
+        <dia:real val="0.059999999999999998"/>
+      </dia:attribute>
+      <dia:attribute name="end_arrow">
+        <dia:enum val="22"/>
+      </dia:attribute>
+      <dia:attribute name="end_arrow_length">
+        <dia:real val="0.5"/>
+      </dia:attribute>
+      <dia:attribute name="end_arrow_width">
+        <dia:real val="0.5"/>
+      </dia:attribute>
+      <dia:connections>
+        <dia:connection handle="0" to="O9" connection="8"/>
+        <dia:connection handle="1" to="O12" connection="2"/>
+      </dia:connections>
+    </dia:object>
+    <dia:object type="Flowchart - Box" version="0" id="O14">
+      <dia:attribute name="obj_pos">
+        <dia:point val="4,13"/>
+      </dia:attribute>
+      <dia:attribute name="obj_bb">
+        <dia:rectangle val="3.97,12.97;10.1302,15.03"/>
+      </dia:attribute>
+      <dia:attribute name="elem_corner">
+        <dia:point val="4,13"/>
+      </dia:attribute>
+      <dia:attribute name="elem_width">
+        <dia:real val="6.1002107943596826"/>
+      </dia:attribute>
+      <dia:attribute name="elem_height">
+        <dia:real val="2"/>
+      </dia:attribute>
+      <dia:attribute name="border_width">
+        <dia:real val="0.059999999999999998"/>
+      </dia:attribute>
+      <dia:attribute name="show_background">
+        <dia:boolean val="true"/>
+      </dia:attribute>
+      <dia:attribute name="padding">
+        <dia:real val="0.5"/>
+      </dia:attribute>
+      <dia:attribute name="text">
+        <dia:composite type="text">
+          <dia:attribute name="string">
+            <dia:string>#Parse XRD for Services.#</dia:string>
+          </dia:attribute>
+          <dia:attribute name="font">
+            <dia:font family="sans" style="0" name="Helvetica"/>
+          </dia:attribute>
+          <dia:attribute name="height">
+            <dia:real val="0.47999999999999998"/>
+          </dia:attribute>
+          <dia:attribute name="pos">
+            <dia:point val="7.05011,14.085"/>
+          </dia:attribute>
+          <dia:attribute name="color">
+            <dia:color val="#000000"/>
+          </dia:attribute>
+          <dia:attribute name="alignment">
+            <dia:enum val="1"/>
+          </dia:attribute>
+        </dia:composite>
+      </dia:attribute>
+    </dia:object>
+    <dia:object type="Standard - Line" version="0" id="O15">
+      <dia:attribute name="obj_pos">
+        <dia:point val="6.5,11"/>
+      </dia:attribute>
+      <dia:attribute name="obj_bb">
+        <dia:rectangle val="6.46312,10.9631;7.54016,13.1615"/>
+      </dia:attribute>
+      <dia:attribute name="conn_endpoints">
+        <dia:point val="6.5,11"/>
+        <dia:point val="7.05011,13"/>
+      </dia:attribute>
+      <dia:attribute name="numcp">
+        <dia:int val="1"/>
+      </dia:attribute>
+      <dia:attribute name="line_width">
+        <dia:real val="0.059999999999999998"/>
+      </dia:attribute>
+      <dia:attribute name="end_arrow">
+        <dia:enum val="22"/>
+      </dia:attribute>
+      <dia:attribute name="end_arrow_length">
+        <dia:real val="0.5"/>
+      </dia:attribute>
+      <dia:attribute name="end_arrow_width">
+        <dia:real val="0.5"/>
+      </dia:attribute>
+      <dia:connections>
+        <dia:connection handle="0" to="O0" connection="8"/>
+        <dia:connection handle="1" to="O14" connection="2"/>
+      </dia:connections>
+    </dia:object>
+    <dia:object type="Standard - Text" version="0" id="O16">
+      <dia:attribute name="obj_pos">
+        <dia:point val="6.77505,12"/>
+      </dia:attribute>
+      <dia:attribute name="obj_bb">
+        <dia:rectangle val="6.77505,11.675;7.38677,12.2378"/>
+      </dia:attribute>
+      <dia:attribute name="text">
+        <dia:composite type="text">
+          <dia:attribute name="string">
+            <dia:string>#Yes#</dia:string>
+          </dia:attribute>
+          <dia:attribute name="font">
+            <dia:font family="sans" style="0" name="Helvetica"/>
+          </dia:attribute>
+          <dia:attribute name="height">
+            <dia:real val="0.47999999999999998"/>
+          </dia:attribute>
+          <dia:attribute name="pos">
+            <dia:point val="6.77505,12"/>
+          </dia:attribute>
+          <dia:attribute name="color">
+            <dia:color val="#000000"/>
+          </dia:attribute>
+          <dia:attribute name="alignment">
+            <dia:enum val="0"/>
+          </dia:attribute>
+        </dia:composite>
+      </dia:attribute>
+      <dia:connections>
+        <dia:connection handle="0" to="O15" connection="0"/>
+      </dia:connections>
+    </dia:object>
+    <dia:object type="Standard - Line" version="0" id="O17">
+      <dia:attribute name="obj_pos">
+        <dia:point val="13,13.8571"/>
+      </dia:attribute>
+      <dia:attribute name="obj_bb">
+        <dia:rectangle val="10.0456,13.4991;13.0314,14.5009"/>
+      </dia:attribute>
+      <dia:attribute name="conn_endpoints">
+        <dia:point val="13,13.8571"/>
+        <dia:point val="10.1002,14"/>
+      </dia:attribute>
+      <dia:attribute name="numcp">
+        <dia:int val="1"/>
+      </dia:attribute>
+      <dia:attribute name="line_width">
+        <dia:real val="0.059999999999999998"/>
+      </dia:attribute>
+      <dia:attribute name="end_arrow">
+        <dia:enum val="22"/>
+      </dia:attribute>
+      <dia:attribute name="end_arrow_length">
+        <dia:real val="0.5"/>
+      </dia:attribute>
+      <dia:attribute name="end_arrow_width">
+        <dia:real val="0.5"/>
+      </dia:attribute>
+      <dia:connections>
+        <dia:connection handle="0" to="O12" connection="6"/>
+        <dia:connection handle="1" to="O14" connection="8"/>
+      </dia:connections>
+    </dia:object>
+    <dia:object type="Standard - Text" version="0" id="O18">
+      <dia:attribute name="obj_pos">
+        <dia:point val="15.8074,12"/>
+      </dia:attribute>
+      <dia:attribute name="obj_bb">
+        <dia:rectangle val="15.8074,11.675;16.4191,12.2378"/>
+      </dia:attribute>
+      <dia:attribute name="text">
+        <dia:composite type="text">
+          <dia:attribute name="string">
+            <dia:string>#Yes#</dia:string>
+          </dia:attribute>
+          <dia:attribute name="font">
+            <dia:font family="sans" style="0" name="Helvetica"/>
+          </dia:attribute>
+          <dia:attribute name="height">
+            <dia:real val="0.47999999999999998"/>
+          </dia:attribute>
+          <dia:attribute name="pos">
+            <dia:point val="15.8074,12"/>
+          </dia:attribute>
+          <dia:attribute name="color">
+            <dia:color val="#000000"/>
+          </dia:attribute>
+          <dia:attribute name="alignment">
+            <dia:enum val="0"/>
+          </dia:attribute>
+        </dia:composite>
+      </dia:attribute>
+      <dia:connections>
+        <dia:connection handle="0" to="O13" connection="0"/>
+      </dia:connections>
+    </dia:object>
+    <dia:object type="Standard - Line" version="0" id="O19">
+      <dia:attribute name="obj_pos">
+        <dia:point val="21,6.5"/>
+      </dia:attribute>
+      <dia:attribute name="obj_bb">
+        <dia:rectangle val="20.97,6;23.03,7"/>
+      </dia:attribute>
+      <dia:attribute name="conn_endpoints">
+        <dia:point val="21,6.5"/>
+        <dia:point val="23,6.5"/>
+      </dia:attribute>
+      <dia:attribute name="numcp">
+        <dia:int val="1"/>
+      </dia:attribute>
+      <dia:attribute name="line_width">
+        <dia:real val="0.059999999999999998"/>
+      </dia:attribute>
+      <dia:attribute name="end_arrow">
+        <dia:enum val="22"/>
+      </dia:attribute>
+      <dia:attribute name="end_arrow_length">
+        <dia:real val="0.5"/>
+      </dia:attribute>
+      <dia:attribute name="end_arrow_width">
+        <dia:real val="0.5"/>
+      </dia:attribute>
+      <dia:connections>
+        <dia:connection handle="0" to="O9" connection="4"/>
+        <dia:connection handle="1" to="O20" connection="12"/>
+      </dia:connections>
+    </dia:object>
+    <dia:object type="Flowchart - Diamond" version="0" id="O20">
+      <dia:attribute name="obj_pos">
+        <dia:point val="23,2"/>
+      </dia:attribute>
+      <dia:attribute name="obj_bb">
+        <dia:rectangle val="22.97,1.97;32.03,11.03"/>
+      </dia:attribute>
+      <dia:attribute name="elem_corner">
+        <dia:point val="23,2"/>
+      </dia:attribute>
+      <dia:attribute name="elem_width">
+        <dia:real val="9"/>
+      </dia:attribute>
+      <dia:attribute name="elem_height">
+        <dia:real val="9"/>
+      </dia:attribute>
+      <dia:attribute name="border_width">
+        <dia:real val="0.059999999999999998"/>
+      </dia:attribute>
+      <dia:attribute name="show_background">
+        <dia:boolean val="true"/>
+      </dia:attribute>
+      <dia:attribute name="padding">
+        <dia:real val="0.35355339059327379"/>
+      </dia:attribute>
+      <dia:attribute name="text">
+        <dia:composite type="text">
+          <dia:attribute name="string">
+            <dia:string>#Does the document parse
+as HTML and have a &lt;meta
+http-equiv="X-YADIS-Location"
+content="..."&gt; tag?#</dia:string>
+          </dia:attribute>
+          <dia:attribute name="font">
+            <dia:font family="sans" style="0" name="Helvetica"/>
+          </dia:attribute>
+          <dia:attribute name="height">
+            <dia:real val="0.47999999999999998"/>
+          </dia:attribute>
+          <dia:attribute name="pos">
+            <dia:point val="27.5,5.865"/>
+          </dia:attribute>
+          <dia:attribute name="color">
+            <dia:color val="#000000"/>
+          </dia:attribute>
+          <dia:attribute name="alignment">
+            <dia:enum val="1"/>
+          </dia:attribute>
+        </dia:composite>
+      </dia:attribute>
+    </dia:object>
+    <dia:object type="Standard - Line" version="0" id="O21">
+      <dia:attribute name="obj_pos">
+        <dia:point val="27.5,2"/>
+      </dia:attribute>
+      <dia:attribute name="obj_bb">
+        <dia:rectangle val="25.8324,0.792229;27.5406,2.04061"/>
+      </dia:attribute>
+      <dia:attribute name="conn_endpoints">
+        <dia:point val="27.5,2"/>
+        <dia:point val="26.0951,1.24711"/>
+      </dia:attribute>
+      <dia:attribute name="numcp">
+        <dia:int val="1"/>
+      </dia:attribute>
+      <dia:attribute name="line_width">
+        <dia:real val="0.059999999999999998"/>
+      </dia:attribute>
+      <dia:attribute name="end_arrow">
+        <dia:enum val="22"/>
+      </dia:attribute>
+      <dia:attribute name="end_arrow_length">
+        <dia:real val="0.5"/>
+      </dia:attribute>
+      <dia:attribute name="end_arrow_width">
+        <dia:real val="0.5"/>
+      </dia:attribute>
+      <dia:connections>
+        <dia:connection handle="0" to="O20" connection="0"/>
+        <dia:connection handle="1" to="O10" connection="14"/>
+      </dia:connections>
+    </dia:object>
+    <dia:object type="Standard - Text" version="0" id="O22">
+      <dia:attribute name="obj_pos">
+        <dia:point val="26.7975,1.62355"/>
+      </dia:attribute>
+      <dia:attribute name="obj_bb">
+        <dia:rectangle val="26.3217,1.29855;26.7975,1.86137"/>
+      </dia:attribute>
+      <dia:attribute name="text">
+        <dia:composite type="text">
+          <dia:attribute name="string">
+            <dia:string>#No#</dia:string>
+          </dia:attribute>
+          <dia:attribute name="font">
+            <dia:font family="sans" style="0" name="Helvetica"/>
+          </dia:attribute>
+          <dia:attribute name="height">
+            <dia:real val="0.47999999999999998"/>
+          </dia:attribute>
+          <dia:attribute name="pos">
+            <dia:point val="26.7975,1.62355"/>
+          </dia:attribute>
+          <dia:attribute name="color">
+            <dia:color val="#000000"/>
+          </dia:attribute>
+          <dia:attribute name="alignment">
+            <dia:enum val="2"/>
+          </dia:attribute>
+        </dia:composite>
+      </dia:attribute>
+      <dia:connections>
+        <dia:connection handle="0" to="O21" connection="0"/>
+      </dia:connections>
+    </dia:object>
+    <dia:object type="Standard - Line" version="0" id="O23">
+      <dia:attribute name="obj_pos">
+        <dia:point val="27.5,11"/>
+      </dia:attribute>
+      <dia:attribute name="obj_bb">
+        <dia:rectangle val="17.0667,10.9631;27.5369,14.3469"/>
+      </dia:attribute>
+      <dia:attribute name="conn_endpoints">
+        <dia:point val="27.5,11"/>
+        <dia:point val="17.2296,13.8571"/>
+      </dia:attribute>
+      <dia:attribute name="numcp">
+        <dia:int val="1"/>
+      </dia:attribute>
+      <dia:attribute name="line_width">
+        <dia:real val="0.059999999999999998"/>
+      </dia:attribute>
+      <dia:attribute name="end_arrow">
+        <dia:enum val="22"/>
+      </dia:attribute>
+      <dia:attribute name="end_arrow_length">
+        <dia:real val="0.5"/>
+      </dia:attribute>
+      <dia:attribute name="end_arrow_width">
+        <dia:real val="0.5"/>
+      </dia:attribute>
+      <dia:connections>
+        <dia:connection handle="0" to="O20" connection="8"/>
+        <dia:connection handle="1" to="O12" connection="10"/>
+      </dia:connections>
+    </dia:object>
+    <dia:object type="Standard - Text" version="0" id="O24">
+      <dia:attribute name="obj_pos">
+        <dia:point val="22.3648,12.4286"/>
+      </dia:attribute>
+      <dia:attribute name="obj_bb">
+        <dia:rectangle val="22.3648,12.1036;22.9765,12.6664"/>
+      </dia:attribute>
+      <dia:attribute name="text">
+        <dia:composite type="text">
+          <dia:attribute name="string">
+            <dia:string>#Yes#</dia:string>
+          </dia:attribute>
+          <dia:attribute name="font">
+            <dia:font family="sans" style="0" name="Helvetica"/>
+          </dia:attribute>
+          <dia:attribute name="height">
+            <dia:real val="0.47999999999999998"/>
+          </dia:attribute>
+          <dia:attribute name="pos">
+            <dia:point val="22.3648,12.4286"/>
+          </dia:attribute>
+          <dia:attribute name="color">
+            <dia:color val="#000000"/>
+          </dia:attribute>
+          <dia:attribute name="alignment">
+            <dia:enum val="0"/>
+          </dia:attribute>
+        </dia:composite>
+      </dia:attribute>
+      <dia:connections>
+        <dia:connection handle="0" to="O23" connection="0"/>
+      </dia:connections>
+    </dia:object>
+  </dia:layer>
+</dia:diagram>

Added: incubator/heraldry/libraries/python/yadis/trunk/doc/sample-xrd.xml
URL: http://svn.apache.org/viewvc/incubator/heraldry/libraries/python/yadis/trunk/doc/sample-xrd.xml?view=auto&rev=463036
==============================================================================
--- incubator/heraldry/libraries/python/yadis/trunk/doc/sample-xrd.xml (added)
+++ incubator/heraldry/libraries/python/yadis/trunk/doc/sample-xrd.xml Wed Oct 11 16:09:11 2006
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xrds:XRDS
+    xmlns:xrds="xri://$xrds"
+    xmlns:openid="http://openid.net/xmlns/1.0"
+    xmlns:typekey="http://typekey.com/xmlns/1.0"
+    xmlns="xri://$xrd*($v*2.0)">
+  <XRD>
+
+    <Service priority="0">
+      <Type>http://openid.net/signon/1.0</Type>
+      <URI>http://www.myopenid.com/server</URI>
+      <openid:Delegate>http://josh.myopenid.com/</openid:Delegate>
+    </Service>
+
+    <Service priority="5">
+      <Type>http://openid.net/signon/1.0</Type>
+      <URI>http://www.schtuff.com/openid</URI>
+      <openid:Delegate>http://users.schtuff.com/josh</openid:Delegate>
+    </Service>
+
+    <Service priority="10">
+      <Type>http://openid.net/signon/1.0</Type>
+      <URI>http://www.livejournal.com/openid/server.bml</URI>
+      <openid:Delegate>http://www.livejournal.com/users/nedthealpaca/</openid:Delegate>
+    </Service>
+
+    <Service priority="15">
+      <Type>http://typekey.com/services/1.0</Type>
+      <typekey:MemberName>joshhoyt</typekey:MemberName>
+    </Service>
+
+    <Service priority="20">
+      <Type>http://lid.netmesh.us/services/2.0</Type>
+      <URI>http://mylid.net/josh</URI>
+    </Service>
+
+  </XRD>
+</xrds:XRDS>

Added: incubator/heraldry/libraries/python/yadis/trunk/doc/spec-rfc.txt
URL: http://svn.apache.org/viewvc/incubator/heraldry/libraries/python/yadis/trunk/doc/spec-rfc.txt?view=auto&rev=463036
==============================================================================
--- incubator/heraldry/libraries/python/yadis/trunk/doc/spec-rfc.txt (added)
+++ incubator/heraldry/libraries/python/yadis/trunk/doc/spec-rfc.txt Wed Oct 11 16:09:11 2006
@@ -0,0 +1,197 @@
+.. -*- rst -*-
+
+YADIS Protocol
+==============
+
+:Date: 13 January 2006
+
+.. contents::
+.. sectnum::
+
+Protocol Overview
+-----------------
+
+The YADIS [#]_ protocol enables discovery of service definitions from
+an ``http://`` or ``https://`` URL. The protocol consists of
+performing HTTP requests to obtain a YADIS Resource Descriptor.
+
+
+Terminology
+-----------
+
+YADIS URL
+  an ``http://`` or ``https://`` URL that supports the YADIS protocol
+
+
+YADIS Resource Descriptor
+  the document that results from performing the YADIS protocol
+
+
+Relying Party
+  the entity using the YADIS protocol to discover what services are
+  available for a YADIS URL
+
+
+Agent
+  the software acting on behalf of the relying party
+
+
+Specification
+-------------
+
+The protocol starts with an HTTP [#]_ request for the YADIS URL. The
+response must contain either a URL for the YADIS resource descriptor
+or the resource descriptor itself. If it does not, then the URL is not
+a YADIS URL.
+
+The YADIS protocol uses HTTP or HTTPS requests as necessary for the
+URL it is working with. Whenever the agent is instructed to make an
+HTTP request, HTTPS is implied for ``https://`` URLs. When using
+HTTP to retrieve a document, redirects that are encountered should be
+followed, up to a reasonable maximum. A simple guideline is a maximum
+of 10 redirects, similar to most web browsers. The final HTTP
+response is only successful if it has a 200 response code.
+
+
+Requesting the Document
+.......................
+
+The agent performs an HTTP ``GET`` request for the YADIS URL. The
+agent may use server-driven content negotiation [#]_ to encourage the server to respond
+immediately with a YADIS resource descriptor. If the agent is using
+content negotiation, it should request the ``application/xrds+xml``
+MIME [#]_ type. Using content negotiation reduces the number of HTTP
+requests if used with a server that supports it.
+
+The agent may perform an HTTP ``HEAD`` request if it expects the
+server response to include an ``X-YADIS-Location`` HTTP header. If the
+header is not present, the protocol must be restarted with an HTTP
+``GET`` request.
+
+
+Handling the Response
+.....................
+
+If the HTTP response contains an ``X-YADIS-Location`` header, the
+header value is the location of the `YADIS resource descriptor`_. The
+header name is not case sensitive.
+
+If the header is not present and the MIME type of the response
+indicates an HTML document [*]_, the agent must parse the document. The
+document must contain a ``<meta>`` tag [#]_ with an ``http-equiv``
+attribute whose value, ignoring case, is ``X-YADIS-Location``. The tag
+must have a ``content`` attribute whose value is the location of the
+YADIS resource descriptor. The agent must only accept ``<meta>`` tags
+that occur inside of the ``<head>`` element of the HTML document.
+
+If a location was found in either of the two previous cases, the
+location must be an absolute HTTP URL. The agent performs a HTTP
+``GET`` request for that URL. If the request succeeds, the content
+returned must be a YADIS resource descriptor, regardless of the
+declared MIME type of the response. After retrieving the resource
+descriptor, the YADIS protocol is complete.
+
+If no ``X-YADIS-Location`` header is included in the server's response
+to the request for the YADIS URL and the MIME type of the response
+doesn't indicate HTML, the MIME type must be ``application/xrds+xml``.
+If it is, the server's response is the YADIS resource descriptor.
+Otherwise, the initial URL is not a YADIS URL.
+
+.. [*] Any version of HTML, including XHTML, is acceptable.
+
+
+YADIS Resource Descriptor
+-------------------------
+
+The YADIS resource descriptor is a document that contains service
+descriptions associated with the YADIS URL. It uses the Extensible
+Resource Descriptor (XRD) format developed by the XRI Technical
+Committee [#]_ of the OASIS group [#]_ as part of XRI [#]_
+resolution. This section includes a short description of the XRD
+format to supplement the official specification, which is in the XRI
+Resolution 2.0 specification [#]_. An XML schema for XRD documents
+can be found in Appendix A of that specification.
+
+The top-level element of an XRD document is the ``<XRDS>``
+element. This element may contain multiple ``<XRD>`` elements. If
+multiple ``<XRD>`` elements are present, the last one should be
+used. If no ``<XRD>`` element is present, it should be treated
+the same as if no services are declared.
+
+``<XRD>`` elements contain ``<Service>`` elements that describe
+services. Each ``<Service>`` element should contain ``<Type>``
+elements that identify the type of that service. ``<Service>``
+elements may contain other elements to provide additional
+information. The meaning of those elements depends on the details of
+the service, and is beyond the scope of YADIS.
+
+A service that uses YADIS for discovery will have a definition. The
+definition specifies which ``<Service>`` elements are relevant and how
+the information in those elements is used. It should include a URI
+that indicates its type. A ``<Type>`` element for a relevant
+``<Service>`` element should have that URI as its contents. The
+definition may allow information that cannot be encoded by the XRD
+schema's defined tags. If it does, it should specify a schema for
+additional tags.
+
+Example Descriptor
+..................
+::
+
+  <?xml version="1.0" encoding="UTF-8"?>
+  <xrds:XRDS
+      xmlns:xrds="xri://$xrds"
+      xmlns="xri://$xrd*($v*2.0)"
+      xmlns:openid="http://openid.net/xmlns/1.0">
+    <XRD>
+
+      <Service priority="20">
+        <Type>http://openid.net/signon/1.0</Type>
+        <URI>http://www.myopenid.com/server</URI>
+        <openid:Delegate>http://smoker.myopenid.com/</openid:Delegate>
+      </Service>
+
+      <Service priority="30">
+        <Type>http://openid.net/signon/1.0</Type>
+        <URI>http://www.livejournal.com/openid/server.bml</URI>
+        <openid:Delegate>http://frank.livejournal.com/</openid:Delegate>
+      </Service>
+
+      <Service>
+        <Type>http://lid.netmesh.org/sso/2.0b5</Type>
+        <Type>http://lid.netmesh.org/sso/1.0</Type>
+      </Service>
+
+    </XRD>
+  </xrds:XRDS>
+
+This example descriptor begins with an XML document declaration, then
+an ``<XRDS>`` element which contains namespace declarations for all
+the namespaces used in the document. The ``<XRDS>`` element contains
+one ``<XRD>`` element, which has the services declared in it.
+
+Two of the three ``<Service>`` elements have a ``priority``
+attribute. The optional ``priority`` attribute indicates a preference
+for a service. A relying party should use priorities to choose which
+service to use. The relying party should use the element with the
+lowest numerically valued ``priority`` attribute, if elements with
+that attribute are specified. If there are multiple elements with the
+same priority, the relying party should choose one at random. This
+allows load balancing between equivalent services. In the above
+example, relying parties wishing to use OpenID should try to use the
+myopenid.com server before the livejournal.com server.
+
+References
+----------
+
+.. [#] YADIS - http://yadis.org/
+.. [#] HTTP 1.1 - http://www.ietf.org/rfc/rfc2616.txt
+.. [#] Server-driven HTTP content negotiation in HTTP 1.1 - http://www.w3.org/Protocols/rfc2616/rfc2616-sec12.html
+.. [#] MIME - http://www.ietf.org/rfc/rfc2045.txt
+.. [#] HTML 4.01 ``<meta>`` tag - http://www.w3.org/TR/1999/REC-html401-19991224/struct/global.html#h-7.4.4
+.. [#]  Extensible Resource Identifier Technical Committee - http://www.oasis-open.org/committees/tc_home.php?wg_abbrev=xri
+.. [#] Organization for the Advancement of Structured Information Standards - http://www.oasis-open.org/
+.. [#] Extensible Resource Identifier - http://en.wikipedia.org/wiki/XRI
+.. [#] XRI Resolution 2.0 specification, working draft 9 - http://www.oasis-open.org/committees/download.php/15310/xri-resolution-V2.0-wd-09.pdf
+
+.. Working draft 10, editor's draft 3 (PDF) http://www.oasis-open.org/committees/download.php/16231/xri-resolution-V2.0-wd-10-ed-03.pdf

Added: incubator/heraldry/libraries/python/yadis/trunk/doc/what-is-yadis.txt
URL: http://svn.apache.org/viewvc/incubator/heraldry/libraries/python/yadis/trunk/doc/what-is-yadis.txt?view=auto&rev=463036
==============================================================================
--- incubator/heraldry/libraries/python/yadis/trunk/doc/what-is-yadis.txt (added)
+++ incubator/heraldry/libraries/python/yadis/trunk/doc/what-is-yadis.txt Wed Oct 11 16:09:11 2006
@@ -0,0 +1,86 @@
+What is YADIS?
+##############
+
+:Author: Josh Hoyt <josh@janrain.com>
+:Date: 30 November 2005
+
+YADIS stands for Yet Another Decentralized Identity Interoperability
+System. There is a loose understanding of what YADIS is trying to
+accomplish, based on the original specification and the discussion on
+the mailing list and wiki. This document attempts to boil down that
+consensus into a definition that can be used to evaluate proposals for
+implementing YADIS.
+
+This document attempts to describe what YADIS is as fully as possible
+without specifying any particular implementation.
+
+What is a digital identity system?
+==================================
+
+YADIS is an "Identity Interoperability System" for digital
+identities. To understand what a digital identity system does, it's
+necessary to define digital identity. From
+http://www.identitygang.org/Lexicon\:
+
+    [Digital identity is the] digital representation of a set of
+    claims made by one digital subject about itself or another digital
+    subject
+
+That makes a digital identity system a system for making claims about
+an entity. Given that definition, YADIS is a protocol that provides
+interoperability between services that make claims about an
+entity. YADIS works by tying a set of claims to a single global
+identifier representing the entity. The global identifier for YADIS is
+a URI.
+
+More precisely, YADIS is a protocol by which the owner of an URI can
+associate a certain set of digital identity services with that URI.
+Implementation of YADIS requires establishing a canonical form of an
+identity URI and then discovering the services associated with that
+URI and each service's identity-specific parameters.
+
+A party that relies on YADIS will use a set protocol to discover
+services for an identity URI. The relying party will treat that URI as
+the identifier for the entity controlling it.
+
+YADIS is fundamentally decentralized, because a digital identity
+service does not need to explicitly provide support for YADIS to be
+used with YADIS. In fact, like delegation in OpenID, there is no way
+that a digital identity service can prevent its use within YADIS.
+
+How can identity services use YADIS?
+====================================
+
+In order to use a service with YADIS, there must be a convention for
+representing, using, and possibly verifying the service's parameters
+as discovered from the identity URI. That convention can be developed
+by the owners of the service or it may be established separately.
+
+YADIS and TypeKey
+-----------------
+
+For example, TypeKey (http://typekey.com/) is a digital identity
+system that provides an API for relying parties to authenticate and
+retrieve profile information about TypeKey users. TypeKey does not use
+a URI as the identifier for its users. In order to use the API, the
+service needs to know the TypeKey identifier of the user.
+
+To use TypeKey to provide information for a YADIS identity, the
+results of the discovery process would indicate that TypeKey was a
+provider of information, and that the identity used a particular
+TypeKey identity. Concretely::
+
+  YADIS identity URI: http://slack.example.com/bob
+
+  Supported Services
+    TypeKey
+      Member Name: Bob Dobbs
+
+A relying party that supports YADIS and TypeKey uses YADIS to
+associate the member name "Bob Dobbs" with the URI
+"http://slack.example.com/bob". The relying party then asks the user to
+authenticate with TypeKey without needing to provide TypeKey with
+Bob's YADIS identity URI. Once the TypeKey authentication is complete,
+if TypeKey indicates that "Bob Dobbs" has authenticated, the relying
+party knows that this user is the user who controls the YADIS identity
+URI.

Added: incubator/heraldry/libraries/python/yadis/trunk/examples/apache/.htaccess
URL: http://svn.apache.org/viewvc/incubator/heraldry/libraries/python/yadis/trunk/examples/apache/.htaccess?view=auto&rev=463036
==============================================================================
--- incubator/heraldry/libraries/python/yadis/trunk/examples/apache/.htaccess (added)
+++ incubator/heraldry/libraries/python/yadis/trunk/examples/apache/.htaccess Wed Oct 11 16:09:11 2006
@@ -0,0 +1,55 @@
+# This file is a Apache configuration file for setting up a
+# YADIS-enabled identity URL.
+
+# This section enables the special header that makes a URL a YADIS
+# identity URL. If this header is present, the file is not required to
+# have any particular content or MIME type.
+<Files home.html>
+    # Add the X-YADIS-Location header to successful responses
+    # Replace the URL with the URL for your YADIS service discovery document.
+    Header onsuccess set X-YADIS-Location \
+      "http://openidenabled.com/yadis-test/apache/yadis.xml"
+</Files>
+
+# This section tells Apache what content-type to use for the YADIS
+# services document. In order for the content-negotiation optimization
+# to work, the Web server is required to return this specific
+# content-type for the YADIS services document.
+#
+# If you ever are hosting a YADIS services document, you should set
+# the content-type returned for the file to this value, regardless of
+# how the file is accessed.
+<Files yadis.xml>
+    # Make sure that Apache serves the YADIS services document as the
+    # correct content-type.
+    ForceType application/xrds+xml
+</Files>
+
+# This section is the first step to enabling content negotiation for
+# the identity URL. It tells Apache that this file is a type-map file,
+# which will be used to dispatch to the appropriate content based on
+# the form of the request.
+<Files identity>
+    # Tell apache that this file is a type-map that should be handled
+    # by mod_negotiation
+    SetHandler type-map
+</Files>
+
+# This section is only applicable when content negotiation is
+# enabled. It prevents direct requests for the content that is being
+# returned by the identity URL.
+#
+# Don't allow direct access to the .html file, so that there's no
+# confusion about which one is the idenity URL. This redirect means
+# that no matter which of the direct content URL or the desired
+# identity URL is entered, only the desired identity URL will be used
+# by YADIS consumers.
+RewriteEngine On
+
+# In order for this test to succeed, RewriteEngine must be turned On
+# in the site-wide apache configuration. Unless it is, the SCRIPT_URL
+# variable will not be set.
+RewriteCond "%{ENV:SCRIPT_URL}" "^/yadis-test/apache/home\.html$"
+
+# Redirect requests for the non-YADIS content to the identity URL.
+RewriteRule "^home\.html$" "/yadis-test/apache/identity" [R,L]

Added: incubator/heraldry/libraries/python/yadis/trunk/examples/apache/home.html
URL: http://svn.apache.org/viewvc/incubator/heraldry/libraries/python/yadis/trunk/examples/apache/home.html?view=auto&rev=463036
==============================================================================
--- incubator/heraldry/libraries/python/yadis/trunk/examples/apache/home.html (added)
+++ incubator/heraldry/libraries/python/yadis/trunk/examples/apache/home.html Wed Oct 11 16:09:11 2006
@@ -0,0 +1,16 @@
+<html>
+  <head>
+    <title>Example YADIS identity URL</title>
+  </head>
+  <body>
+    <h1>Example YADIS identity URL</h1>
+
+    <p>
+      This is example content for a YADIS identity URL that
+      was configured with Apache. For instructions on configuring
+      Apache to fully support the YADIS specification, see <a
+          href="http://openidenabled.com/yadis/configuring-a-yadis-url-using-only-apache"
+      >the documentation on openidenabled.com</a>.
+    </p>
+  </body>
+</html>
\ No newline at end of file

Added: incubator/heraldry/libraries/python/yadis/trunk/examples/apache/htaccess.txt
URL: http://svn.apache.org/viewvc/incubator/heraldry/libraries/python/yadis/trunk/examples/apache/htaccess.txt?view=auto&rev=463036
==============================================================================
--- incubator/heraldry/libraries/python/yadis/trunk/examples/apache/htaccess.txt (added)
+++ incubator/heraldry/libraries/python/yadis/trunk/examples/apache/htaccess.txt Wed Oct 11 16:09:11 2006
@@ -0,0 +1,55 @@
+# This file is a Apache configuration file for setting up a
+# YADIS-enabled identity URL.
+
+# This section enables the special header that makes a URL a YADIS
+# identity URL. If this header is present, the file is not required to
+# have any particular content or MIME type.
+<Files home.html>
+    # Add the X-YADIS-Location header to successful responses
+    # Replace the URL with the URL for your YADIS service discovery document.
+    Header onsuccess set X-YADIS-Location \
+      "http://openidenabled.com/yadis-test/apache/yadis.xml"
+</Files>
+
+# This section tells Apache what content-type to use for the YADIS
+# services document. In order for the content-negotiation optimization
+# to work, the Web server is required to return this specific
+# content-type for the YADIS services document.
+#
+# If you ever are hosting a YADIS services document, you should set
+# the content-type returned for the file to this value, regardless of
+# how the file is accessed.
+<Files yadis.xml>
+    # Make sure that Apache serves the YADIS services document as the
+    # correct content-type.
+    ForceType application/xrds+xml
+</Files>
+
+# This section is the first step to enabling content negotiation for
+# the identity URL. It tells Apache that this file is a type-map file,
+# which will be used to dispatch to the appropriate content based on
+# the form of the request.
+<Files identity>
+    # Tell apache that this file is a type-map that should be handled
+    # by mod_negotiation
+    SetHandler type-map
+</Files>
+
+# This section is only applicable when content negotiation is
+# enabled. It prevents direct requests for the content that is being
+# returned by the identity URL.
+#
+# Don't allow direct access to the .html file, so that there's no
+# confusion about which one is the idenity URL. This redirect means
+# that no matter which of the direct content URL or the desired
+# identity URL is entered, only the desired identity URL will be used
+# by YADIS consumers.
+RewriteEngine On
+
+# In order for this test to succeed, RewriteEngine must be turned On
+# in the site-wide apache configuration. Unless it is, the SCRIPT_URL
+# variable will not be set.
+RewriteCond "%{ENV:SCRIPT_URL}" "^/yadis-test/apache/home\.html$"
+
+# Redirect requests for the non-YADIS content to the identity URL.
+RewriteRule "^home\.html$" "/yadis-test/apache/identity" [R,L]

Added: incubator/heraldry/libraries/python/yadis/trunk/examples/apache/identity
URL: http://svn.apache.org/viewvc/incubator/heraldry/libraries/python/yadis/trunk/examples/apache/identity?view=auto&rev=463036
==============================================================================
--- incubator/heraldry/libraries/python/yadis/trunk/examples/apache/identity (added)
+++ incubator/heraldry/libraries/python/yadis/trunk/examples/apache/identity Wed Oct 11 16:09:11 2006
@@ -0,0 +1,5 @@
+Content-Type: application/xrds+xml; qs=0.8
+URI: yadis.xml
+
+Content-Type: */*; qs=0.9
+URI: home.html

Added: incubator/heraldry/libraries/python/yadis/trunk/examples/apache/identity.txt
URL: http://svn.apache.org/viewvc/incubator/heraldry/libraries/python/yadis/trunk/examples/apache/identity.txt?view=auto&rev=463036
==============================================================================
--- incubator/heraldry/libraries/python/yadis/trunk/examples/apache/identity.txt (added)
+++ incubator/heraldry/libraries/python/yadis/trunk/examples/apache/identity.txt Wed Oct 11 16:09:11 2006
@@ -0,0 +1,5 @@
+Content-Type: application/xrds+xml; qs=0.8
+URI: yadis.xml
+
+Content-Type: */*; qs=0.9
+URI: home.html

Added: incubator/heraldry/libraries/python/yadis/trunk/examples/apache/yadis.xml
URL: http://svn.apache.org/viewvc/incubator/heraldry/libraries/python/yadis/trunk/examples/apache/yadis.xml?view=auto&rev=463036
==============================================================================
--- incubator/heraldry/libraries/python/yadis/trunk/examples/apache/yadis.xml (added)
+++ incubator/heraldry/libraries/python/yadis/trunk/examples/apache/yadis.xml Wed Oct 11 16:09:11 2006
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Sample YADIS XRDS file -->
+<xrds:XRDS
+    xmlns:xrds="xri://$xrds"
+    xmlns="xri://$xrd*($v*2.0)">
+  <XRD>
+
+    <Service priority="0">
+      <Type>http://example.com/</Type>
+      <URI>http://www.openidenabled.com/</URI>
+    </Service>
+
+  </XRD>
+</xrds:XRDS>

Added: incubator/heraldry/libraries/python/yadis/trunk/setup.cfg
URL: http://svn.apache.org/viewvc/incubator/heraldry/libraries/python/yadis/trunk/setup.cfg?view=auto&rev=463036
==============================================================================
--- incubator/heraldry/libraries/python/yadis/trunk/setup.cfg (added)
+++ incubator/heraldry/libraries/python/yadis/trunk/setup.cfg Wed Oct 11 16:09:11 2006
@@ -0,0 +1,3 @@
+[sdist]
+force_manifest=1
+formats=gztar,zip

Added: incubator/heraldry/libraries/python/yadis/trunk/setup.py
URL: http://svn.apache.org/viewvc/incubator/heraldry/libraries/python/yadis/trunk/setup.py?view=auto&rev=463036
==============================================================================
--- incubator/heraldry/libraries/python/yadis/trunk/setup.py (added)
+++ incubator/heraldry/libraries/python/yadis/trunk/setup.py Wed Oct 11 16:09:11 2006
@@ -0,0 +1,46 @@
+#!/usr/bin/env python
+
+from distutils.core import setup
+import os, sys
+
+if 'sdist' in sys.argv:
+    os.system('./admin/epyrun')
+
+# patch distutils if it can't cope with the "classifiers" or
+# "download_url" keywords
+if sys.version < '2.2.3':
+    from distutils.dist import DistributionMetadata
+    DistributionMetadata.classifiers = None
+    DistributionMetadata.download_url = None
+
+version = '[library version:1.1.0-rc1]'[17:-1]
+
+kwargs = {
+    'name': "python-yadis",
+    'version': version,
+    'url': "http://www.openidenabled.com/yadis/libraries/python/",
+    'download_url': "http://www.openidenabled.com/resources/downloads/python-yadis/python-yadis-%s.tar.gz" % (version,),
+    'author': "JanRain, Inc.",
+    'author_email': "openid@janrain.com",
+    'description': "Yadis service discovery library.",
+    'long_description': "Yadis is a protocol for discovering services "
+    "applicable to a URL.  This package provides a client implementation "
+    "of the Yadis protocol.",
+    'packages': ['yadis',
+                 ],
+    'license': "LGPL",
+    'classifiers': [
+    "Development Status :: 5 - Production/Stable",
+    "Environment :: Web Environment",
+    "Intended Audience :: Developers",
+    "License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)",
+    "Operating System :: POSIX",
+    "Programming Language :: Python",
+    "Topic :: Internet :: WWW/HTTP",
+    "Topic :: Internet :: WWW/HTTP :: Dynamic Content :: CGI Tools/Libraries",
+    "Topic :: Software Development :: Libraries :: Python Modules",
+    "Topic :: System :: Systems Administration :: Authentication/Directory",
+    ]
+    }
+
+setup(**kwargs)

Propchange: incubator/heraldry/libraries/python/yadis/trunk/setup.py
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/heraldry/libraries/python/yadis/trunk/yadis/__init__.py
URL: http://svn.apache.org/viewvc/incubator/heraldry/libraries/python/yadis/trunk/yadis/__init__.py?view=auto&rev=463036
==============================================================================
--- incubator/heraldry/libraries/python/yadis/trunk/yadis/__init__.py (added)
+++ incubator/heraldry/libraries/python/yadis/trunk/yadis/__init__.py Wed Oct 11 16:09:11 2006
@@ -0,0 +1,17 @@
+"""Yadis.
+
+@see: U{http://www.openidenabled.com/yadis}
+"""
+
+__version__ = '[library version:1.1.0-rc1]'[17:-1]
+
+# Parse the version info
+try:
+    version_info = map(int, __version__.split('.'))
+except ValueError:
+    version_info = (None, None, None)
+else:
+    if len(version_info) != 3:
+        version_info = (None, None, None)
+    else:
+        version_info = tuple(version_info)

Added: incubator/heraldry/libraries/python/yadis/trunk/yadis/accept.py
URL: http://svn.apache.org/viewvc/incubator/heraldry/libraries/python/yadis/trunk/yadis/accept.py?view=auto&rev=463036
==============================================================================
--- incubator/heraldry/libraries/python/yadis/trunk/yadis/accept.py (added)
+++ incubator/heraldry/libraries/python/yadis/trunk/yadis/accept.py Wed Oct 11 16:09:11 2006
@@ -0,0 +1,133 @@
+"""Functions for generating and parsing HTTP Accept: headers for
+supporting server-directed content negotiation.
+"""
+
+def generateAcceptHeader(*elements):
+    """Generate an accept header value
+
+    [str or (str, float)] -> str
+    """
+    parts = []
+    for element in elements:
+        if type(element) is str:
+            qs = "1.0"
+            mtype = element
+        else:
+            mtype, q = element
+            q = float(q)
+            if q > 1 or q <= 0:
+                raise ValueError('Invalid preference factor: %r' % q)
+
+            qs = '%0.1f' % (q,)
+
+        parts.append((qs, mtype))
+
+    parts.sort()
+    chunks = []
+    for q, mtype in parts:
+        if q == '1.0':
+            chunks.append(mtype)
+        else:
+            chunks.append('%s; q=%s' % (mtype, q))
+
+    return ', '.join(chunks)
+
+def parseAcceptHeader(value):
+    """Parse an accept header, ignoring any accept-extensions
+
+    returns a list of tuples containing main MIME type, MIME subtype,
+    and quality markdown.
+
+    str -> [(str, str, float)]
+    """
+    chunks = [chunk.strip() for chunk in value.split(',')]
+    accept = []
+    for chunk in chunks:
+        parts = [s.strip() for s in chunk.split(';')]
+
+        mtype = parts.pop(0)
+        if '/' not in mtype:
+            # This is not a MIME type, so ignore the bad data
+            continue
+
+        main, sub = mtype.split('/', 1)
+
+        for ext in parts:
+            if '=' in ext:
+                k, v = ext.split('=', 1)
+                if k == 'q':
+                    try:
+                        q = float(v)
+                        break
+                    except ValueError:
+                        # Ignore poorly formed q-values
+                        pass
+        else:
+            q = 1.0
+
+        accept.append((q, main, sub))
+
+    accept.sort()
+    accept.reverse()
+    return [(main, sub, q) for (q, main, sub) in accept]
+
+def matchTypes(accept_types, have_types):
+    """Given the result of parsing an Accept: header, and the
+    available MIME types, return the acceptable types with their
+    quality markdowns.
+
+    For example:
+
+    >>> acceptable = parseAcceptHeader('text/html, text/plain; q=0.5')
+    >>> matchTypes(acceptable, ['text/plain', 'text/html', 'image/jpeg'])
+    [('text/html', 1.0), ('text/plain', 0.5)]
+
+
+    Type signature: ([(str, str, float)], [str]) -> [(str, float)]
+    """
+    if not accept_types:
+        # Accept all of them
+        default = 1
+    else:
+        default = 0
+
+    match_main = {}
+    match_sub = {}
+    for (main, sub, q) in accept_types:
+        if main == '*':
+            default = max(default, q)
+            continue
+        elif sub == '*':
+            match_main[main] = max(match_main.get(main, 0), q)
+        else:
+            match_sub[(main, sub)] = max(match_sub.get((main, sub), 0), q)
+
+    accepted_list = []
+    order_maintainer = 0
+    for mtype in have_types:
+        main, sub = mtype.split('/')
+        if (main, sub) in match_sub:
+            q = match_sub[(main, sub)]
+        else:
+            q = match_main.get(main, default)
+
+        if q:
+            accepted_list.append((1 - q, order_maintainer, q, mtype))
+            order_maintainer += 1
+
+    accepted_list.sort()
+    return [(mtype, q) for (_, _, q, mtype) in accepted_list]
+
+def getAcceptable(accept_header, have_types):
+    """Parse the accept header and return a list of available types in
+    preferred order. If a type is unacceptable, it will not be in the
+    resulting list.
+
+    This is a convenience wrapper around matchTypes and
+    parseAcceptHeader.
+
+    (str, [str]) -> [str]
+    """
+    accepted = parseAcceptHeader(accept_header)
+    preferred = matchTypes(accepted, have_types)
+    return [mtype for (mtype, _) in preferred]

Added: incubator/heraldry/libraries/python/yadis/trunk/yadis/constants.py
URL: http://svn.apache.org/viewvc/incubator/heraldry/libraries/python/yadis/trunk/yadis/constants.py?view=auto&rev=463036
==============================================================================
--- incubator/heraldry/libraries/python/yadis/trunk/yadis/constants.py (added)
+++ incubator/heraldry/libraries/python/yadis/trunk/yadis/constants.py Wed Oct 11 16:09:11 2006
@@ -0,0 +1,13 @@
+__all__ = ['YADIS_HEADER_NAME', 'YADIS_CONTENT_TYPE', 'YADIS_ACCEPT_HEADER']
+from yadis.accept import generateAcceptHeader
+
+YADIS_HEADER_NAME = 'X-XRDS-Location'
+YADIS_CONTENT_TYPE = 'application/xrds+xml'
+
+# A value suitable for using as an accept header when performing YADIS
+# discovery, unless the application has special requirements
+YADIS_ACCEPT_HEADER = generateAcceptHeader(
+    ('text/html', 0.3),
+    ('application/xhtml+xml', 0.5),
+    (YADIS_CONTENT_TYPE, 1.0),
+    )

Added: incubator/heraldry/libraries/python/yadis/trunk/yadis/discover.py
URL: http://svn.apache.org/viewvc/incubator/heraldry/libraries/python/yadis/trunk/yadis/discover.py?view=auto&rev=463036
==============================================================================
--- incubator/heraldry/libraries/python/yadis/trunk/yadis/discover.py (added)
+++ incubator/heraldry/libraries/python/yadis/trunk/yadis/discover.py Wed Oct 11 16:09:11 2006
@@ -0,0 +1,117 @@
+# -*- test-case-name: yadis.test.test_discover -*-
+__all__ = ['discover', 'DiscoveryResult', 'DiscoveryFailure']
+
+from cStringIO import StringIO
+
+from urljr import fetchers
+
+from yadis.constants import \
+     YADIS_HEADER_NAME, YADIS_CONTENT_TYPE, YADIS_ACCEPT_HEADER
+from yadis.parsehtml import MetaNotFound, findHTMLMeta
+
+class DiscoveryFailure(Exception):
+    """Raised when a YADIS protocol error occurs in the discovery process"""
+    identity_url = None
+
+    def __init__(self, message, http_response):
+        Exception.__init__(self, message)
+        self.http_response = http_response
+
+class DiscoveryResult(object):
+    """Contains the result of performing Yadis discovery on a URI"""
+
+    # The URI that was passed to the fetcher
+    request_uri = None
+
+    # The result of following redirects from the request_uri
+    normalized_uri = None
+
+    # The URI from which the response text was returned (set to
+    # None if there was no XRDS document found)
+    xrds_uri = None
+
+    # The content-type returned with the response_text
+    content_type = None
+
+    # The document returned from the xrds_uri
+    response_text = None
+
+    def __init__(self, request_uri):
+        """Initialize the state of the object
+
+        sets all attributes to None except the request_uri
+        """
+        self.request_uri = request_uri
+
+    def usedYadisLocation(self):
+        """Was the Yadis protocol's indirection used?"""
+        return self.normalized_uri == self.xrds_uri
+
+    def isXRDS(self):
+        """Is the response text supposed to be an XRDS document?"""
+        return (self.usedYadisLocation() or
+                self.content_type == YADIS_CONTENT_TYPE)
+
+def discover(uri):
+    """Discover services for a given URI.
+
+    @param uri: The identity URI as a well-formed http or https
+        URI. The well-formedness and the protocol are not checked, but
+        the results of this function are undefined if those properties
+        do not hold.
+
+    @return: DiscoveryResult object
+
+    @raises Exception: Any exception that can be raised by fetching a URL with
+        the given fetcher.
+    """
+    result = DiscoveryResult(uri)
+    resp = fetchers.fetch(uri, headers={'Accept': YADIS_ACCEPT_HEADER})
+    if resp.status != 200:
+        raise DiscoveryFailure(
+            'HTTP Response status from identity URL host is not 200. '
+            'Got status %r' % (resp.status,), resp)
+
+    # Note the URL after following redirects
+    result.normalized_uri = resp.final_url
+
+    # Attempt to find out where to go to discover the document
+    # or if we already have it
+    result.content_type = resp.headers.get('content-type')
+
+    # According to the spec, the content-type header must be an exact
+    # match, or else we have to look for an indirection.
+    if (result.content_type and
+        result.content_type.split(';', 1)[0].lower() == YADIS_CONTENT_TYPE):
+        result.xrds_uri = result.normalized_uri
+    else:
+        # Try the header
+        yadis_loc = resp.headers.get(YADIS_HEADER_NAME.lower())
+
+        if not yadis_loc:
+            # Parse as HTML if the header is missing.
+            #
+            # XXX: do we want to do something with content-type, like
+            # have a whitelist or a blacklist (for detecting that it's
+            # HTML)?
+            try:
+                yadis_loc = findHTMLMeta(StringIO(resp.body))
+            except MetaNotFound:
+                pass
+
+        # At this point, we have not found a YADIS Location URL. We
+        # will return the content that we scanned so that the caller
+        # can try to treat it as an XRDS if it wishes.
+        if yadis_loc:
+            result.xrds_uri = yadis_loc
+            resp = fetchers.fetch(yadis_loc)
+            if resp.status != 200:
+                exc = DiscoveryFailure(
+                    'HTTP Response status from Yadis host is not 200. '
+                    'Got status %r' % (resp.status,), resp)
+                exc.identity_url = result.normalized_uri
+                raise exc
+            result.content_type = resp.headers.get('content-type')
+
+    result.response_text = resp.body
+    return result

Added: incubator/heraldry/libraries/python/yadis/trunk/yadis/etxrd.py
URL: http://svn.apache.org/viewvc/incubator/heraldry/libraries/python/yadis/trunk/yadis/etxrd.py?view=auto&rev=463036
==============================================================================
--- incubator/heraldry/libraries/python/yadis/trunk/yadis/etxrd.py (added)
+++ incubator/heraldry/libraries/python/yadis/trunk/yadis/etxrd.py Wed Oct 11 16:09:11 2006
@@ -0,0 +1,269 @@
+# -*- test-case-name: yadis.test.test_etxrd -*-
+"""
+ElementTree interface to an XRD document.
+"""
+
+__all__ = [
+    'nsTag',
+    'mkXRDTag',
+    'isXRDS',
+    'parseXRDS',
+    'getCanonicalID',
+    'getYadisXRD',
+    'getPriorityStrict',
+    'getPriority',
+    'prioSort',
+    'iterServices',
+    'expandService',
+    'expandServices',
+    ]
+
+import random
+
+from elementtree.ElementTree import ElementTree
+
+# Use expat if it's present. Otherwise, use xmllib
+try:
+    from xml.parsers.expat import ExpatError as XMLError
+    from elementtree.ElementTree import XMLTreeBuilder
+except ImportError:
+    from elementtree.SimpleXMLTreeBuilder import TreeBuilder as XMLTreeBuilder
+    from xmllib import Error as XMLError
+
+from yadis import xri
+
+class XRDSError(Exception):
+    """An error with the XRDS document."""
+
+    # The exception that triggered this exception
+    reason = None
+
+
+
+class XRDSFraud(XRDSError):
+    """Raised when there's an assertion in the XRDS that it does not have
+    the authority to make.
+    """
+
+
+
+def parseXRDS(text):
+    """Parse the given text as an XRDS document.
+
+    @return: ElementTree containing an XRDS document
+
+    @raises XRDSError: When there is a parse error or the document does
+        not contain an XRDS.
+    """
+    try:
+        parser = XMLTreeBuilder()
+        parser.feed(text)
+        element = parser.close()
+    except XMLError, why:
+        exc = XRDSError('Error parsing document as XML')
+        exc.reason = why
+        raise exc
+    else:
+        tree = ElementTree(element)
+        if not isXRDS(tree):
+            raise XRDSError('Not an XRDS document')
+
+        return tree
+
+XRD_NS_2_0 = 'xri://$xrd*($v*2.0)'
+XRDS_NS = 'xri://$xrds'
+
+def nsTag(ns, t):
+    return '{%s}%s' % (ns, t)
+
+def mkXRDTag(t):
+    """basestring -> basestring
+
+    Create a tag name in the XRD 2.0 XML namespace suitable for using
+    with ElementTree
+    """
+    return nsTag(XRD_NS_2_0, t)
+
+def mkXRDSTag(t):
+    """basestring -> basestring
+
+    Create a tag name in the XRDS XML namespace suitable for using
+    with ElementTree
+    """
+    return nsTag(XRDS_NS, t)
+
+# Tags that are used in Yadis documents
+root_tag = mkXRDSTag('XRDS')
+service_tag = mkXRDTag('Service')
+xrd_tag = mkXRDTag('XRD')
+type_tag = mkXRDTag('Type')
+uri_tag = mkXRDTag('URI')
+
+# Other XRD tags
+canonicalID_tag = mkXRDTag('CanonicalID')
+
+def isXRDS(xrd_tree):
+    """Is this document an XRDS document?"""
+    root = xrd_tree.getroot()
+    return root.tag == root_tag
+
+def getYadisXRD(xrd_tree):
+    """Return the XRD element that should contain the Yadis services"""
+    xrd = None
+
+    # for the side-effect of assigning the last one in the list to the
+    # xrd variable
+    for xrd in xrd_tree.findall(xrd_tag):
+        pass
+
+    # There were no elements found, or else xrd would be set to the
+    # last one
+    if xrd is None:
+        raise XRDSError('No XRD present in tree')
+
+    return xrd
+
+
+def getCanonicalID(iname, xrd_tree):
+    """Return the CanonicalID from this XRDS document.
+
+    @param iname: the XRI being resolved.
+    @type iname: unicode
+
+    @param xrd_tree: The XRDS output from the resolver.
+    @type xrd_tree: ElementTree
+
+    @returns: The XRI CanonicalID or None.
+    @returntype: unicode or None
+    """
+    xrd_list = xrd_tree.findall(xrd_tag)
+    xrd_list.reverse()
+
+    try:
+        canonicalID = xri.XRI(xrd_list[0].findall(canonicalID_tag)[-1].text)
+    except IndexError:
+        return None
+
+    childID = canonicalID
+
+    for xrd in xrd_list[1:]:
+        # XXX: can't use rsplit until we require python >= 2.4.
+        parent_sought = childID[:childID.rindex('!')]
+        parent_list = [xri.XRI(c.text) for c in xrd.findall(canonicalID_tag)]
+        if parent_sought not in parent_list:
+            raise XRDSFraud("%r can not come from any of %s" % (parent_sought,
+                                                                parent_list))
+
+        childID = parent_sought
+
+    root = xri.rootAuthority(iname)
+    if not xri.providerIsAuthoritative(root, childID):
+        raise XRDSFraud("%r can not come from root %r" % (childID, root))
+
+    return canonicalID
+
+
+
+class _Max(object):
+    """Value that compares greater than any other value.
+
+    Should only be used as a singleton. Implemented for use as a
+    priority value for when a priority is not specified."""
+    def __cmp__(self, other):
+        if other is self:
+            return 0
+
+        return 1
+
+Max = _Max()
+
+def getPriorityStrict(element):
+    """Get the priority of this element.
+
+    Raises ValueError if the value of the priority is invalid. If no
+    priority is specified, it returns a value that compares greater
+    than any other value.
+    """
+    prio_str = element.get('priority')
+    if prio_str is not None:
+        prio_val = int(prio_str)
+        if prio_val >= 0:
+            return prio_val
+        else:
+            raise ValueError('Priority values must be non-negative integers')
+
+    # Any errors in parsing the priority fall through to here
+    return Max
+
+def getPriority(element):
+    """Get the priority of this element
+
+    Returns Max if no priority is specified or the priority value is invalid.
+    """
+    try:
+        return getPriorityStrict(element)
+    except ValueError:
+        return Max
+
+def prioSort(elements):
+    """Sort a list of elements that have priority attributes"""
+    # Randomize the services before sorting so that equal priority
+    # elements are load-balanced.
+    random.shuffle(elements)
+
+    prio_elems = [(getPriority(e), e) for e in elements]
+    prio_elems.sort()
+    sorted_elems = [s for (_, s) in prio_elems]
+    return sorted_elems
+
+def iterServices(xrd_tree):
+    """Return an iterable over the Service elements in the Yadis XRD
+
+    sorted by priority"""
+    xrd = getYadisXRD(xrd_tree)
+    return prioSort(xrd.findall(service_tag))
+
+def sortedURIs(service_element):
+    """Given a Service element, return a list of the contents of all
+    URI tags in priority order."""
+    return [uri_element.text for uri_element
+            in prioSort(service_element.findall(uri_tag))]
+
+def getTypeURIs(service_element):
+    """Given a Service element, return a list of the contents of all
+    Type tags"""
+    return [type_element.text for type_element
+            in service_element.findall(type_tag)]
+
+def expandService(service_element):
+    """Take a service element and expand it into an iterator of:
+    ([type_uri], uri, service_element)
+    """
+    uris = sortedURIs(service_element)
+    if not uris:
+        uris = [None]
+
+    expanded = []
+    for uri in uris:
+        type_uris = getTypeURIs(service_element)
+        expanded.append((type_uris, uri, service_element))
+
+    return expanded
+
+def expandServices(service_elements):
+    """Take a sorted iterator of service elements and expand it into a
+    sorted iterator of:
+    ([type_uri], uri, service_element)
+
+    There may be more than one item in the resulting list for each
+    service element if there is more than one URI or type for a
+    service, but each triple will be unique.
+
+    If there is no URI or Type for a Service element, it will not
+    appear in the result.
+    """
+    expanded = []
+    for service_element in service_elements:
+        expanded.extend(expandService(service_element))
+
+    return expanded



Mime
View raw message