Browse Source

Restoring authorship annotation for Anton Samokhvalov <pg83@yandex.ru>. Commit 1 of 2.

Anton Samokhvalov 3 years ago
parent
commit
72cb13b4af

+ 2 - 2
build/plugins/_common.py

@@ -105,8 +105,8 @@ def resolve_common_const(path):
     if path.startswith('${ARCADIA_BUILD_ROOT}'):
         return path.replace('${ARCADIA_BUILD_ROOT}', '$B', 1)
     return path
-
-
+ 
+ 
 def resolve_to_abs_path(path, source_root, build_root):
     if path.startswith('$S') and source_root is not None:
         return path.replace('$S', source_root, 1)

+ 12 - 12
build/plugins/_custom_command.py

@@ -1,7 +1,7 @@
 import subprocess
 import sys
-import os
-
+import os 
+ 
 import _common as common
 
 
@@ -25,29 +25,29 @@ class CustomCommand(object):
     def call(self, args, **kwargs):
         cwd = self._get_call_specs('cwd', kwargs)
         stdout_path = self._get_call_specs('stdout', kwargs)
-
+ 
         resolved_args = []
-
+ 
         for arg in args:
-            resolved_args.append(self.resolve_path(arg))
+            resolved_args.append(self.resolve_path(arg)) 
 
         if stdout_path:
             stdout = open(stdout_path, 'wb')
         else:
             stdout = None
 
-        env = os.environ.copy()
-        env['ASAN_OPTIONS'] = 'detect_leaks=0'
-
-        rc = subprocess.call(resolved_args, cwd=cwd, stdout=stdout, env=env)
+        env = os.environ.copy() 
+        env['ASAN_OPTIONS'] = 'detect_leaks=0' 
 
+        rc = subprocess.call(resolved_args, cwd=cwd, stdout=stdout, env=env) 
+ 
         if stdout:
             stdout.close()
         if rc:
             sys.exit(rc)
 
-    def resolve_path(self, path):
-        return common.resolve_to_abs_path(path, self._source_root, self._build_root)
+    def resolve_path(self, path): 
+        return common.resolve_to_abs_path(path, self._source_root, self._build_root) 
 
     def _get_call_specs(self, name, kwargs):
         if isinstance(kwargs, dict):
@@ -55,7 +55,7 @@ class CustomCommand(object):
             if param:
                 return self.resolve_path(param)
         return None
-
+ 
 
 def addrule(*unused):
     pass

+ 16 - 16
build/plugins/_import_wrapper.py

@@ -1,24 +1,24 @@
 try:
-    from ymake import CustomCommand as RealCustomCommand
+    from ymake import CustomCommand as RealCustomCommand 
     from ymake import addrule
     from ymake import addparser
-    from ymake import subst
-
-    class CustomCommand(RealCustomCommand):
-        def __init__(self, *args, **kwargs):
-            RealCustomCommand.__init__(*args, **kwargs)
-
-        def resolve_path(self, path):
-            return subst(path)
+    from ymake import subst 
 
+    class CustomCommand(RealCustomCommand): 
+        def __init__(self, *args, **kwargs): 
+            RealCustomCommand.__init__(*args, **kwargs) 
+ 
+        def resolve_path(self, path): 
+            return subst(path) 
+ 
 except ImportError:
     from _custom_command import CustomCommand  # noqa
     from _custom_command import addrule  # noqa
     from _custom_command import addparser  # noqa
-
-
-try:
-    from ymake import engine_version
-except ImportError:
-    def engine_version():
-        return -1
+ 
+ 
+try: 
+    from ymake import engine_version 
+except ImportError: 
+    def engine_version(): 
+        return -1 

+ 1 - 1
build/plugins/_unpickler.py

@@ -27,7 +27,7 @@ def main():
 
     assert (int(tools[0]) == len(tools[1:])), "tools quantity != tools number!"
 
-    cmd_object = pickle.loads(base64.b64decode(encoded_cmd))
+    cmd_object = pickle.loads(base64.b64decode(encoded_cmd)) 
 
     cmd_object.set_source_root(src_root)
     cmd_object.set_build_root(build_root)

+ 4 - 4
build/plugins/bundle.py

@@ -1,7 +1,7 @@
-import os
-
-
-def onbundle(unit, *args):
+import os 
+ 
+ 
+def onbundle(unit, *args): 
     """
         @usage BUNDLE(<Dir [NAME Name]>...)
 

+ 1 - 1
build/plugins/cp.py

@@ -1,5 +1,5 @@
 import os
-
+ 
 from _common import sort_by_keywords
 
 

+ 18 - 18
build/plugins/cpp_style.py

@@ -1,19 +1,19 @@
-import os
-
-from _common import sort_by_keywords
-
-
-def on_style(unit, *args):
-    def it():
-        yield 'DONT_PARSE'
-
-        for f in args:
-            f = f[len('${ARCADIA_ROOT}') + 1:]
-
-            if '/generated/' in f:
-                continue
-
-            yield f
+import os 
+ 
+from _common import sort_by_keywords 
+ 
+ 
+def on_style(unit, *args): 
+    def it(): 
+        yield 'DONT_PARSE' 
+ 
+        for f in args: 
+            f = f[len('${ARCADIA_ROOT}') + 1:] 
+ 
+            if '/generated/' in f: 
+                continue 
+ 
+            yield f 
             yield '/cpp_style/files/' + f
-
-    unit.onresource(list(it()))
+ 
+    unit.onresource(list(it())) 

+ 2 - 2
build/plugins/create_init_py.py

@@ -1,8 +1,8 @@
 import os
-
+ 
 from _common import sort_by_keywords
 
-
+ 
 def oncreate_init_py_structure(unit, *args):
     if unit.get('DISTBUILD'):
         return

+ 10 - 10
build/plugins/mx_archive.py

@@ -1,16 +1,16 @@
-def onmx_formulas(unit, *args):
+def onmx_formulas(unit, *args): 
     """
          @usage: MX_FORMULAS(BinFiles...) # deprecated, matrixnet
          Create MatrixNet formulas archive
     """
-    def iter_infos():
-        for a in args:
-            if a.endswith('.bin'):
+    def iter_infos(): 
+        for a in args: 
+            if a.endswith('.bin'): 
                 unit.on_mx_bin_to_info([a])
-                yield a[:-3] + 'info'
-            else:
-                yield a
-
-    infos = list(iter_infos())
-    unit.onarchive_asm(['NAME', 'MxFormulas'] + infos)
+                yield a[:-3] + 'info' 
+            else: 
+                yield a 
+ 
+    infos = list(iter_infos()) 
+    unit.onarchive_asm(['NAME', 'MxFormulas'] + infos) 
     unit.on_mx_gen_table(infos)

+ 12 - 12
build/plugins/pybuild.py

@@ -5,7 +5,7 @@ from hashlib import md5
 import ymake
 from _common import stripext, rootrel_arc_src, tobuilddir, listid, resolve_to_ymake_path, generate_chunks, pathid
 
-
+ 
 YA_IDE_VENV_VAR = 'YA_IDE_VENV'
 PY_NAMESPACE_PREFIX = 'py/namespace'
 BUILTIN_PROTO = 'builtin_proto'
@@ -16,7 +16,7 @@ def is_arc_src(src, unit):
         src.startswith('${CURDIR}/') or
         unit.resolve_arc_path(src).startswith('$S/')
     )
-
+ 
 def is_extended_source_search_enabled(path, unit):
     if not is_arc_src(path, unit):
         return False
@@ -28,7 +28,7 @@ def to_build_root(path, unit):
     if is_arc_src(path, unit):
         return '${ARCADIA_BUILD_ROOT}/' + rootrel_arc_src(path, unit)
     return path
-
+ 
 def uniq_suffix(path, unit):
     upath = unit.path()
     if '/' not in path:
@@ -168,7 +168,7 @@ def py_program(unit, py3):
         unit.onadd_check_py_imports()
 
 
-def onpy_srcs(unit, *args):
+def onpy_srcs(unit, *args): 
     """
         @usage PY_SRCS({| CYTHON_C} { | TOP_LEVEL | NAMESPACE ns} Files...)
 
@@ -201,10 +201,10 @@ def onpy_srcs(unit, *args):
     venv = unit.get(YA_IDE_VENV_VAR)
     need_gazetteer_peerdir = False
     trim = 0
-
+ 
     if not upath.startswith('contrib/tools/python') and not upath.startswith('library/python/runtime') and unit.get('NO_PYTHON_INCLS') != 'yes':
         unit.onpeerdir(['contrib/libs/python'])
-
+ 
     unit_needs_main = unit.get('MODULE_TYPE') in ('PROGRAM', 'DLL')
     if unit_needs_main:
         py_program(unit, py3)
@@ -222,7 +222,7 @@ def onpy_srcs(unit, *args):
     cython_directives = []
     if cython_coverage:
         cython_directives += ['-X', 'linetrace=True']
-
+ 
     pyxs_c = []
     pyxs_c_h = []
     pyxs_c_api_h = []
@@ -236,7 +236,7 @@ def onpy_srcs(unit, *args):
     evs = []
     fbss = []
     py_namespaces = {}
-
+ 
     dump_dir = unit.get('PYTHON_BUILD_DUMP_DIR')
     dump_output = None
     if dump_dir:
@@ -324,7 +324,7 @@ def onpy_srcs(unit, *args):
                 ymake.report_configure_error('TOP_LEVEL __main__.py is not allowed in PY3_PROGRAM')
 
             pathmod = (path, mod)
-
+ 
             if dump_output is not None:
                 dump_output.write('{path}\t{module}\n'.format(path=rootrel_arc_src(path, unit), module=mod))
 
@@ -493,10 +493,10 @@ def onpy_srcs(unit, *args):
         py_runtime_path = 'contrib/python/protobuf'
         builtin_proto_path = cpp_runtime_path + '/' + BUILTIN_PROTO
 
-    if protos:
+    if protos: 
         if not upath.startswith(py_runtime_path) and not upath.startswith(builtin_proto_path):
             unit.onpeerdir(py_runtime_path)
-
+ 
         unit.onpeerdir(unit.get("PY_PROTO_DEPS").split())
 
         proto_paths = [path for path, mod in protos]
@@ -514,7 +514,7 @@ def onpy_srcs(unit, *args):
         unit.onpeerdir([cpp_runtime_path])
         unit.on_generate_py_evs_internal([path for path, mod in evs])
         unit.onpy_srcs([ev_arg(path, mod, unit) for path, mod in evs])
-
+ 
     if fbss:
         unit.onpeerdir(unit.get('_PY_FBS_DEPS').split())
         pysrc_base_name = listid(fbss)

Some files were not shown because too many files changed in this diff