示例#1
0
    def get_matching_rows(self, local=None, remote=None, status=None):
        """
        Returns a list of rows that match a `search_dict`.
        `search_dict` is a dictionary with a subset of the keys in a row.
        """
        test_row = {'local': local, 'remote': remote, 'status': status}
        test_row = filter_dict(lambda x: x is not None, test_row)
        test_row = construct_row_values(test_row)

        return [row for row in self.rows if subdict_matches(row, test_row)]
示例#2
0
    def get_matching_rows(self, local=None, remote=None, status=None):
        """
        Returns a list of rows that match a `search_dict`.
        `search_dict` is a dictionary with a subset of the keys in a row.
        """
        credless_remote = UncDirectory(remote.get_path()) if isinstance(remote, UncDirectory) else remote
        test_row = construct_row_values(
            remove_nones_in_dict({"local": local, "remote": credless_remote, "status": status})
        )

        return [row for row in self.rows if subdict_matches(row, test_row)]
    def get_matching_rows(self, local=None, remote=None, status=None):
        """
        Returns a list of rows that match a `search_dict`.
        `search_dict` is a dictionary with a subset of the keys in a row.
        """
        credless_remote = UncDirectory(remote.get_path()) if isinstance(
            remote, UncDirectory) else remote
        test_row = construct_row_values(
            remove_nones_in_dict({
                'local': local,
                'remote': credless_remote,
                'status': status
            }))

        return [row for row in self.rows if subdict_matches(row, test_row)]