Browse Source

Restoring authorship annotation for <snowball@yandex-team.ru>. Commit 1 of 2.

snowball 3 years ago
parent
commit
4d57126b1b

+ 1 - 1
build/external_resources/codenavigation/ya.make

@@ -1,4 +1,4 @@
-OWNER(g:yatool)
+OWNER(g:yatool) 
 
 
 RESOURCES_LIBRARY()
 RESOURCES_LIBRARY()
 
 

+ 3 - 3
build/plugins/_common.py

@@ -185,9 +185,9 @@ def filter_out_by_keyword(test_data, keyword):
     return list(_iterate())
     return list(_iterate())
 
 
 
 
-def generate_chunks(lst, chunk_size):
+def generate_chunks(lst, chunk_size): 
-    for i in xrange(0, len(lst), chunk_size):
+    for i in xrange(0, len(lst), chunk_size): 
-        yield lst[i:(i + chunk_size)]
+        yield lst[i:(i + chunk_size)] 
 
 
 
 
 def strip_roots(path):
 def strip_roots(path):

+ 37 - 37
build/plugins/_requirements.py

@@ -1,49 +1,49 @@
-import _test_const as consts
+import _test_const as consts 
-
+ 
-
+ 
-def check_cpu(suite_cpu_requirements, test_size, is_kvm=False):
+def check_cpu(suite_cpu_requirements, test_size, is_kvm=False): 
-    min_cpu_requirements = consts.TestRequirementsConstants.MinCpu
+    min_cpu_requirements = consts.TestRequirementsConstants.MinCpu 
-    max_cpu_requirements = consts.TestSize.get_max_requirements(test_size).get(consts.TestRequirements.Cpu)
+    max_cpu_requirements = consts.TestSize.get_max_requirements(test_size).get(consts.TestRequirements.Cpu) 
-    if isinstance(suite_cpu_requirements, str):
+    if isinstance(suite_cpu_requirements, str): 
-        if all(consts.TestRequirementsConstants.is_all_cpu(req) for req in (max_cpu_requirements, suite_cpu_requirements)):
+        if all(consts.TestRequirementsConstants.is_all_cpu(req) for req in (max_cpu_requirements, suite_cpu_requirements)): 
             return None
             return None
         return "Wrong 'cpu' requirements: {}, should be in [{}..{}] for {}-size tests".format(suite_cpu_requirements, min_cpu_requirements, max_cpu_requirements, test_size)
         return "Wrong 'cpu' requirements: {}, should be in [{}..{}] for {}-size tests".format(suite_cpu_requirements, min_cpu_requirements, max_cpu_requirements, test_size)
-
+ 
-    if not isinstance(suite_cpu_requirements, int):
+    if not isinstance(suite_cpu_requirements, int): 
         return "Wrong 'cpu' requirements: {}, should be integer".format(suite_cpu_requirements)
         return "Wrong 'cpu' requirements: {}, should be integer".format(suite_cpu_requirements)
-
+ 
-    if suite_cpu_requirements < min_cpu_requirements or suite_cpu_requirements > consts.TestRequirementsConstants.get_cpu_value(max_cpu_requirements):
+    if suite_cpu_requirements < min_cpu_requirements or suite_cpu_requirements > consts.TestRequirementsConstants.get_cpu_value(max_cpu_requirements): 
         return "Wrong 'cpu' requirement: {}, should be in [{}..{}] for {}-size tests".format(suite_cpu_requirements, min_cpu_requirements, max_cpu_requirements, test_size)
         return "Wrong 'cpu' requirement: {}, should be in [{}..{}] for {}-size tests".format(suite_cpu_requirements, min_cpu_requirements, max_cpu_requirements, test_size)
-
+ 
     return None
     return None
-
+ 
-
+ 
-# TODO: Remove is_kvm param when there will be guarantees on RAM
+# TODO: Remove is_kvm param when there will be guarantees on RAM 
-def check_ram(suite_ram_requirements, test_size, is_kvm=False):
+def check_ram(suite_ram_requirements, test_size, is_kvm=False): 
-    if not isinstance(suite_ram_requirements, int):
+    if not isinstance(suite_ram_requirements, int): 
         return "Wrong 'ram' requirements: {}, should be integer".format(suite_ram_requirements)
         return "Wrong 'ram' requirements: {}, should be integer".format(suite_ram_requirements)
-    min_ram_requirements = consts.TestRequirementsConstants.MinRam
+    min_ram_requirements = consts.TestRequirementsConstants.MinRam 
-    max_ram_requirements = consts.MAX_RAM_REQUIREMENTS_FOR_KVM if is_kvm else consts.TestSize.get_max_requirements(test_size).get(consts.TestRequirements.Ram)
+    max_ram_requirements = consts.MAX_RAM_REQUIREMENTS_FOR_KVM if is_kvm else consts.TestSize.get_max_requirements(test_size).get(consts.TestRequirements.Ram) 
-    if suite_ram_requirements < min_ram_requirements or suite_ram_requirements > max_ram_requirements:
+    if suite_ram_requirements < min_ram_requirements or suite_ram_requirements > max_ram_requirements: 
-        err_msg = "Wrong 'ram' requirements: {}, should be in [{}..{}] for {}-size tests".format(suite_ram_requirements, min_ram_requirements, max_ram_requirements, test_size)
+        err_msg = "Wrong 'ram' requirements: {}, should be in [{}..{}] for {}-size tests".format(suite_ram_requirements, min_ram_requirements, max_ram_requirements, test_size) 
-        if is_kvm:
+        if is_kvm: 
-            err_msg += ' with kvm requirements'
+            err_msg += ' with kvm requirements' 
-        return err_msg
+        return err_msg 
     return None
     return None
-
+ 
-
+ 
-def check_ram_disk(suite_ram_disk, test_size, is_kvm=False):
+def check_ram_disk(suite_ram_disk, test_size, is_kvm=False): 
-    min_ram_disk = consts.TestRequirementsConstants.MinRamDisk
+    min_ram_disk = consts.TestRequirementsConstants.MinRamDisk 
-    max_ram_disk = consts.TestSize.get_max_requirements(test_size).get(consts.TestRequirements.RamDisk)
+    max_ram_disk = consts.TestSize.get_max_requirements(test_size).get(consts.TestRequirements.RamDisk) 
-    if isinstance(suite_ram_disk, str):
+    if isinstance(suite_ram_disk, str): 
-        if all(consts.TestRequirementsConstants.is_all_ram_disk(req) for req in (max_ram_disk, suite_ram_disk)):
+        if all(consts.TestRequirementsConstants.is_all_ram_disk(req) for req in (max_ram_disk, suite_ram_disk)): 
             return None
             return None
         return "Wrong 'ram_disk' requirements: {}, should be in [{}..{}] for {}-size tests".format(suite_ram_disk, 0, max_ram_disk, test_size)
         return "Wrong 'ram_disk' requirements: {}, should be in [{}..{}] for {}-size tests".format(suite_ram_disk, 0, max_ram_disk, test_size)
-
+ 
-    if not isinstance(suite_ram_disk, int):
+    if not isinstance(suite_ram_disk, int): 
         return "Wrong 'ram_disk' requirements: {}, should be integer".format(suite_ram_disk)
         return "Wrong 'ram_disk' requirements: {}, should be integer".format(suite_ram_disk)
-
+ 
-    if suite_ram_disk < min_ram_disk or suite_ram_disk > consts.TestRequirementsConstants.get_ram_disk_value(max_ram_disk):
+    if suite_ram_disk < min_ram_disk or suite_ram_disk > consts.TestRequirementsConstants.get_ram_disk_value(max_ram_disk): 
         return "Wrong 'ram_disk' requirement: {}, should be in [{}..{}] for {}-size tests".format(suite_ram_disk, min_ram_disk, max_ram_disk, test_size)
         return "Wrong 'ram_disk' requirement: {}, should be in [{}..{}] for {}-size tests".format(suite_ram_disk, min_ram_disk, max_ram_disk, test_size)
-
+ 
     return None
     return None

+ 139 - 139
build/plugins/_test_const.py

@@ -1,5 +1,5 @@
 # coding: utf-8
 # coding: utf-8
-import re
+import re 
 import sys
 import sys
 
 
 
 
@@ -24,25 +24,25 @@ REPORT_SNIPPET_LIMIT = 10000
 SANITIZER_ERROR_RC = 100
 SANITIZER_ERROR_RC = 100
 TEST_SUBTEST_SEPARATOR = '::'
 TEST_SUBTEST_SEPARATOR = '::'
 TESTING_OUT_DIR_NAME = "testing_out_stuff"
 TESTING_OUT_DIR_NAME = "testing_out_stuff"
-TESTING_OUT_TAR_NAME = TESTING_OUT_DIR_NAME + ".tar"
+TESTING_OUT_TAR_NAME = TESTING_OUT_DIR_NAME + ".tar" 
 TIMESTAMP_FORMAT = "%Y-%m-%d %H:%M:%S.%f"
 TIMESTAMP_FORMAT = "%Y-%m-%d %H:%M:%S.%f"
 TRACE_FILE_NAME = "ytest.report.trace"
 TRACE_FILE_NAME = "ytest.report.trace"
 TRUNCATING_IGNORE_FILE_LIST = {TRACE_FILE_NAME, "run_test.log"}
 TRUNCATING_IGNORE_FILE_LIST = {TRACE_FILE_NAME, "run_test.log"}
 
 
-# kvm
+# kvm 
-DEFAULT_RAM_REQUIREMENTS_FOR_KVM = 4
+DEFAULT_RAM_REQUIREMENTS_FOR_KVM = 4 
-MAX_RAM_REQUIREMENTS_FOR_KVM = 16
+MAX_RAM_REQUIREMENTS_FOR_KVM = 16 
-
+ 
-# distbuild
+# distbuild 
-TEST_NODE_FINISHING_TIME = 5 * 60
+TEST_NODE_FINISHING_TIME = 5 * 60 
-DEFAULT_TEST_NODE_TIMEOUT = 15 * 60
+DEFAULT_TEST_NODE_TIMEOUT = 15 * 60 
-
+ 
 # coverage
 # coverage
-COVERAGE_TESTS_TIMEOUT_FACTOR = 1.5
+COVERAGE_TESTS_TIMEOUT_FACTOR = 1.5 
-COVERAGE_RESOLVED_FILE_NAME_PATTERN = "coverage_resolved.{}.json"
+COVERAGE_RESOLVED_FILE_NAME_PATTERN = "coverage_resolved.{}.json" 
-CPP_COVERAGE_RESOLVED_FILE_NAME = COVERAGE_RESOLVED_FILE_NAME_PATTERN.format("cpp")
+CPP_COVERAGE_RESOLVED_FILE_NAME = COVERAGE_RESOLVED_FILE_NAME_PATTERN.format("cpp") 
-JAVA_COVERAGE_RESOLVED_FILE_NAME = COVERAGE_RESOLVED_FILE_NAME_PATTERN.format("java")
+JAVA_COVERAGE_RESOLVED_FILE_NAME = COVERAGE_RESOLVED_FILE_NAME_PATTERN.format("java") 
-PYTHON_COVERAGE_RESOLVED_FILE_NAME = COVERAGE_RESOLVED_FILE_NAME_PATTERN.format("python")
+PYTHON_COVERAGE_RESOLVED_FILE_NAME = COVERAGE_RESOLVED_FILE_NAME_PATTERN.format("python") 
 CLANG_COVERAGE_TEST_TYPES = ("unittest", "coverage_extractor", "pytest", "py3test", "gtest", "boost_test", "exectest")
 CLANG_COVERAGE_TEST_TYPES = ("unittest", "coverage_extractor", "pytest", "py3test", "gtest", "boost_test", "exectest")
 COVERAGE_TABLE_CHUNKS = 20
 COVERAGE_TABLE_CHUNKS = 20
 COVERAGE_YT_PROXY = "hahn.yt.yandex.net"
 COVERAGE_YT_PROXY = "hahn.yt.yandex.net"
@@ -55,26 +55,26 @@ CORPUS_DATA_ROOT_DIR = 'fuzzing'
 CORPUS_DIR_NAME = 'corpus'
 CORPUS_DIR_NAME = 'corpus'
 FUZZING_COMPRESSION_COEF = 1.1
 FUZZING_COMPRESSION_COEF = 1.1
 FUZZING_DEFAULT_TIMEOUT = 3600
 FUZZING_DEFAULT_TIMEOUT = 3600
-FUZZING_FINISHING_TIME = 600
+FUZZING_FINISHING_TIME = 600 
 FUZZING_TIMEOUT_RE = re.compile(r'(^|\s)-max_total_time=(?P<max_time>\d+)')
 FUZZING_TIMEOUT_RE = re.compile(r'(^|\s)-max_total_time=(?P<max_time>\d+)')
 GENERATED_CORPUS_DIR_NAME = 'mined_corpus'
 GENERATED_CORPUS_DIR_NAME = 'mined_corpus'
 MAX_CORPUS_RESOURCES_ALLOWED = 5
 MAX_CORPUS_RESOURCES_ALLOWED = 5
 
 
-TEST_TOOL_HOST = 'TEST_TOOL_HOST_RESOURCE_GLOBAL'
+TEST_TOOL_HOST = 'TEST_TOOL_HOST_RESOURCE_GLOBAL' 
-TEST_TOOL_TARGET = 'TEST_TOOL_TARGET_RESOURCE_GLOBAL'
+TEST_TOOL_TARGET = 'TEST_TOOL_TARGET_RESOURCE_GLOBAL' 
-TEST_TOOL_HOST_LOCAL = 'TEST_TOOL_HOST_LOCAL'
+TEST_TOOL_HOST_LOCAL = 'TEST_TOOL_HOST_LOCAL' 
-TEST_TOOL_TARGET_LOCAL = 'TEST_TOOL_TARGET_LOCAL'
+TEST_TOOL_TARGET_LOCAL = 'TEST_TOOL_TARGET_LOCAL' 
-XCODE_TOOLS_RESOURCE = 'XCODE_TOOLS_ROOT_RESOURCE_GLOBAL'
+XCODE_TOOLS_RESOURCE = 'XCODE_TOOLS_ROOT_RESOURCE_GLOBAL' 
-GO_TOOLS_RESOURCE = 'GO_TOOLS_RESOURCE_GLOBAL'
+GO_TOOLS_RESOURCE = 'GO_TOOLS_RESOURCE_GLOBAL' 
-LLVM_COV9_RESOURCE = 'LLVM_COV9_RESOURCE_GLOBAL'
+LLVM_COV9_RESOURCE = 'LLVM_COV9_RESOURCE_GLOBAL' 
-PEP8_PY2_RESOURCE = 'PEP8_PY2_RESOURCE_GLOBAL'
+PEP8_PY2_RESOURCE = 'PEP8_PY2_RESOURCE_GLOBAL' 
-PEP8_PY3_RESOURCE = 'PEP8_PY3_RESOURCE_GLOBAL'
+PEP8_PY3_RESOURCE = 'PEP8_PY3_RESOURCE_GLOBAL' 
-FLAKES_PY2_RESOURCE = 'FLAKES_PY2_RESOURCE_GLOBAL'
+FLAKES_PY2_RESOURCE = 'FLAKES_PY2_RESOURCE_GLOBAL' 
-FLAKES_PY3_RESOURCE = 'FLAKES_PY3_RESOURCE_GLOBAL'
+FLAKES_PY3_RESOURCE = 'FLAKES_PY3_RESOURCE_GLOBAL' 
 FLAKE8_PY2_RESOURCE = 'FLAKE8_PY2_RESOURCE_GLOBAL'
 FLAKE8_PY2_RESOURCE = 'FLAKE8_PY2_RESOURCE_GLOBAL'
 FLAKE8_PY3_RESOURCE = 'FLAKE8_PY3_RESOURCE_GLOBAL'
 FLAKE8_PY3_RESOURCE = 'FLAKE8_PY3_RESOURCE_GLOBAL'
 
 
-
+ 
 class Enum(object):
 class Enum(object):
 
 
     @classmethod
     @classmethod
@@ -82,134 +82,134 @@ class Enum(object):
         return [v for k, v in cls.__dict__.items() if not k.startswith("_")]
         return [v for k, v in cls.__dict__.items() if not k.startswith("_")]
 
 
 
 
-class TestRequirements(Enum):
+class TestRequirements(Enum): 
-    Container = 'container'
+    Container = 'container' 
-    Cpu = 'cpu'
+    Cpu = 'cpu' 
-    DiskUsage = 'disk_usage'
+    DiskUsage = 'disk_usage' 
-    Ram = 'ram'
+    Ram = 'ram' 
-    RamDisk = 'ram_disk'
+    RamDisk = 'ram_disk' 
-    SbVault = 'sb_vault'
+    SbVault = 'sb_vault' 
-    Network = 'network'
+    Network = 'network' 
-    Dns = 'dns'
+    Dns = 'dns' 
-    Kvm = 'kvm'
+    Kvm = 'kvm' 
-
+ 
-
+ 
-class TestRequirementsConstants(Enum):
+class TestRequirementsConstants(Enum): 
-    All = 'all'
+    All = 'all' 
-    AllCpuValue = 50
+    AllCpuValue = 50 
-    AllRamDiskValue = 50
+    AllRamDiskValue = 50 
-    MinCpu = 1
+    MinCpu = 1 
-    MinRam = 1
+    MinRam = 1 
-    MinRamDisk = 0
+    MinRamDisk = 0 
-
+ 
-    @classmethod
+    @classmethod 
-    def is_all_cpu(cls, value):
+    def is_all_cpu(cls, value): 
-        return value == cls.All
+        return value == cls.All 
-
+ 
-    @classmethod
+    @classmethod 
-    def get_cpu_value(cls, value):
+    def get_cpu_value(cls, value): 
-        return cls.AllCpuValue if cls.is_all_cpu(value) else value
+        return cls.AllCpuValue if cls.is_all_cpu(value) else value 
-
+ 
-    @classmethod
+    @classmethod 
-    def is_all_ram_disk(cls, value):
+    def is_all_ram_disk(cls, value): 
-        return value == cls.All
+        return value == cls.All 
-
+ 
-    @classmethod
+    @classmethod 
-    def get_ram_disk_value(cls, value):
+    def get_ram_disk_value(cls, value): 
-        return cls.AllRamDiskValue if cls.is_all_ram_disk(value) else value
+        return cls.AllRamDiskValue if cls.is_all_ram_disk(value) else value 
-
+ 
-
+ 
 class TestSize(Enum):
 class TestSize(Enum):
     Small = 'small'
     Small = 'small'
     Medium = 'medium'
     Medium = 'medium'
     Large = 'large'
     Large = 'large'
 
 
-    DefaultTimeouts = {
+    DefaultTimeouts = { 
         Small: 60,
         Small: 60,
         Medium: 600,
         Medium: 600,
         Large: 3600,
         Large: 3600,
     }
     }
 
 
-    DefaultPriorities = {
+    DefaultPriorities = { 
-        Small: -1,
+        Small: -1, 
-        Medium: -2,
+        Medium: -2, 
-        Large: -3,
+        Large: -3, 
-    }
+    } 
-
+ 
-    DefaultRequirements = {
+    DefaultRequirements = { 
-        Small: {
+        Small: { 
-            TestRequirements.Cpu: 1,
+            TestRequirements.Cpu: 1, 
-            TestRequirements.Ram: 32,
+            TestRequirements.Ram: 32, 
-            # TestRequirements.Ram: 2,
+            # TestRequirements.Ram: 2, 
-            TestRequirements.RamDisk: 0,
+            TestRequirements.RamDisk: 0, 
-        },
+        }, 
-        Medium: {
+        Medium: { 
-            TestRequirements.Cpu: 1,
+            TestRequirements.Cpu: 1, 
-            TestRequirements.Ram: 32,
+            TestRequirements.Ram: 32, 
-            # TestRequirements.Ram: 4,
+            # TestRequirements.Ram: 4, 
-            TestRequirements.RamDisk: 0,
+            TestRequirements.RamDisk: 0, 
-        },
+        }, 
-        Large: {
+        Large: { 
-            TestRequirements.Cpu: 1,
+            TestRequirements.Cpu: 1, 
-            TestRequirements.Ram: 32,
+            TestRequirements.Ram: 32, 
-            # TestRequirements.Ram: 8,
+            # TestRequirements.Ram: 8, 
-            TestRequirements.RamDisk: 0,
+            TestRequirements.RamDisk: 0, 
-        },
+        }, 
-    }
+    } 
-
+ 
-    MaxRequirements = {
+    MaxRequirements = { 
-        Small: {
+        Small: { 
-            TestRequirements.Cpu: 4,
+            TestRequirements.Cpu: 4, 
-            TestRequirements.Ram: 32,
+            TestRequirements.Ram: 32, 
-            # TestRequirements.Ram: 4,
+            # TestRequirements.Ram: 4, 
-            TestRequirements.RamDisk: 4,
+            TestRequirements.RamDisk: 4, 
-        },
+        }, 
-        Medium: {
+        Medium: { 
-            TestRequirements.Cpu: 4,
+            TestRequirements.Cpu: 4, 
-            # TestRequirements.Cpu: 8,
+            # TestRequirements.Cpu: 8, 
-            TestRequirements.Ram: 32,
+            TestRequirements.Ram: 32, 
-            # TestRequirements.Ram: 16,
+            # TestRequirements.Ram: 16, 
-            TestRequirements.RamDisk: 4,
+            TestRequirements.RamDisk: 4, 
-        },
+        }, 
-        Large: {
+        Large: { 
             TestRequirements.Cpu: 4,
             TestRequirements.Cpu: 4,
-            TestRequirements.Ram: 32,
+            TestRequirements.Ram: 32, 
-            TestRequirements.RamDisk: 4,
+            TestRequirements.RamDisk: 4, 
-        },
+        }, 
-    }
+    } 
-
+ 
     @classmethod
     @classmethod
     def sizes(cls):
     def sizes(cls):
-        return cls.DefaultTimeouts.keys()
+        return cls.DefaultTimeouts.keys() 
 
 
     @classmethod
     @classmethod
     def get_default_timeout(cls, size):
     def get_default_timeout(cls, size):
-        if size in cls.DefaultTimeouts:
+        if size in cls.DefaultTimeouts: 
-            return cls.DefaultTimeouts[size]
+            return cls.DefaultTimeouts[size] 
-        raise Exception("Unknown test size '{}'".format(size))
-
-    @classmethod
-    def get_default_priorities(cls, size):
-        if size in cls.DefaultPriorities:
-            return cls.DefaultPriorities[size]
-        raise Exception("Unknown test size '{}'".format(size))
-
-    @classmethod
-    def get_default_requirements(cls, size):
-        if size in cls.DefaultRequirements:
-            return cls.DefaultRequirements[size]
         raise Exception("Unknown test size '{}'".format(size))
         raise Exception("Unknown test size '{}'".format(size))
 
 
-    @classmethod
+    @classmethod 
-    def get_max_requirements(cls, size):
+    def get_default_priorities(cls, size): 
-        if size in cls.MaxRequirements:
+        if size in cls.DefaultPriorities: 
-            return cls.MaxRequirements[size]
+            return cls.DefaultPriorities[size] 
-        raise Exception("Unknown test size '{}'".format(size))
+        raise Exception("Unknown test size '{}'".format(size)) 
-
+
-
+    @classmethod 
+    def get_default_requirements(cls, size): 
+        if size in cls.DefaultRequirements: 
+            return cls.DefaultRequirements[size] 
+        raise Exception("Unknown test size '{}'".format(size)) 
+ 
+    @classmethod 
+    def get_max_requirements(cls, size): 
+        if size in cls.MaxRequirements: 
+            return cls.MaxRequirements[size] 
+        raise Exception("Unknown test size '{}'".format(size)) 
+ 
+ 
 class TestRunExitCode(Enum):
 class TestRunExitCode(Enum):
     Skipped = 2
     Skipped = 2
-    Failed = 3
+    Failed = 3 
     TimeOut = 10
     TimeOut = 10
     InfrastructureError = 12
     InfrastructureError = 12
 
 
@@ -223,8 +223,8 @@ class YaTestTags(Enum):
     Fat = "ya:fat"
     Fat = "ya:fat"
     RunWithAsserts = "ya:relwithdebinfo"
     RunWithAsserts = "ya:relwithdebinfo"
     Privileged = "ya:privileged"
     Privileged = "ya:privileged"
-    ExoticPlatform = "ya:exotic_platform"
+    ExoticPlatform = "ya:exotic_platform" 
-    NotAutocheck = "ya:not_autocheck"
+    NotAutocheck = "ya:not_autocheck" 
 
 
 
 
 class Status(object):
 class Status(object):
@@ -256,7 +256,7 @@ class _Colors(object):
         "white",
         "white",
         "yellow",
         "yellow",
     ]
     ]
-    _PREFIXES = ["", "light", "dark"]
+    _PREFIXES = ["", "light", "dark"] 
 
 
     def __init__(self):
     def __init__(self):
         self._table = {}
         self._table = {}

+ 1 - 1
build/plugins/_xsyn_includes.py

@@ -48,7 +48,7 @@ def process_xsyn(filepath, on_element):
 
 
     # keep a stack of filepathes if on_element calls process_xsyn recursively
     # keep a stack of filepathes if on_element calls process_xsyn recursively
     with open(filepath) as xsyn_file:
     with open(filepath) as xsyn_file:
-        from xml.dom.minidom import parse
+        from xml.dom.minidom import parse 
         tree = parse(xsyn_file)
         tree = parse(xsyn_file)
         tree.normalize()
         tree.normalize()
         res = traverse_xsyn(tree, on_element)
         res = traverse_xsyn(tree, on_element)

+ 1 - 1
build/plugins/build_mn_files.py

@@ -1,6 +1,6 @@
 from os.path import basename, splitext
 from os.path import basename, splitext
 
 
-
+ 
 def on_build_mns_files(unit, *args):
 def on_build_mns_files(unit, *args):
     files = []
     files = []
     name = ''
     name = ''

+ 6 - 6
build/plugins/cp.py

@@ -4,12 +4,12 @@ from _common import sort_by_keywords
 
 
 
 
 def oncopy(unit, *args):
 def oncopy(unit, *args):
-    keywords = {'RESULT': 1, 'KEEP_DIR_STRUCT': 0, 'DESTINATION': 1, 'FROM': 1}
+    keywords = {'RESULT': 1, 'KEEP_DIR_STRUCT': 0, 'DESTINATION': 1, 'FROM': 1} 
 
 
     flat_args, spec_args = sort_by_keywords(keywords, args)
     flat_args, spec_args = sort_by_keywords(keywords, args)
 
 
     dest_dir = spec_args['DESTINATION'][0] if 'DESTINATION' in spec_args else ''
     dest_dir = spec_args['DESTINATION'][0] if 'DESTINATION' in spec_args else ''
-    from_dir = spec_args['FROM'][0] if 'FROM' in spec_args else ''
+    from_dir = spec_args['FROM'][0] if 'FROM' in spec_args else '' 
     keep_struct = 'KEEP_DIR_STRUCT' in spec_args
     keep_struct = 'KEEP_DIR_STRUCT' in spec_args
     save_in_var = 'RESULT' in spec_args
     save_in_var = 'RESULT' in spec_args
     targets = []
     targets = []
@@ -21,10 +21,10 @@ def oncopy(unit, *args):
         if keep_struct:
         if keep_struct:
             if path_list[:-1]:
             if path_list[:-1]:
                 rel_path = os.path.join(*path_list[:-1])
                 rel_path = os.path.join(*path_list[:-1])
-        source_path = os.path.join(from_dir, rel_path, filename)
+        source_path = os.path.join(from_dir, rel_path, filename) 
-        target_path = os.path.join(dest_dir, rel_path, filename)
+        target_path = os.path.join(dest_dir, rel_path, filename) 
         if save_in_var:
         if save_in_var:
-            targets.append(target_path)
+            targets.append(target_path) 
-        unit.oncopy_file([source_path, target_path])
+        unit.oncopy_file([source_path, target_path]) 
     if save_in_var:
     if save_in_var:
         unit.set([spec_args["RESULT"][0], " ".join(targets)])
         unit.set([spec_args["RESULT"][0], " ".join(targets)])

+ 7 - 7
build/plugins/create_init_py.py

@@ -3,13 +3,13 @@ import os
 from _common import sort_by_keywords
 from _common import sort_by_keywords
 
 
 
 
-def oncreate_init_py_structure(unit, *args):
+def oncreate_init_py_structure(unit, *args): 
     if unit.get('DISTBUILD'):
     if unit.get('DISTBUILD'):
         return
         return
-    target_dir = unit.get('PY_PROTOS_FOR_DIR')
+    target_dir = unit.get('PY_PROTOS_FOR_DIR') 
-    path_list = target_dir.split(os.path.sep)[1:]
+    path_list = target_dir.split(os.path.sep)[1:] 
-    inits = [os.path.join("${ARCADIA_BUILD_ROOT}", '__init__.py')]
+    inits = [os.path.join("${ARCADIA_BUILD_ROOT}", '__init__.py')] 
-    for i in range(1, len(path_list) + 1):
+    for i in range(1, len(path_list) + 1): 
-        inits.append(os.path.join("${ARCADIA_BUILD_ROOT}", os.path.join(*path_list[0:i]), '__init__.py'))
+        inits.append(os.path.join("${ARCADIA_BUILD_ROOT}", os.path.join(*path_list[0:i]), '__init__.py')) 
-    unit.ontouch(inits)
+    unit.ontouch(inits) 
 
 

+ 11 - 11
build/plugins/lib/_metric_resolvers.py

@@ -1,11 +1,11 @@
-import re
+import re 
-
+ 
-VALUE_PATTERN = re.compile(r"^\s*(?P<value>\d+)\s*$")
+VALUE_PATTERN = re.compile(r"^\s*(?P<value>\d+)\s*$") 
-
+ 
-
+ 
-def resolve_value(val):
+def resolve_value(val): 
-    match = VALUE_PATTERN.match(val)
+    match = VALUE_PATTERN.match(val) 
-    if not match:
+    if not match: 
-        return None
+        return None 
-    val = match.group('value')
+    val = match.group('value') 
-    return int(val)
+    return int(val) 

+ 1 - 1
build/plugins/print_module_type.py

@@ -1,5 +1,5 @@
 def onprint_module_type(unit, *args):
 def onprint_module_type(unit, *args):
     filepath = unit.get('KIWI_OUT_FILE')
     filepath = unit.get('KIWI_OUT_FILE')
-    if len(args) >= 2 and filepath is not None:
+    if len(args) >= 2 and filepath is not None: 
         with open(filepath, "a") as file_handler:
         with open(filepath, "a") as file_handler:
             print >>file_handler, "{0} {1} {2}".format(args[0], args[1], unit.path())
             print >>file_handler, "{0} {1} {2}".format(args[0], args[1], unit.path())

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