def iter_unreferenced_artifacts(self, all=False):
        dst = os.path.join(self.builder.destination_path)

        con = self.connect_to_database()
        cur = con.cursor()

        try:
            for dirpath, dirnames, filenames in os.walk(dst):
                dirnames[:] = [x for x in dirnames
                               if not self.env.is_ignored_artifact(x)]
                for filename in filenames:
                    if self.env.is_ignored_artifact(filename):
                        continue
                    full_path = os.path.join(dst, dirpath, filename)
                    artifact_name = self.artifact_name_from_destination_filename(
                        full_path)

                    if all:
                        yield artifact_name
                        continue

                    cur.execute('''
                        select source from artifacts
                         where artifact = ?
                           and is_primary_source''', [artifact_name])
                    sources = set(x[0] for x in cur.fetchall())

                    # It's a bad artifact if there are no primary sources
                    # or the primary sources do not exist.
                    if not sources or not any(self.get_file_info(x).exists
                                              for x in sources):
                        yield artifact_name
        finally:
            con.close()
Events that start and end on different days shouldn't
dataset/ETHPy150Open lektor/lektor/lektor/builder.py/BuildState.iter_unreferenced_artifacts--crossover with--dataset/ETHPy150Open wreckage/django-happenings/tests/unit_tests/test_models.py/EventModelTest.test_err_chunk_repeat_weekday_daily