Exemple #1
0
    def _changed_entries_by_pattern(self, pattern):
        changed_entries = self._changed_entries()
        filtered_paths = [
            funky.first_true(names) for names, modes, sha in changed_entries
            if tuple(map(bool, names)) == pattern and funky.first_true(names)
        ]

        return filtered_paths
Exemple #2
0
    def _changed_entries_by_pattern(self, pattern):
        changed_entries = self._changed_entries()
        filtered_paths = [
            funky.first_true(names)
            for names, modes, sha in changed_entries
            if tuple(map(bool, names)) == pattern and funky.first_true(names)
        ]

        return filtered_paths
Exemple #3
0
 def _changed_entries_by_pattern(self, pattern):
     changed_entries = self._changed_entries()
     filtered_paths = None
      #if the pattern is PATTERN_MODIFIED, should check the sha
     if self.PATTERN_MODIFIED == pattern:
         filtered_paths = [
           funky.first_true(names)
               for names, modes, sha in changed_entries
               if tuple(map(bool, names)) == pattern and funky.first_true(names) and sha[0] == sha[1]
         ]
     else :
         filtered_paths = [
            funky.first_true(names)
              for names, modes, sha in changed_entries
              if tuple(map(bool, names)) == pattern and funky.first_true(names)
         ]
     return filtered_paths
Exemple #4
0
def get_protocol(url):
    schemers = [
        is_git_url,
        is_ssh_url,
        is_http_url,
    ]

    parsed = urlparse(url)

    try:
        return first_true([schemer(url, parsed) for schemer in schemers])
    except:
        pass
    return None
Exemple #5
0
def get_protocol(url):
    schemers = [
        is_git_url,
        is_ssh_url,
        is_http_url,
    ]

    parsed = urlparse(url)

    try:
        return first_true([
            schemer(url, parsed)
            for schemer in schemers
        ])
    except:
        pass
    return None