aboutsummaryrefslogtreecommitdiffstats
path: root/build/scripts
diff options
context:
space:
mode:
authorStanislav Kirillov <staskirillov@gmail.com>2022-02-10 16:46:07 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:46:07 +0300
commit92fe2b1e7bc79f7b95adef61714fc003f6ea4a1c (patch)
tree817034f4ca57c9f841bb047ec94630c2e78a2b1d /build/scripts
parent53c76da6d9f6cc5a17f6029df396f0e3bc1ff47d (diff)
downloadydb-92fe2b1e7bc79f7b95adef61714fc003f6ea4a1c.tar.gz
Restoring authorship annotation for Stanislav Kirillov <staskirillov@gmail.com>. Commit 1 of 2.
Diffstat (limited to 'build/scripts')
-rw-r--r--build/scripts/compile_cuda.py10
-rw-r--r--build/scripts/fix_msvc_output.py16
-rw-r--r--build/scripts/generate_mf.py16
-rw-r--r--build/scripts/vcs_info.py56
4 files changed, 49 insertions, 49 deletions
diff --git a/build/scripts/compile_cuda.py b/build/scripts/compile_cuda.py
index c0bec50b2a6..ac626bec1a8 100644
--- a/build/scripts/compile_cuda.py
+++ b/build/scripts/compile_cuda.py
@@ -50,7 +50,7 @@ def main():
# clang coverage
'-fprofile-instr-generate',
'-fcoverage-mapping',
- '/Zc:inline', # disable unreferenced functions (kernel registrators) remove
+ '/Zc:inline', # disable unreferenced functions (kernel registrators) remove
'-Wno-c++17-extensions',
'-flto',
'-faligned-allocation',
@@ -95,10 +95,10 @@ def main():
while cflags_queue:
arg = cflags_queue.popleft()
- if arg == '-mllvm':
- compiler_args.append(arg)
- compiler_args.append(cflags_queue.popleft())
- continue
+ if arg == '-mllvm':
+ compiler_args.append(arg)
+ compiler_args.append(cflags_queue.popleft())
+ continue
if arg[:2].upper() in ('-I', '/I', '-B'):
value = arg[2:]
if not value:
diff --git a/build/scripts/fix_msvc_output.py b/build/scripts/fix_msvc_output.py
index b2e7d38307c..aa64adf3165 100644
--- a/build/scripts/fix_msvc_output.py
+++ b/build/scripts/fix_msvc_output.py
@@ -8,19 +8,19 @@ def out2err(cmd):
return subprocess.Popen(cmd, stdout=sys.stderr).wait()
-def decoding_needed(strval):
- if sys.version_info >= (3, 0, 0):
- return isinstance(strval, bytes)
- else:
- return False
-
-
+def decoding_needed(strval):
+ if sys.version_info >= (3, 0, 0):
+ return isinstance(strval, bytes)
+ else:
+ return False
+
+
def out2err_cut_first_line(cmd):
p = subprocess.Popen(cmd, stdout=subprocess.PIPE)
first_line = True
while True:
line = p.stdout.readline()
- line = line.decode('utf-8') if decoding_needed(line) else line
+ line = line.decode('utf-8') if decoding_needed(line) else line
if not line:
break
if first_line:
diff --git a/build/scripts/generate_mf.py b/build/scripts/generate_mf.py
index a44a9699801..36e00b64891 100644
--- a/build/scripts/generate_mf.py
+++ b/build/scripts/generate_mf.py
@@ -15,13 +15,13 @@ class GplNotAllowed(Exception):
pass
-def process_quotes(s):
- for quote_char in '\'"':
- if s.startswith(quote_char) and s.endswith(quote_char):
- return s[1:-1]
- return s
-
-
+def process_quotes(s):
+ for quote_char in '\'"':
+ if s.startswith(quote_char) and s.endswith(quote_char):
+ return s[1:-1]
+ return s
+
+
def parse_args():
args = pcf.get_args(sys.argv[1:])
lics, peers, free_args, credits = [], [], [], []
@@ -76,7 +76,7 @@ def generate_mf():
if credits:
union_texts = []
for texts_file in credits:
- with open(process_quotes(texts_file)) as f:
+ with open(process_quotes(texts_file)) as f:
union_texts.append(f.read())
meta['license_texts'] = '\n\n'.join(union_texts)
diff --git a/build/scripts/vcs_info.py b/build/scripts/vcs_info.py
index 319d1b46318..01142134c25 100644
--- a/build/scripts/vcs_info.py
+++ b/build/scripts/vcs_info.py
@@ -11,34 +11,34 @@ import zipfile
class _Formatting(object):
@staticmethod
- def is_str(strval):
- if sys.version_info >= (3, 0, 0):
- return isinstance(strval, (bytes,str))
- else:
- return isinstance(strval, basestring)
-
- @staticmethod
- def encoding_needed(strval):
- if sys.version_info >= (3, 0, 0):
- return isinstance(strval, str)
- else:
- return isinstance(strval, unicode)
-
- @staticmethod
+ def is_str(strval):
+ if sys.version_info >= (3, 0, 0):
+ return isinstance(strval, (bytes,str))
+ else:
+ return isinstance(strval, basestring)
+
+ @staticmethod
+ def encoding_needed(strval):
+ if sys.version_info >= (3, 0, 0):
+ return isinstance(strval, str)
+ else:
+ return isinstance(strval, unicode)
+
+ @staticmethod
def escape_special_symbols(strval):
- encoding_needed = _Formatting.encoding_needed(strval)
- c_str = strval.encode('utf-8') if encoding_needed else strval
- retval = b""
+ encoding_needed = _Formatting.encoding_needed(strval)
+ c_str = strval.encode('utf-8') if encoding_needed else strval
+ retval = b""
for c in c_str:
- if sys.version_info >= (3, 0, 0):
- c = bytes([c])
+ if sys.version_info >= (3, 0, 0):
+ c = bytes([c])
if c in ("\\", "\""):
retval += "\\" + c
elif ord(c) < ord(' '):
- retval += c.decode('latin-1').encode('unicode_escape')
+ retval += c.decode('latin-1').encode('unicode_escape')
else:
retval += c
- return retval.decode('utf-8') if encoding_needed else retval
+ return retval.decode('utf-8') if encoding_needed else retval
@staticmethod
def escape_line_feed(strval, indent=' '):
@@ -51,7 +51,7 @@ class _Formatting(object):
@staticmethod
def escaped_define(strkey, val):
name = "#define " + strkey + " "
- if _Formatting.is_str(val):
+ if _Formatting.is_str(val):
define = "\"" + _Formatting.escape_line_feed(
_Formatting.escape_trigraphs(_Formatting.escape_special_symbols(val))) + "\""
else:
@@ -60,7 +60,7 @@ class _Formatting(object):
@staticmethod
def escaped_go_map_key(strkey, strval):
- if _Formatting.is_str(strval):
+ if _Formatting.is_str(strval):
return ' ' + '"' + strkey + '": "' + _Formatting.escape_special_symbols(strval) + '",'
else:
return ' ' + '"' + strkey + '": "' + str(strval) + '",'
@@ -94,7 +94,7 @@ def get_json(file_name):
# TODO: check 'tar+svn' parsing
for i in ['ARCADIA_SOURCE_REVISION', 'ARCADIA_SOURCE_LAST_CHANGE', 'SVN_REVISION']:
- if i in out and _Formatting.is_str(out[i]):
+ if i in out and _Formatting.is_str(out[i]):
try:
out[i] = int(out[i])
except:
@@ -120,10 +120,10 @@ def print_c(json_file, output_file, argv):
with open(interface) as c:
c_file = c.read()
with open(output_file, 'w') as f:
- header = '\n'.join(gen_header(json_file))
- if sys.version_info < (3, 0, 0):
- header = header.encode('utf-8')
- f.write(header + '\n' + c_file)
+ header = '\n'.join(gen_header(json_file))
+ if sys.version_info < (3, 0, 0):
+ header = header.encode('utf-8')
+ f.write(header + '\n' + c_file)
def merge_java_content(old_content, json_file):