SF.net SVN: fclient: [263] trunk/web
Status: Pre-Alpha
Brought to you by:
jurner
|
From: <ju...@us...> - 2008-02-26 10:21:05
|
Revision: 263
http://fclient.svn.sourceforge.net/fclient/?rev=263&view=rev
Author: jurner
Date: 2008-02-26 02:21:07 -0800 (Tue, 26 Feb 2008)
Log Message:
-----------
...
Added Paths:
-----------
trunk/web/download-fcp2.html
trunk/web/more-fcp2.html
trunk/web/screenshots-fcp2.html
Added: trunk/web/download-fcp2.html
===================================================================
--- trunk/web/download-fcp2.html (rev 0)
+++ trunk/web/download-fcp2.html 2008-02-26 10:21:07 UTC (rev 263)
@@ -0,0 +1,21 @@
+<html>
+ <head>
+ <link rel="StyleSheet" href="default.css" type="text/css" media="screen">
+ </head>
+ <body>
+
+ <div class="navHeader">
+ <a class="navRef" href="intro.html" target="mainFrame">fclient</a><span class="navRef">::download-fcp2</span>
+ </div>
+
+
+ <div class="topic">
+ <br>
+ <br>
+ Nothing to see here, move along
+ </div>
+
+ <div class="bottom_padding"></div>
+ </body>
+</html>
+
Added: trunk/web/more-fcp2.html
===================================================================
--- trunk/web/more-fcp2.html (rev 0)
+++ trunk/web/more-fcp2.html 2008-02-26 10:21:07 UTC (rev 263)
@@ -0,0 +1,86 @@
+<html>
+ <head>
+ <link rel="StyleSheet" href="default.css" type="text/css" media="screen">
+ </head>
+ <body>
+
+ <div class="navHeader">
+ <a class="navRef" href="intro.html" target="mainFrame">fclient</a><span class="navRef">::more-fcp2</span>
+ </div>
+
+
+ <div class="topic">
+ <b>fcp2:</b> high level wrapper for the freenet client protocol written in python. Automatic
+ conversions from Fcp to python types, access to node and peer configurations.
+
+ <br>
+ Blah more here
+ </div>
+
+ <h5>Sample code:</h5>
+
+
+Connect to the freenet node
+<pre class="py_code"><span class="py_keyword">from</span> fcp2 <span class="py_keyword">import</span> Client
+
+client <span class="py_operator">=</span> Client()
+nodeHello <span class="py_operator">=</span> client.connect()
+<span class="py_keyword">if</span> nodeHello <span class="py_keyword">is</span> <span class="py_bool">None</span>:
+ <span class="py_keyword">pass</span>
+ <span class="py_comment"># something went wrong ..could not connect to the freenet node</span>
+<span class="py_keyword">else</span>:
+ <span class="py_keyword">pass</span>
+ <span class="py_comment"># everything went well ..we are connected now</span>
+</pre>
+
+Request data associated to a freenet key
+<pre class="py_code">myRequestIdentifier <span class="py_operator">=</span> client.getData(<span class="py_string2">'CHK@ABCDE.......'</span>)
+myRequest <span class="py_operator">=</span> client.getRequest(myIdentifier)
+client.run()
+<span class="py_keyword">print</span> myRequest.data
+</pre>
+
+
+Usually you would connect handlers to client events to do processing or handle errors
+<pre class="py_code"><span class="py_keyword">def</span> handleSuccess(event, request):
+ <span class="py_keyword">print</span> <span class="py_string2">'Here is the data:'</span>, request.data
+
+<span class="py_keyword">def</span> handleFailure(event, request):
+ <span class="py_keyword">print</span> <span class="py_string2">'Too bad, something went wrong'</span>
+
+client.events.RequestCompleted <span class="py_operator">+</span><span class="py_operator">=</span> handleSuccess
+client.events.RequestFailed <span class="py_operator">+</span><span class="py_operator">=</span> handleFailure
+
+client.getData(<span class="py_string2">'CHK@ABCDE.......'</span>)
+client.run()
+</pre>
+
+Instead of calling run() you may run the client step by step
+<pre class="py_code">client.getData(<span class="py_string2">'CHK@ABCDE.......'</span>)
+<span class="py_keyword">for</span> i <span class="py_keyword">in</span> xrange(50):
+ client.next()
+</pre>
+
+You may disconnect event handlers aswel
+<pre class="py_code">client.events.RequestCompleted <span class="py_operator">-</span><span class="py_operator">=</span> handleSuccess
+client.events.RequestFailed <span class="py_operator">-</span><span class="py_operator">=</span> handleFailure
+</pre>
+
+Multiple event handlers may be connected / disconnected at once
+<pre class="py_code">client.events <span class="py_operator">+</span><span class="py_operator">=</span> (
+ (client.events.RequestCompleted, handleSuccess),
+ (client.events.RequestFailed, handleFailure)
+ )
+</pre>
+
+
+
+To generate extensive documentation run the package through [<a href="http://epydoc.sourceforge.net/">epydoc</a>].
+To make things a bit simpler script <span class="hilight">gen_docs.py</span> located in the
+<span class="hilight">scripts</span> subdirectory of the package wich will dump docs automatically to the
+packages <span class="hilight">doc</span> folder.
+
+
+ <div class="bottom_padding"></div>
+ </body>
+</html>
\ No newline at end of file
Added: trunk/web/screenshots-fcp2.html
===================================================================
--- trunk/web/screenshots-fcp2.html (rev 0)
+++ trunk/web/screenshots-fcp2.html 2008-02-26 10:21:07 UTC (rev 263)
@@ -0,0 +1,21 @@
+<html>
+ <head>
+ <link rel="StyleSheet" href="default.css" type="text/css" media="screen">
+ </head>
+ <body>
+
+ <div class="navHeader">
+ <a class="navRef" href="intro.html" target="mainFrame">fclient</a><span class="navRef">::screenshots-fcp2</span>
+ </div>
+
+
+ <div class="topic">
+ <br>
+ <br>
+ Nothing to see here, move along
+ </div>
+
+
+ <div class="bottom_padding"></div>
+ </body>
+</html>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|