Skip to content

Commit

Permalink
Always use default load filters on load
Browse files Browse the repository at this point in the history
  • Loading branch information
simoncozens committed Jun 3, 2024
1 parent 49de973 commit 3832d51
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/babelfont/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def main():

try:
logger.info("Reading %s", args.input)
font = convertor_in.load(input_job)
font = convertor_in.load(input_job, filters=False)
except Exception as e:
logger.error("Couldn't read %s: %s", args.input, e)
sys.exit(1)
Expand Down
10 changes: 8 additions & 2 deletions src/babelfont/convertors/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import logging

from babelfont.Font import Font
from babelfont.fontFilters import parse_filter

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -34,15 +35,20 @@ def can_save(cls, other, **kwargs):
return other.filename.endswith(cls.suffix)

@classmethod
def load(cls, convertor, compile_only=False):
def load(cls, convertor, compile_only=False, filters=True):
self = cls()
self.font = Font()
# Pass on information to child
self.filename = convertor.filename
self.scratch = convertor.scratch
self.compile_only = compile_only
loaded = self._load()
if filters:
for f in cls.LOAD_FILTERS:
fltr, filterargs = parse_filter(f)
fltr(loaded, filterargs)

return self._load()
return loaded

@classmethod
def save(cls, obj, convertor, **kwargs):
Expand Down

0 comments on commit 3832d51

Please sign in to comment.