Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Evolve the empy templates to applications #30

Open
francocipollone opened this issue Aug 24, 2023 · 0 comments
Open

Evolve the empy templates to applications #30

francocipollone opened this issue Aug 24, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@francocipollone
Copy link
Contributor

francocipollone commented Aug 24, 2023

Summary

Nowadays we are using empy templates to obtain xodr descriptions.

Proposal

We could embed the empy interpreter in python applications

Take a look at http://www.alcyone.com/software/empy/#Embedding-Empy

        import em
        interpreter = em.Interpreter()
        # The following prints the results to stdout:
        interpreter.string("@{x = 123}@x\n")
        # This expands to the same thing, but puts the results as a
        # string in the variable result:
        result = interpreter.expand("@{x = 123}@x\n")
        # This just prints the value of x directly:
        print interpreter.globals['x']
        # Process an actual file (and output to stdout):
        interpreter.file(open('/path/to/some/file'))
        interpreter.shutdown() # this is important; see below

Benefits

  • Create xodr file and geojson files
  • Easier to receive arguments instead of using environment variables
  • Creation of python modules that are shared among the templates

Related issues

#12

@francocipollone francocipollone added the enhancement New feature or request label Aug 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant