diff options
author | svidyuk <svidyuk@yandex-team.ru> | 2022-02-10 16:47:12 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:47:12 +0300 |
commit | e23df0602fedd83374b43b6137a296baa2aad3f6 (patch) | |
tree | 1facb78b6535ac70f17ba39ed606d949f932fcea /build/plugins/res.py | |
parent | 92661c40a019d4809586c8ce322075d197427346 (diff) | |
download | ydb-e23df0602fedd83374b43b6137a296baa2aad3f6.tar.gz |
Restoring authorship annotation for <svidyuk@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'build/plugins/res.py')
-rw-r--r-- | build/plugins/res.py | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/build/plugins/res.py b/build/plugins/res.py index a937caba816..ec8e2801f7b 100644 --- a/build/plugins/res.py +++ b/build/plugins/res.py @@ -28,12 +28,12 @@ def split(lst, limit): yield bucket -def remove_prefix(text, prefix): - if text.startswith(prefix): - return text[len(prefix):] - return text - - +def remove_prefix(text, prefix): + if text.startswith(prefix): + return text[len(prefix):] + return text + + def onfat_resource(unit, *args): unit.onpeerdir(['library/cpp/resource']) @@ -56,7 +56,7 @@ def onresource_files(unit, *args): This macro expands into RESOURCE([DONT_PARSE] {path} resfs/file/{prefix}{path} - - resfs/src/resfs/file/{prefix}{remove_prefix(path, prefix_to_strip)}={rootrel_arc_src(path)} + - resfs/src/resfs/file/{prefix}{remove_prefix(path, prefix_to_strip)}={rootrel_arc_src(path)} ) resfs/src/{key} stores a source root (or build root) relative path of the @@ -74,7 +74,7 @@ def onresource_files(unit, *args): @see: https://wiki.yandex-team.ru/devtools/commandsandvars/resourcefiles/ """ prefix = '' - prefix_to_strip = None + prefix_to_strip = None dest = None res = [] first = 0 @@ -92,11 +92,11 @@ def onresource_files(unit, *args): prefix, dest = next(args), None elif arg == 'DEST': dest, prefix = next(args), None - elif arg == 'STRIP': - prefix_to_strip = next(args) + elif arg == 'STRIP': + prefix_to_strip = next(args) else: path = arg - key = 'resfs/file/' + (dest or (prefix + (path if not prefix_to_strip else remove_prefix(path, prefix_to_strip)))) + key = 'resfs/file/' + (dest or (prefix + (path if not prefix_to_strip else remove_prefix(path, prefix_to_strip)))) src = 'resfs/src/{}={}'.format(key, rootrel_arc_src(path, unit)) res += ['-', src, path, key] |