-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathhello.html
More file actions
94 lines (84 loc) · 3.33 KB
/
hello.html
File metadata and controls
94 lines (84 loc) · 3.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
<!DOCTYPE html>
<html>
<head>
<title>hello.py</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="dycco.css">
</head>
<body>
<div id="container">
<div id="background"></div>
<table cellpadding="0" cellspacing="0">
<thead>
<tr>
<th class="docs">
<h1>hello.py</h1>
</th>
<th class="code">
</th>
</tr>
</thead>
<tbody>
<tr id="section-2">
<td class="docs">
<div class="pilwrap">
<a class="pilcrow" href="#section-2">¶</a>
</div>
<p>A callable class example.</p>
</td>
<td class="code">
<div class="highlight"><pre>
</pre></div>
</td>
</tr>
<tr id="section-5">
<td class="docs">
<div class="pilwrap">
<a class="pilcrow" href="#section-5">¶</a>
</div>
</td>
<td class="code">
<div class="highlight"><pre><span class="k">class</span> <span class="nc">Root</span><span class="p">(</span><span class="nb">object</span><span class="p">):</span>
</pre></div>
</td>
</tr>
<tr id="section-6">
<td class="docs">
<div class="pilwrap">
<a class="pilcrow" href="#section-6">¶</a>
</div>
</td>
<td class="code">
<div class="highlight"><pre> <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">context</span><span class="p">):</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_ctx</span> <span class="o">=</span> <span class="n">context</span>
</pre></div>
</td>
</tr>
<tr id="section-9">
<td class="docs">
<div class="pilwrap">
<a class="pilcrow" href="#section-9">¶</a>
</div>
<p>/ -- 500
/?name=Bob
/ POST name=bob
/Bob</p>
</td>
<td class="code">
<div class="highlight"><pre> <span class="k">def</span> <span class="nf">__call__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">name</span><span class="p">):</span>
<span class="k">return</span> <span class="s">"Hello "</span> <span class="o">+</span> <span class="n">name</span>
<span class="k">if</span> <span class="n">__name__</span> <span class="o">==</span> <span class="s">'__main__'</span><span class="p">:</span>
<span class="kn">from</span> <span class="nn">web.core</span> <span class="kn">import</span> <span class="n">Application</span>
<span class="n">Application</span><span class="p">(</span><span class="n">Root</span><span class="p">)</span><span class="o">.</span><span class="n">serve</span><span class="p">(</span><span class="s">'wsgiref'</span><span class="p">)</span>
</pre></div>
</td>
</tr>
</tbody>
</table>
<footer>
Generated by <b><a href="http://mccutchen.github.com/dycco/">Dycco</a></b>.
Last updated <b>25 Apr 2016</b>.
</footer>
</div>
</body>
</html>