Skip to content

Commit 8117827

Browse files
committed
[Tizen] Apply code formatter
1 parent 31a0b62 commit 8117827

File tree

3 files changed

+33
-38
lines changed

3 files changed

+33
-38
lines changed

ci/tizen/check_symbols.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@ def check_symbol(sofile, allowlist):
3232
sys.exit('{} is not a valid file.'.format(allowlist))
3333

3434
try:
35-
symbols_raw = subprocess.check_output(
36-
['nm', '-gDC', sofile]).decode('utf-8').splitlines()
35+
symbols_raw = subprocess.check_output(['nm', '-gDC', sofile]).decode('utf-8').splitlines()
3736
symbols = [Symbol.parse(line) for line in symbols_raw]
3837
except subprocess.CalledProcessError as error:
3938
sys.exit('nm failed: {}'.format(error))
@@ -60,10 +59,8 @@ def check_symbol(sofile, allowlist):
6059

6160
def main():
6261
parser = argparse.ArgumentParser()
63-
parser.add_argument('--allowlist', type=str, required=True,
64-
help='Path to the allowlist file')
65-
parser.add_argument('sofile', type=str, nargs='+',
66-
help='Path to the .so file')
62+
parser.add_argument('--allowlist', type=str, required=True, help='Path to the allowlist file')
63+
parser.add_argument('sofile', type=str, nargs='+', help='Path to the .so file')
6764
args = parser.parse_args()
6865

6966
for sofile in args.sofile:

ci/tizen/generate_sysroot.py

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,20 @@
1313
import urllib.request
1414
from pathlib import Path
1515

16-
1716
base_packages = [
18-
'gcc',
19-
'glibc',
20-
'glibc-devel',
21-
'libgcc',
22-
'linux-glibc-devel',
23-
'zlib-devel',
17+
'gcc',
18+
'glibc',
19+
'glibc-devel',
20+
'libgcc',
21+
'linux-glibc-devel',
22+
'zlib-devel',
2423
]
2524

2625
unified_packages = [
27-
'fontconfig',
28-
'fontconfig-devel',
29-
'freetype2-devel',
30-
'libpng-devel',
26+
'fontconfig',
27+
'fontconfig-devel',
28+
'freetype2-devel',
29+
'libpng-devel',
3130
]
3231

3332

@@ -42,16 +41,16 @@ def generate_sysroot(sysroot: Path, api_version: float, arch: str, quiet=False):
4241
sys.exit('Unknown arch: ' + arch)
4342

4443
base_repo = 'http://download.tizen.org/snapshots/TIZEN/Tizen-{}/Tizen-{}-Base/latest/repos/standard/packages'.format(
45-
api_version,api_version)
44+
api_version, api_version
45+
)
4646
unified_repo = 'http://download.tizen.org/snapshots/TIZEN/Tizen-{}/Tizen-{}-Unified/latest/repos/standard/packages'.format(
47-
api_version, api_version)
47+
api_version, api_version
48+
)
4849

4950
# Retrieve html documents.
5051
documents = {}
51-
for url in ['{}/{}'.format(base_repo, tizen_arch),
52-
'{}/{}'.format(base_repo, 'noarch'),
53-
'{}/{}'.format(unified_repo, tizen_arch),
54-
'{}/{}'.format(unified_repo, 'noarch')]:
52+
for url in ['{}/{}'.format(base_repo, tizen_arch), '{}/{}'.format(base_repo, 'noarch'),
53+
'{}/{}'.format(unified_repo, tizen_arch), '{}/{}'.format(unified_repo, 'noarch')]:
5554
request = urllib.request.Request(url)
5655
with urllib.request.urlopen(request) as response:
5756
documents[url] = response.read().decode('utf-8')
@@ -99,8 +98,7 @@ def generate_sysroot(sysroot: Path, api_version: float, arch: str, quiet=False):
9998
libpath = sysroot / 'usr' / 'lib64'
10099
else:
101100
libpath = sysroot / 'usr' / 'lib'
102-
subprocess.run('cp gcc/*/*/*.o gcc/*/*/*.a .',
103-
shell=True, cwd=libpath, check=True)
101+
subprocess.run('cp gcc/*/*/*.o gcc/*/*/*.a .', shell=True, cwd=libpath, check=True)
104102

105103
# Apply a patch if applicable.
106104
patch = Path(__file__).parent / '{}.patch'.format(arch)
@@ -118,14 +116,16 @@ def main():
118116

119117
# Parse arguments.
120118
parser = argparse.ArgumentParser(description='Tizen sysroot generator')
121-
parser.add_argument('-o', '--out', metavar='PATH', type=str,
122-
help='Path to the output directory')
123-
parser.add_argument('-f', '--force', action='store_true',
124-
help='Force re-downloading of packages')
125-
parser.add_argument('-q', '--quiet', action='store_true',
126-
help='Suppress log output')
127-
parser.add_argument('--api-version', metavar='VER', default=5.5, type=float,
128-
help='Target API version (defaults to 5.5)')
119+
parser.add_argument('-o', '--out', metavar='PATH', type=str, help='Path to the output directory')
120+
parser.add_argument('-f', '--force', action='store_true', help='Force re-downloading of packages')
121+
parser.add_argument('-q', '--quiet', action='store_true', help='Suppress log output')
122+
parser.add_argument(
123+
'--api-version',
124+
metavar='VER',
125+
default=5.5,
126+
type=float,
127+
help='Target API version (defaults to 5.5)'
128+
)
129129
args = parser.parse_args()
130130

131131
if args.out:

tools/gn

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -657,8 +657,7 @@ def to_gn_args(args):
657657
else:
658658
gn_args['skia_use_gl'] = args.target_os != 'fuchsia'
659659

660-
if sys.platform == 'darwin' and args.target_os not in ['android', 'fuchsia',
661-
'linux']:
660+
if sys.platform == 'darwin' and args.target_os not in ['android', 'fuchsia', 'linux']:
662661
# OpenGL is deprecated on macOS > 10.11.
663662
# This is not necessarily needed but enabling this until we have a way to
664663
# build a macOS metal only shell and a gl only shell.
@@ -804,9 +803,8 @@ def to_gn_args(args):
804803
# gen_snapshot, but the build defines otherwise make it look like the build is
805804
# for a host Windows build and make GN think we will be building ANGLE.
806805
# Angle is not used on Mac hosts as there are no tests for the OpenGL backend.
807-
if (is_host_build(args) and
808-
gn_args['host_os'] != 'mac') or (args.target_os == 'linux' and
809-
get_host_os() == 'win'):
806+
if (is_host_build(args) and gn_args['host_os'] != 'mac') or (args.target_os == 'linux' and
807+
get_host_os() == 'win'):
810808
# Do not build unnecessary parts of the ANGLE tree.
811809
gn_args['angle_build_all'] = False
812810
gn_args['angle_has_astc_encoder'] = False

0 commit comments

Comments
 (0)