Project

General

Profile

« Previous | Next » 

Revision 51703

fix identifier error

View differences:

modules/dli-service-portal/trunk/eu/dnetlib/es_connector.py
36 36

  
37 37

  
38 38
def resolveIdentifier(pid, pid_type):
39

  
40

  
41 39
    if pid_type != None:
42 40
        regex = r"\b(10[.][0-9]{4,}(?:[.][0-9]+)*/(?:(?![\"&\'<>])\S)+)\b"
43 41
        if re.match(regex,pid):
44 42
            print "It should be doi"
45
            pid_type='doi'
46

  
47

  
48

  
43
            pid_type = 'doi'
49 44
        if pid_type.lower() in pid_resolver:
50 45
            return pid_resolver[pid_type.lower()] % pid
51 46
        else:
52 47
            if pid_type.lower() == 'openaire':
53 48
                return "https://www.openaire.eu/search/publication?articleId=%s" % pid.replace('oai:dnet:', '')
49
            elif pid_type.lower() == 'url':
50
                return  pid
54 51
            else:
55 52
                return "http://identifiers.org/%s:%s" % (pid_type, pid)
56 53
    return ""

Also available in: Unified diff