Return the absolute path of the given file in the project directory. For instance: path('src/main/python'). The `path_str` argument should always use forward slashes `/`, even on Windows. You can use placeholders to refer to settings. For example: path('${freeze_dir}/foo').
(path_str)
| 43 | SETTINGS.update(load_settings(json_paths, core_settings)) |
| 44 | |
| 45 | def path(path_str): |
| 46 | """ |
| 47 | Return the absolute path of the given file in the project directory. For |
| 48 | instance: path('src/main/python'). The `path_str` argument should always use |
| 49 | forward slashes `/`, even on Windows. You can use placeholders to refer to |
| 50 | settings. For example: path('${freeze_dir}/foo'). |
| 51 | """ |
| 52 | path_str = expand_placeholders(path_str, SETTINGS) |
| 53 | try: |
| 54 | project_dir = SETTINGS['project_dir'] |
| 55 | except KeyError: |
| 56 | error_message = "Cannot call path(...) until fbs.init(...) has been " \ |
| 57 | "called." |
| 58 | raise FbsError(error_message) from None |
| 59 | return _source.path(project_dir, path_str) |