Skip to content

Commit

Permalink
refactor(db)!: remove SourceObject.iter_virtual_sources from our API
Browse files Browse the repository at this point in the history
BREAKING CHANGE: though a search of Lektor plugins on GitHub and PyPI
did not find any instance where a non-empty `iter_virtual_sources` was
defined
  • Loading branch information
dairiki committed Feb 26, 2023
1 parent 91e205c commit 751730d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
4 changes: 2 additions & 2 deletions lektor/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -1513,8 +1513,8 @@ def track_record_dependency(self, record):
else:
affects_url = True
ctx.record_dependency(filename, affects_url=affects_url)
for virtual_source in record.iter_virtual_sources():
ctx.record_virtual_dependency(virtual_source)
if isinstance(record, VirtualSourceObject):
ctx.record_virtual_dependency(record)
if getattr(record, "datamodel", None) and record.datamodel.filename:
ctx.record_dependency(record.datamodel.filename)
for dep_model in self.iter_dependent_models(record.datamodel):
Expand Down
7 changes: 0 additions & 7 deletions lektor/sourceobj.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,6 @@ def iter_source_filenames(self):
if fn is not None:
yield self.source_filename

def iter_virtual_sources(self):
# pylint: disable=no-self-use
return []

@property
def url_path(self):
"""The URL path of this source object if available."""
Expand Down Expand Up @@ -237,6 +233,3 @@ def alt(self):
@property
def source_filename(self):
return self.record.source_filename

def iter_virtual_sources(self):
yield self

0 comments on commit 751730d

Please sign in to comment.