/usr/share/pyshared/quixote/demo/extras.ptl is in python-quixote 2.7~b2-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 | import os
from quixote.directory import Directory, Resolving
from quixote.util import StaticDirectory
from quixote.demo.integers import IntegerUI
class ExtraDirectory(Resolving, Directory):
_q_exports = ["", "form", "src"]
def _q_index [html] (self):
"""
<html>
<head><title>Quixote Demo Extras</title></head>
<body>
<h1>Extras</h1>
<p>
Here are some more features of this demo:
<ul>
<li><a href="12/">12/</a>:
A Python object published through <code>_q_lookup()</code>.
<li><a href="12/factorial">12/factorial</a>:
A method on a published Python object.
<li><a href="form">form</a>:
A Quixote form in action.
<li><a href="src/">src/</a>:
A static directory published through Quixote.
</ul>
"""
def _q_resolve(self, component):
# _q_resolve() is a hook that can be used to import only
# when it's actually accessed. This can be used to make
# start-up of your application faster, because it doesn't have
# to import every single module when it starts running.
if component == 'form':
from quixote.demo.forms import form_demo
return form_demo
def _q_lookup(self, component):
return IntegerUI(component)
def upload(self):
return 'upload demo unfinished'
import quixote
src = StaticDirectory(os.path.dirname(quixote.__file__),
list_directory=True)
|