Exemplo n.º 1
0
	def __init__ (self, idList):
		self.idList = idList
		self.idList.sort()
		for id in self.idList:
			path = webcatUtils.getRecordPath(id)
			rp = self.rpClass (path)
			self.process (rp)
Exemplo n.º 2
0
 def write(self, metadata_set):
     path = webcatUtils.getRecordPath(self.recId, metadata_set)
     dir = os.path.dirname(path)
     if not os.path.exists(dir):
         os.makedirs(dir)
     self.lib_dc_rec.write(path=path)
     print "wrote %s (%s)" % (self.recId, metadata_set)
Exemplo n.º 3
0
	def _getWebcatRec (self, recId):
		"""
		get webcat record with id=recId
		"""
		# path = os.path.join (globals.metadata, "webcat", self.collection, recId+'.xml')
		path = webcatUtils.getRecordPath (recId, "webcat")
		return WebcatRec (path=path)
Exemplo n.º 4
0
	def _getNCARLibraryDCRec (self, recId):
		"""
		get ncar library record with id=recId
		"""
		# path = os.path.join (globals.metadata, "ncar_library_dc", self.collection, recId+'.xml')
		path = webcatUtils.getRecordPath (recId, "ncar_library_dc")
		return LibraryDCRec (path)
Exemplo n.º 5
0
def recordProcessorTester(recId):
    verbose = 0
    path = webcatUtils.getRecordPath(recId)

    rp = MassagingRecordProcessor(path, 0)
    print "\nBEFORE"
    callback(rp)

    rp = MassagingRecordProcessor(path, 1)
    print "\nAFTER"
    callback(rp)
Exemplo n.º 6
0
 def __init__(self, idList, rpFunction):
     self.idList = idList
     self.idList.sort()
     self.rpFunction = rpFunction
     for id in self.idList:
         path = webcatUtils.getRecordPath(id)
         try:
             rp = self.rpClass(path)
         except:
             print "ERROR: %s could not be instantiated: %s" % (
                 id, sys.exc_info()[1])
             continue
         self.process(rp)
Exemplo n.º 7
0
def recordProcessorFinal(recId):
    verbose = 0
    path = webcatUtils.getRecordPath(recId)

    rp = MassagingRecordProcessor(path, 1)
    callback(rp)
Exemplo n.º 8
0
        if self.title:
            issue, title = self.issueTitleSplit(self.title)
            if issue:
                self.issue = issue
                self.title = title

    def issueTitleSplit(self, input):
        # if not hasattr (self, 'fullTitle'): return None
        # print "\n fullTitle: %s" % self.fullTitle
        issue = None
        title = None

        if not self.recordID in globals.issueTitleSkipList:
            m = self.issue_delimiter.match(input)
            if m:
                issue = m.group('issue').strip()
                title = m.group('title').strip()

        return issue, title


if __name__ == "__main__":
    # id = "TECH-NOTE-000-000-000-007"
    id = "MANUSCRIPT-000-000-000-805"

    path = webcatUtils.getRecordPath(id, "webcat")
    rec = WebcatRec(path=path)
    # print rec
    print "title: " + rec.title
    print "issue: " + rec.issue
Exemplo n.º 9
0
def recordProcessorTester ():
	id = "TECH-NOTE-000-000-000-006"
	path = webcatUtils.getRecordPath (id)
	# path = os.path.join (globals.metadata, "library_dc/technotes", "TECH-NOTE-000-000-000-006.xml")
	rp = RecordProcessor (path)
	print rp.recId