Skip to content

Commit

Permalink
Simplify via getFileSystemBackend()
Browse files Browse the repository at this point in the history
  • Loading branch information
justvanrossum committed Mar 4, 2024
1 parent bc47d41 commit 25ebd55
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ repos:
args: ["--profile", "black"]

- repo: https://github.com/PyCQA/flake8
rev: 6.0.0
rev: 7.0.0
hooks:
- id: flake8

Expand Down
9 changes: 3 additions & 6 deletions src/fontra_compile/__main__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import argparse
import asyncio
import pathlib
from importlib.metadata import entry_points

from fontra.backends import getFileSystemBackend

from .builder import Builder

Expand All @@ -23,11 +24,7 @@ async def main_async():
args.glyph_names.replace(",", " ").split() if args.glyph_names else None
)

fileType = sourceFontPath.suffix.lstrip(".").lower()
backendEntryPoints = entry_points(group="fontra.filesystem.backends")
entryPoint = backendEntryPoints[fileType]
backendClass = entryPoint.load()
reader = backendClass.fromPath(sourceFontPath)
reader = getFileSystemBackend(sourceFontPath)
builder = Builder(reader, glyphNames)
await builder.setup()
ttFont = await builder.build()
Expand Down

0 comments on commit 25ebd55

Please sign in to comment.