Changeset 2519 for TI05-delivery


Ignore:
Timestamp:
29/05/07 14:17:30 (12 years ago)
Author:
spascoe
Message:

Added code to parse service metadata XML into ows_common objects.
Some corrections to ows_common classes.

Location:
TI05-delivery/ows_framework/trunk/ows_common/ows_common
Files:
7 added
3 edited

Legend:

Unmodified
Added
Removed
  • TI05-delivery/ows_framework/trunk/ows_common/ows_common/data_identification.py

    r2502 r2519  
    1515    """ 
    1616    @ivar title 
    17     @type title: None, str or LanguageString 
     17    @type title: iterable of str or LanguageString 
    1818    @ivar abstract 
    19     @type abstract: None, str or LanguageString 
     19    @type abstract: iterable of str or LanguageString 
    2020    @ivar keywords 
    2121    @type keywords: iterable or Keywords 
    2222 
    2323    """ 
    24     def __init__(self, title=None, abstract=None, keywords=Keywords()): 
    25         self.title = title 
    26         self.abstract = abstract 
     24    def __init__(self, titles=[], abstracts=[], keywords=Keywords()): 
     25        self.titles = titles 
     26        self.abstracts = abstracts 
    2727        self.keywords = keywords 
    2828 
  • TI05-delivery/ows_framework/trunk/ows_common/ows_common/iso19115_subset.py

    r2501 r2519  
    1818 
    1919    """ 
     20 
     21    def __new__(cls, value='', lang=None): 
     22        return str.__new__(cls, value) 
    2023     
    21     def __init__(self, value, lang=None): 
    22         super(LanguageString, self).__init__(value) 
     24    def __init__(self, value='', lang=None): 
    2325        self.lang = lang 
    2426 
     
    3537    """ 
    3638 
    37     def __init__(self, code, codeSpace=None): 
    38         super(Code, self).__init__(code) 
     39    def __new__(cls, code='', codeSpace=None): 
     40        return str.__new__(cls, code) 
     41 
     42    def __init__(self, code='', codeSpace=None): 
    3943        self.codeSpace = codeSpace 
    4044 
     
    5054    __slots__ = ['type'] 
    5155 
    52     def __init__(self, type=None): 
     56    def __new__(cls, value=[], type=None): 
     57        return list.__new__(cls, value) 
     58 
     59    def __init__(self, value=[], type=None): 
    5360        self.type = type 
    5461         
     
    146153    @type address: None or Address 
    147154    @ivar phone 
     155    @type phone: None or Telephone 
    148156    @ivar onlineResource 
    149157    @type onlineResource: None or OnlineResource 
  • TI05-delivery/ows_framework/trunk/ows_common/ows_common/service_identification.py

    r2478 r2519  
    1616    @ivar serviceType 
    1717    @type serviceType: ows.iso19115_subset.Code 
    18     @ivar serviceTypeVersion: The service version 
    19     @type serviceTypeVersion: str 
    20     @ivar profile 
    21     @type profile: None or str 
     18    @ivar serviceTypeVersions: The supported service versions 
     19    @type serviceTypeVersions: iterable of str 
     20    @ivar profiles 
     21    @type profiles: iterable of str 
    2222    @ivar fees 
    2323    @type fees: None or str 
     
    2626 
    2727    """ 
    28     def __init__(self, serviceType, serviceTypeVersion, 
    29                  profile=None, fees=None, accessConstraints=None): 
     28    def __init__(self, serviceType, serviceTypeVersions=[], 
     29                 profiles=[], fees=None, accessConstraints=None, **kwargs): 
    3030        """ 
    3131        All parameters set default attributes of the instance. 
    3232 
    3333        """ 
    34         super(self.__class__).__init__() 
     34        super(self.__class__, self).__init__(**kwargs) 
    3535 
    3636        self.serviceType = serviceType 
    37         self.serviceTypeVersion = serviceTypeVersion 
    38         self.profile = profile 
     37        self.serviceTypeVersions = serviceTypeVersions 
     38        self.profiles = profiles 
    3939        self.fees = fees 
    4040        self.accessConstraints = accessConstraints 
Note: See TracChangeset for help on using the changeset viewer.