mirror of
https://github.com/servo/servo.git
synced 2025-07-18 21:03:45 +01:00
script: Use Pythonic file names for code generation and use functools.cache
(#38047)
Renames the files to pythonic file names. Also replaces the bespoke caching function with the functools caching function which is functionally equivalent. --------- Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
This commit is contained in:
parent
8a19bc9145
commit
ac2cfdb801
3 changed files with 6 additions and 26 deletions
|
@ -27,8 +27,8 @@ def main():
|
|||
config_file = "Bindings.conf"
|
||||
|
||||
import WebIDL
|
||||
from Configuration import Configuration
|
||||
from CodegenRust import CGBindingRoot, CGConcreteBindingRoot
|
||||
from configuration import Configuration
|
||||
from codegen import CGBindingRoot, CGConcreteBindingRoot
|
||||
|
||||
parser = WebIDL.Parser(make_dir(os.path.join(out_dir, "cache")))
|
||||
webidls = [name for name in os.listdir(webidls_dir) if name.endswith(".webidl")]
|
||||
|
@ -91,7 +91,7 @@ def make_dir(path):
|
|||
|
||||
|
||||
def generate(config, name, filename):
|
||||
from CodegenRust import GlobalGenRoots
|
||||
from codegen import GlobalGenRoots
|
||||
root = getattr(GlobalGenRoots, name)(config)
|
||||
code = root.define()
|
||||
with open(filename, "wb") as f:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue