Changeset 4487 for exist


Ignore:
Timestamp:
24/11/08 17:15:57 (11 years ago)
Author:
cbyrom
Message:

Further restructure of codebase - moving datamodels into ndgUtils to allow reuse + create visualise and browse sub structures to better
organise related code. Separate out some inner classes into their own
modules to make more visible.

Location:
exist/trunk/python/ndgUtils
Files:
2 added
1 edited
6 moved

Legend:

Unmodified
Added
Removed
  • exist/trunk/python/ndgUtils/models/AccessControl.py

    r4469 r4487  
    1 from milk_server.lib.Utilities import wrapGetText 
     1from ndgUtils.models.utilities import wrapGetText 
    22class AccessControl: 
    33         
  • exist/trunk/python/ndgUtils/models/DIF.py

    r4469 r4487  
    22# renderEntity etc ... 
    33# 
    4 from milk_server.lib.Utilities import * 
    5 from milk_server.lib.geoUtilities import * 
     4from ndgUtils.models.utilities import formatDateYYYY 
     5from ndgUtils.models.molesbounding import Bounding as Bounding 
    66from People2 import * 
    77from AccessControl import AccessControl 
     
    1010from ndgUtils.ndgObject import ndgObject 
    1111from stubB import collapse2 
    12 import urllib 
     12import urllib, logging 
    1313 
    1414try: #python 2.5 
     
    4444        '''Initialise a python dif instance based on an xml document (expected 
    4545        to be an input string if et=0, otherwise an ElementTree instance) ''' 
     46        logging.info("Setting up DIF data model") 
    4647        if et: 
    4748            try: 
     
    157158        # Let's first see if we get an author out of the citation, 
    158159        self.authors=helper.getText(self.tree,'Data_Set_Citation/Dataset_Creator')  
    159         self.date=dateParse(helper.getText(self.tree,'Data_Set_Citation/Dataset_Release_Date'),'YYYY') 
    160         #if self.date=='': self.date='XXXX' 
     160        self.date=formatDateYYYY(helper.getText(self.tree,'Data_Set_Citation/Dataset_Release_Date')) 
    161161        self.title=helper.getText(self.tree,'Data_Set_Citation/Dataset_Title') 
    162162        self.briefCitation='' 
     
    213213            else: self.binding=None 
    214214        if self.debug: 
    215            f=open('difs.log','a') 
    216            f.write('%s##\n%s\n##################################\n'%(self.entryID,self.xml)) 
    217            f.close() 
    218  
    219          
     215            f=open('difs.log','a') 
     216            f.write('%s##\n%s\n##################################\n'%(self.entryID,self.xml)) 
     217            f.close() 
     218             
     219        logging.info("DIF data model set up") 
     220 
     221         
  • exist/trunk/python/ndgUtils/models/People.py

    r4469 r4487  
    1 from milk_server.lib.Utilities import wrapGetText 
     1from ndgUtils.models.utilities import wrapGetText 
    22from ndgUtils.ETxmlView import nsdumb 
    33from milk_server.lib.htmlUtilities import * 
  • exist/trunk/python/ndgUtils/models/stubB.py

    r4469 r4487  
    88#  
    99 
    10 from milk_server.lib.Utilities import * 
     10from ndgUtils.models.utilities import wrapGetText 
    1111from ndgUtils.BeautifulSoup import BeautifulSoup 
    1212from AccessControl import AccessControl 
    13 from milk_server.lib.geoUtilities import Bounding 
     13from ndgUtils.models.molesbounding import Bounding as Bounding 
    1414from People import * 
    1515from ndgUtils import ndgObject 
  • exist/trunk/python/ndgUtils/ndgObject.py

    r4484 r4487  
    106106 
    107107        # set default return format - if not set, just return in original format 
    108         fmt='' 
    109         if self.config.has_option('DISCOVERY','formatDefault'): 
    110             fmt = self.config.get('DISCOVERY','formatDefault') 
    111             logging.info("Default discovery format set to: %s" %fmt) 
     108        fmt = self.config.get('DISCOVERY','formatDefault') 
     109        logging.info("Default discovery format set to: %s" %fmt) 
    112110             
    113111        self.BURL=None 
     
    120118        # config file should have details on the service to use for the repository 
    121119        # - if not, default to 'unknown' 
    122         servicehost = 'unknown' 
    123         if self.config.has_option('NDG_B_SERVICE',self.repository): 
    124                 servicehost = self.config.get('NDG_B_SERVICE',self.repository) 
     120        servicehost = self.config.get('NDG_B_SERVICE',self.repository) 
     121        if not servicehost: 
     122            servicehost = 'unknown' 
    125123             
    126124        # If this record is itself a discovery record, then we don't have much more to do 
Note: See TracChangeset for help on using the changeset viewer.