예제 #1
0
 def init_deposit(self, paper, user):
     """
     Refuse deposit when the paper is already on Zenodo
     """
     super(ZenodoProtocol, self).init_deposit(paper, user)
     for r in paper.oairecords:
         domain = extract_domain(r.splash_url)
         if domain.endswith('zenodo.org'):
             return False
     return True
예제 #2
0
 def init_deposit(self, paper, user):
     """
     Refuse deposit when the paper is already on OSF.
     """
     super(OSFProtocol, self).init_deposit(paper, user)
     for r in paper.oairecords:
         domain = extract_domain(r.splash_url) or ''
         if domain.endswith('osf.io'):
             return False
     return (True)
예제 #3
0
파일: protocol.py 프로젝트: Phyks/dissemin
 def init_deposit(self, paper, user):
     """
     Refuse deposit when the paper is already on OSF.
     """
     super(OSFProtocol, self).init_deposit(paper, user)
     for r in paper.oairecords:
         domain = extract_domain(r.splash_url) or ''
         if domain.endswith('osf.io'):
             return False
     return (True)
예제 #4
0
파일: protocol.py 프로젝트: Phyks/dissemin
 def init_deposit(self, paper, user):
     """
     Refuse deposit when the paper is already on Zenodo
     """
     super(ZenodoProtocol, self).init_deposit(paper, user)
     for r in paper.oairecords:
         domain = extract_domain(r.splash_url) or ''
         if domain.endswith('zenodo.org'):
             return False
     return True
예제 #5
0
파일: protocol.py 프로젝트: Phyks/dissemin
    def init_deposit(self, paper, user):
        """
        We reject in advance papers that are already in HAL
        """
        super(HALProtocol, self).init_deposit(paper,user)
        for r in paper.oairecords:
            domain = extract_domain(r.splash_url) or ''
            if ('oai:HAL:' in r.identifier or
                domain.endswith('archives-ouvertes.fr')):
                return False

        self.hal_preferences = self.get_preferences(user)
        return True
예제 #6
0
    def init_deposit(self, paper, user):
        """
        We reject in advance papers that are already in HAL
        """
        super(HALProtocol, self).init_deposit(paper, user)
        for r in paper.oairecords:
            domain = extract_domain(r.splash_url) or ''
            if ('oai:HAL:' in r.identifier
                    or domain.endswith('archives-ouvertes.fr')):
                return False

        self.hal_preferences = self.get_preferences(user)
        return True
예제 #7
0
파일: domain.py 프로젝트: tarsbase/dissemin
def domain(url):
    domain = extract_domain(url)
    if domain:
        return mark_safe(escape(domain))
    else:
        return mark_safe('')
예제 #8
0
 def test_extract_domain(self):
     self.assertEqual(extract_domain('https://gnu.org/test.html'), 'gnu.org')
     self.assertTrue(extract_domain('nonsense') is None)
예제 #9
0
파일: domain.py 프로젝트: Phyks/dissemin
def domain(url):
    domain = extract_domain(url)
    if domain:
        return mark_safe(escape(domain))
    else:
        return mark_safe('')