source: TI05-delivery/ows_framework/trunk/ows/is19115_subset.py @ 2469

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI05-delivery/ows_framework/trunk/ows/is19115_subset.py@2469
Revision 2469, 1.3 KB checked in by spascoe, 13 years ago (diff)

About half way through modelling OWS v1.1.0

Line 
1# Copyright (C) 2007 STFC & NERC (Science and Technology Facilities Council).
2# This software may be distributed under the terms of the
3# Q Public License, version 1.0 or later.
4# http://ndg.nerc.ac.uk/public_docs/QPublic_license.txt
5"""
6Classes modelling the OWS ISO19115 subset package v1.1.0.
7
8@author: Stephen Pascoe
9"""
10
11class LanguageString(str):
12    """
13    If you wish to attach a language identifier to a string use this
14    class.  Otherwise normal strings can be used in place of LanguageString.
15   
16    @ivar lang: language identifier
17    @type lang: str
18
19    """
20    __slots__ = ['lang']
21   
22    def __init__(self, value, lang=None):
23        super(LanguageString, self).__init__(value)
24        self.lang = lang
25
26class Code(object):
27    """
28    @ivar code
29    @type code: str
30    @ivar codeSpace: URI qualifying self.code
31    @type codeSpace: None or char
32
33    """
34    __slots__ = ['code', 'codeSpace']
35
36    def __init__(self, code, codeSpace=None):
37        self.code = code
38        self.codeSpace = codeSpace
39
40class Keywords(list):
41    """
42    If you wish to attach a type code to a keyword list use this class.
43    Otherwise any iterable can be used in place of Keywords.
44
45    @ivar type
46    @type type: Code
47
48    """
49    __slots__ = ['type']
50
51    def __init__(self, type=None):
52        self.type = type
53       
Note: See TracBrowser for help on using the repository browser.