Changeset 186


Ignore:
Timestamp:
05/12/09 07:14:20 (6 years ago)
Author:
jon
Message:

Minor housekeeping changes and adding import statements for ManifestErrors?

Location:
collective.imstransport/trunk/collective/imstransport
Files:
1 added
6 edited

Legend:

Unmodified
Added
Removed
  • collective.imstransport/trunk/collective/imstransport/utilities/imscc/ccreader.py

    r175 r186  
    11from xml.dom import minidom 
     2from collective.imstransport.IMS_exceptions import ManifestError 
    23 
    34class CCReader(object): 
  • collective.imstransport/trunk/collective/imstransport/utilities/imscc/ccresourcereader.py

    r166 r186  
    11from xml.dom import minidom 
     2from collective.imstransport.IMS_exceptions import ManifestError 
    23 
    34LOM_namespace = 'http://ltsc.ieee.org/xsd/LOM' 
     
    173174            tec_node = tec_nodes[0] 
    174175 
    175         format_nodes = tec_node.getElementsByTagNameNS(LOM_namespace, 'format') 
    176         if format_nodes: 
    177             format = self.reader.getTextValue(format_nodes[0]) 
    178             if format: 
    179                 self.resdict['Format'] = format 
     176            format_nodes = tec_node.getElementsByTagNameNS(LOM_namespace, 'format') 
     177            if format_nodes: 
     178                format = self.reader.getTextValue(format_nodes[0]) 
     179                if format: 
     180                    self.resdict['Format'] = format 
    180181 
    181182    def readRights(self): 
     
    187188        if rights_nodes: 
    188189            rights_node = rights_nodes[0] 
    189  
    190         description_nodes = rights_node.getElementsByTagNameNS(LOM_namespace,'description') 
    191         if description_nodes: 
    192             langstring_nodes = description_nodes[0].getElementsByTagNameNS(LOM_namespace,'langstring') 
    193             if langstring_nodes: 
    194                 description = self.reader.getTextValue(langstring_nodes[0]) 
    195                 if description: 
    196                     self.resdict['rights'] = description 
     190            description_nodes = rights_node.getElementsByTagNameNS(LOM_namespace,'description') 
     191            if description_nodes: 
     192                langstring_nodes = description_nodes[0].getElementsByTagNameNS(LOM_namespace,'langstring') 
     193                if langstring_nodes: 
     194                    description = self.reader.getTextValue(langstring_nodes[0]) 
     195                    if description: 
     196                        self.resdict['rights'] = description 
    197197 
    198198    def getFilePaths(self): 
  • collective.imstransport/trunk/collective/imstransport/utilities/imscc/imsccreader.py

    r172 r186  
    3030             return False, 'Internal error. No source object specified' 
    3131 
    32         ccreader = CCReader(context, source) 
     32        ccreader = CCReader() 
    3333              
    3434        manifest = source.readManifest() 
  • collective.imstransport/trunk/collective/imstransport/utilities/imscp/cpreader.py

    r176 r186  
    11from xml.dom import minidom 
     2from collective.imstransport.IMS_exceptions import ManifestError 
    23 
    34class CPReader(object): 
  • collective.imstransport/trunk/collective/imstransport/utilities/imscp/cpresourcereader.py

    r176 r186  
    11from xml.dom import minidom 
     2from collective.imstransport.IMS_exceptions import ManifestError 
    23 
    34LOM_namespace = 'http://www.imsglobal.org/xsd/imsmd_v1p2' 
  • collective.imstransport/trunk/collective/imstransport/utilities/mit/mitresourcereader.py

    r177 r186  
    11from xml.dom import minidom 
    22from collective.imstransport.utilities.imscp.cpresourcereader import CPResourceReader 
     3from collective.imstransport.IMS_exceptions import ManifestError 
    34 
    45LOM_namespace = "http://ocw.mit.edu/xmlns/LOM" 
Note: See TracChangeset for help on using the changeset viewer.