Changeset 8269 for mauRepo/MolesManager
- Timestamp:
- 20/04/12 10:40:54 (9 years ago)
- Location:
- mauRepo/MolesManager/trunk/src/libs/migration
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
mauRepo/MolesManager/trunk/src/libs/migration/MigrationEPB.py
r8254 r8269 54 54 def getAllDeploymentsMigrationByDataEntitySortedByDate(self, dataEntity, deploymentNames, session = None): 55 55 intSession = MigrationEPB._getSession(session) 56 return EPB.getAllObjects(DeploymentsMigration, intSession).filter(*[EPB.buildFilter('doc_owner', dataEntity.doc_owner)]).filter(DeploymentsMigration.doc_name.in_(deploymentNames)).order_by(asc("doc_creation")) 56 return EPB.getAllObjects(DeploymentsMigration, intSession).filter(DeploymentsMigration.doc_name.in_(deploymentNames)).order_by(asc("doc_creation")) 57 #return EPB.getAllObjects(DeploymentsMigration, intSession).filter(*[EPB.buildFilter('doc_owner', dataEntity.doc_owner)]).filter(DeploymentsMigration.doc_name.in_(deploymentNames)).order_by(asc("doc_creation")) 57 58 #return EPB.getAllObjects(DeploymentsMigration, intSession).filter(*[EPB.buildFilter('doc_status', dataEntity.doc_status)]).filter(*[EPB.buildFilter('doc_owner', dataEntity.doc_owner)]).filter(DeploymentsMigration.doc_name.in_(deploymentNames)).order_by(asc("doc_creation")) 58 59 … … 60 61 def _getMigrationObject(self, mo_type, doc_status, doc_owner, doc_name, session = None): 61 62 intSession = MigrationEPB._getSession(session) 62 return intSession.query(mo_type).filter(*[EPB.buildFilter('doc_status', doc_status)]).filter(*[EPB.buildFilter('doc_owner', doc_owner)]).filter(*[EPB.buildFilter('doc_name', doc_name)]).first() 63 return intSession.query(mo_type).filter(*[EPB.buildFilter('doc_name', doc_name)]).first() 64 #return intSession.query(mo_type).filter(*[EPB.buildFilter('doc_owner', doc_owner)]).filter(*[EPB.buildFilter('doc_name', doc_name)]).first() 65 #return intSession.query(mo_type).filter(*[EPB.buildFilter('doc_status', doc_status)]).filter(*[EPB.buildFilter('doc_owner', doc_owner)]).filter(*[EPB.buildFilter('doc_name', doc_name)]).first() 63 66 64 67 @classmethod -
mauRepo/MolesManager/trunk/src/libs/migration/exception/exceptions.py
r8258 r8269 6 6 7 7 def migrationObjectDescription(migrationObject): 8 if migrationObject is None: 9 raise Exception("Migration object is None") 8 10 try: 9 11 return "%s %s %s" % (migrationObject.doc_status, migrationObject.doc_owner, migrationObject.doc_name) 10 except (Exception, RuntimeError)as ex:12 except Exception as ex: 11 13 print ex 12 14 -
mauRepo/MolesManager/trunk/src/libs/migration/processor/commons.py
r8266 r8269 452 452 try: 453 453 linkLongName = link['href'].split('/')[-1] 454 linkName = linkLongName.rsplit('__ATOM__')[1] 454 if '__ATOM__' in linkLongName: 455 linkName = linkLongName.rsplit('__ATOM__')[1] 456 else: 457 linkName = linkLongName 455 458 dpt.append(linkName) 456 459 except Exception as ex: -
mauRepo/MolesManager/trunk/src/libs/migration/processor/dataEntity.py
r8266 r8269 27 27 log = logging.getLogger('DataEntityProcessor') 28 28 log.addHandler(StreamHandler()) 29 log.setLevel(logging. DEBUG)29 log.setLevel(logging.INFO) 30 30 ''' 31 31 Processes a DataEntityMigration item. Note that each DataEntity is associated to a "dataent_xxxx" file in Moles2 … … 110 110 ceda_guid.ceda_observationcollection = ceda_observationCollection.id 111 111 Moles3EPB.addCedaObject(ceda_guid, self.migrationSessions.molesSession, True) 112 DataEntityProcessor.log.info("GUI for this ObservationCollection: %s" % (ceda_guid.id)) 112 113 113 114 return ceda_observationCollection … … 132 133 133 134 deProcessor.assignDOI(ceda_observation, doi) 134 if doi: 135 DataEntityProcessor.log.info("DOI: %s" % (doi['href'][4:])) 135 136 136 137 137 self.migrationSessions.molesSession.commit() -
mauRepo/MolesManager/trunk/src/libs/migration/processor/deployment.py
r8266 r8269 59 59 log = logging.getLogger('DeploymentProcessor') 60 60 log.addHandler(StreamHandler()) 61 log.setLevel(logging. DEBUG)61 log.setLevel(logging.INFO) 62 62 def __init__(self, dataEntityMigration, deploymentMigration, migrationSessions): 63 63 ''' … … 176 176 177 177 if tmp_auth['author'] == 'unknown': 178 DeploymentProcessor.log. info("%s %s %s has unknown author" \178 DeploymentProcessor.log.debug("%s %s %s has unknown author" \ 179 179 % (whereAreAuthors.doc_status, whereAreAuthors.doc_owner, whereAreAuthors.doc_name)) 180 180 … … 339 339 cited_responsible = createCI_ResponsibleParty(role=CI_RoleCode.cl_publisher, \ 340 340 organizationName='NERC - British Atmospheric Data Centre') 341 if doi == '10.5285/E8F43A51-0198-4323-A926-FE69225D57DD':341 if doi.upper() == '10.5285/E8F43A51-0198-4323-A926-FE69225D57DD': 342 342 py_date = date(2011, 4, 1) 343 elif doi == '10.5285/78114093-E2BD-4601-8AE5-3551E62AEF2B':343 elif doi.upper() == '10.5285/78114093-E2BD-4601-8AE5-3551E62AEF2B': 344 344 py_date = date(2011, 11, 29) 345 elif doi == '10.5285/DB8D8981-1A51-4D6E-81C0-CCED9B921390':345 elif doi.upper() == '10.5285/DB8D8981-1A51-4D6E-81C0-CCED9B921390': 346 346 py_date = date(2012, 4, 16) 347 elif doi == '10.5285/639A3714-BC74-46A6-9026-64931F355E07':347 elif doi.upper() == '10.5285/639A3714-BC74-46A6-9026-64931F355E07': 348 348 py_date = date(2012, 4, 16) 349 349 … … 353 353 i_authority = createCI_Citation("DOI", date = ci_date) 354 354 identifier = createMD_Identifier(code = doi, authority=i_authority) 355 observation.identifier.append(identifier) 355 observation.identifier.append(identifier) 356 DeploymentProcessor.log.info("DOI: %s" % (doi['href'][4:])) 356 357 357 358 def _assignPublisherCurator(self, observation): … … 502 503 ceda_guid.ceda_observation = ceda_observation.id 503 504 Moles3EPB.addCedaObject(ceda_guid, self._migrationSessions.molesSession, True) 505 DeploymentProcessor.log.info("GUI for this Observation: %s" % (ceda_guid.id)) 504 506 505 507 return ceda_observation
Note: See TracChangeset
for help on using the changeset viewer.