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
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
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
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