Skip to content

Commit aeff4e3

Browse files
committed
some work on presentation
1 parent c922d6c commit aeff4e3

File tree

2 files changed

+59
-3
lines changed

2 files changed

+59
-3
lines changed

week-08/presentation-week08.pdf

7.76 KB
Binary file not shown.

week-08/presentation-week08.tex

Lines changed: 59 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,6 @@ \section{Decorators}
229229
self._x = None
230230
@property
231231
def x(self):
232-
"""I'm the 'x' property."""
233232
return self._x
234233
@x.setter
235234
def x(self, value):
@@ -243,13 +242,70 @@ \section{Decorators}
243242
Puts the info close to where it is used
244243
\end{frame}
245244

245+
% ---------------------------------------------
246+
\begin{frame}[fragile]{examples}
247+
248+
{\LARGE CherryPy}
249+
250+
\vfill
251+
\begin{verbatim}
252+
import cherrypy
253+
class HelloWorld(object):
254+
@cherrypy.expose
255+
def index(self):
256+
return "Hello World!"
257+
cherrypy.quickstart(HelloWorld())
258+
\end{verbatim}
259+
260+
\end{frame}
261+
262+
% ---------------------------------------------
263+
\begin{frame}[fragile]{examples}
264+
265+
{\LARGE Pyramid}
266+
267+
\vfill
268+
\begin{verbatim}
269+
270+
@template
271+
def A_view_function(request)
272+
.....
273+
@json
274+
def A_view_function(request)
275+
......
276+
277+
278+
\end{verbatim}
279+
280+
so you don't need to think about what your view is returning...
281+
282+
\end{frame}
283+
284+
285+
% ---------------------------------------------
286+
\begin{frame}[fragile]{decorators...}
287+
288+
{\Large For this class:}
289+
290+
\vfill
291+
{\Large Mostly want to you to know how to use decorators that someone else has written}
292+
293+
\vfill
294+
{\Large Have a basic idea what they do when you do use them}
295+
296+
\end{frame}
246297

247298

248299
%-------------------------------
249-
\begin{frame}{LAB}
300+
\begin{frame}[fragile]{LAB}
250301

251302
\begin{itemize}
252-
\item
303+
\item Re-write the properties from last week's \verb|Circle| class to use the
304+
decorator syntax (see a couple slides back for an example)
305+
306+
\item Write a decorator that can be used to wrap any function that returns a
307+
string in a \verb|<p>| element from the html builder from the previous
308+
couple classes (the \verb|P Element| subclass).
253309
\end{itemize}
254310

255311
\end{frame}

0 commit comments

Comments
 (0)