20 |
20 |
21 from PIL import Image, ImageDraw, ImageFont, ImageEnhance |
21 from PIL import Image, ImageDraw, ImageFont, ImageEnhance |
22 from cStringIO import StringIO |
22 from cStringIO import StringIO |
23 import random, itertools, time, os.path |
23 import random, itertools, time, os.path |
24 |
24 |
|
25 # monkeypatch 2.5 to add missing 2.6 features |
25 if not hasattr(itertools, 'izip_longest') : |
26 if not hasattr(itertools, 'izip_longest') : |
26 |
|
27 def izip_longest(*args, **kwds): |
27 def izip_longest(*args, **kwds): |
28 # izip_longest('ABCD', 'xy', fillvalue='-') --> Ax By C- D- |
28 # izip_longest('ABCD', 'xy', fillvalue='-') --> Ax By C- D- |
29 fillvalue = kwds.get('fillvalue') |
29 fillvalue = kwds.get('fillvalue') |
30 def sentinel(counter = ([fillvalue]*(len(args)-1)).pop): |
30 def sentinel(counter = ([fillvalue]*(len(args)-1)).pop): |
31 yield counter() # yields the fillvalue, or raises IndexError |
31 yield counter() # yields the fillvalue, or raises IndexError |
580 <div id='logo'> |
582 <div id='logo'> |
581 <a href="%(img_url)s"><img src="%(img_url)s" alt="Aaltologo" /></a> |
583 <a href="%(img_url)s"><img src="%(img_url)s" alt="Aaltologo" /></a> |
582 </div> |
584 </div> |
583 <div id='info'> |
585 <div id='info'> |
584 <h1>Aaltologotin</h1> |
586 <h1>Aaltologotin</h1> |
585 <p>Aaltologotin pulauttaa sulle uuden, sattumanvaraisesti valitun aalto-logon!</p> |
587 <p>Aaltologotin pulauttaa sinulle uuden, sattumanvaraisesti valitun aalto-logon!</p> |
586 |
588 |
587 <form action="%(script_url)s" method="POST"> |
589 <form action="%(script_url)s" method="POST"> |
588 <fieldset> |
590 <fieldset> |
589 <legend>Aalto-parameterit</legend> |
591 <legend>Aalto-parameterit</legend> |
590 %(form_fields)s |
592 %(form_fields)s |