/[glsr]/trunk/glsr_framework/utils.py
Gentoo

Contents of /trunk/glsr_framework/utils.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 169 - (show annotations) (download) (as text)
Sun Oct 30 02:57:39 2005 UTC (8 years, 9 months ago) by hadfield
File MIME type: text/x-python
File size: 1045 byte(s)
added a very basic framework to bypass idl's not-working-very-well harmonious
1 # Copyright 2005 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 #
4
5 """Generic utilities that have nowhere better to go."""
6
7 __revision__ = "$Id$"
8 __authors__ = ["Scott Hadfield <hadfield@gentoo.org>",
9 "Ian Leitch <port001@gentoo.org>"]
10 __modulename__ = "utils"
11
12 def html_escape(txt):
13
14 txt = txt.replace('&', '&amp;')
15 txt = txt.replace('<', '&lt;')
16 txt = txt.replace('>', '&gt;')
17 txt = txt.replace('"', '&quot;')
18
19 return txt
20
21 def default(method):
22 """The decorator function that defines default class method.
23
24 A default class method will be called if no other page is specified. A
25 default class method is automatically exposed.
26 """
27
28 method.default = True
29 method.exposed = True
30 return method
31
32 def exposed(method):
33 """The decorator function that defines 'exposed' class methods.
34
35 An exposed class method is a method in a domain module that can be
36 called directly by the browser.
37 """
38
39 method.exposed = True
40 return method

Properties

Name Value
svn:keywords Id

  ViewVC Help
Powered by ViewVC 1.1.20