blob: dc1be399b32b8f8e8198feee8f9394484238642a (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
import os
import ymake
def onregister_sandbox_import(unit, *args):
args = iter(args)
for path in args:
path = os.path.normpath(path)
source = unit.resolve_arc_path(path)
abs_source = unit.resolve(source)
if not os.path.exists(abs_source):
ymake.report_configure_error('REGISTER_SANDBOX_IMPORT: File or directory {} does not exists'.format(path))
splited_path = path.split(os.sep)
l, r = 0, len(splited_path)
if splited_path[-1] == "__init__.py":
r -= 1
if not splited_path[0]:
l += 1
path = ".".join(splited_path[l:r])
unit.onresource(["-", "{}.{}={}".format("SANDBOX_TASK_REGISTRY", path, path)])
|