Return a new spontaneous environment. A spontaneous environment is an unnamed and unaccessible (in theory) environment that is used for templates generated from a string and not from the file system.
(*args)
| 42 | |
| 43 | |
| 44 | def get_spontaneous_environment(*args): |
| 45 | """Return a new spontaneous environment. A spontaneous environment is an |
| 46 | unnamed and unaccessible (in theory) environment that is used for |
| 47 | templates generated from a string and not from the file system. |
| 48 | """ |
| 49 | try: |
| 50 | env = _spontaneous_environments.get(args) |
| 51 | except TypeError: |
| 52 | return Environment(*args) |
| 53 | if env is not None: |
| 54 | return env |
| 55 | _spontaneous_environments[args] = env = Environment(*args) |
| 56 | env.shared = True |
| 57 | return env |
| 58 | |
| 59 | |
| 60 | def create_cache(size): |
no test coverage detected
searching dependent graphs…