Elegant way to auto_register things in different sections?
See original GitHub issueI have my checks divided up into multiple modules and one extra module to tie them together like this:
import fontbakery.checkrunner
import fontbakery.specifications.ufo_sources
import damacheck.constants
import damacheck.dama_conditions
import damacheck.ufo.anchors
import damacheck.ufo.components
import damacheck.ufo.conditions
import damacheck.ufo.hinting
import damacheck.ufo.kerning
import damacheck.ufo.misc
import damacheck.ufo.outline
import damacheck.ufo.spacing
import damacheck.ufo.unicode
import damacheck.util
specification = fontbakery.specifications.ufo_sources.UFOSpec(
iterargs={"font": "fonts"},
derived_iterables={"ufo_fonts": ("ufo_font", True)},
)
specification.merge_specification(fontbakery.specifications.ufo_sources.specification)
specification.auto_register(globals())
specification.auto_register(damacheck.dama_conditions.__dict__)
specification.auto_register(damacheck.ufo.conditions.__dict__)
specification._default_section = fontbakery.checkrunner.Section("Anchors")
specification.auto_register(damacheck.ufo.anchors.__dict__)
specification._default_section = fontbakery.checkrunner.Section("Components")
specification.auto_register(damacheck.ufo.components.__dict__)
specification._default_section = fontbakery.checkrunner.Section("Hinting")
specification.auto_register(damacheck.ufo.hinting.__dict__)
specification._default_section = fontbakery.checkrunner.Section("Kerning")
specification.auto_register(damacheck.ufo.kerning.__dict__)
specification._default_section = fontbakery.checkrunner.Section("Miscellaneous")
specification.auto_register(damacheck.ufo.misc.__dict__)
specification._default_section = fontbakery.checkrunner.Section("Outlines")
specification.auto_register(damacheck.ufo.outline.__dict__)
specification._default_section = fontbakery.checkrunner.Section("Spacing")
specification.auto_register(damacheck.ufo.spacing.__dict__)
specification._default_section = fontbakery.checkrunner.Section("Unicode")
specification.auto_register(damacheck.ufo.unicode.__dict__)
specification._default_section = None
specification.test_expected_checks(
[
"com.daltonmaag/check/ufolint",
"com.daltonmaag/check/ufo-required-fields",
"com.daltonmaag/check/ufo-recommended-fields",
"com.daltonmaag/check/ufo-unnecessary-fields",
]
)
I want to put each module into its own section to make it easier to generate a report ordered by sections. auto_register
just dumps stuff into the default section, so I’m setting the default section manually. Is there a more elegant way or should I extend auto_register
?
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
C# make class auto-register - Stack Overflow
The only way around that would be to give up on modularity, and make all of the different "things" that happen to types...
Read more >Auto register classes - Jon L. Aasenden - WordPress.com
In short: If you are serializing objects to JSon, you probably know that Delphi can only re-create those objects if it knows the...
Read more >CUCM Auto-registration Process In Mixed Mode - Cisco
This document describes the procedure to enable autoregistration on Cisco Unified Communication Manager (CUCM) 11.5.x and above in the ...
Read more >Work With Section Node | Article - Wiki GeneXus
Smart Devices Applications Development (GeneXus 16) ... Auto-register anonymous user - How to identify auto-registered users · Auto-register ...
Read more >2 Active agent autoregistration - Zabbix
A secure way of autoregistration is possible by configuring PSK-based ... You have active Zabbix agents (see "Configuration" section above) on your network....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Interdasting. More digging tomorrow. Giving the section a sensible name would be nice though, maybe I can think of something nice.
Probably. Will reopen if I can’t make it work.