Skip to content

Commit

Permalink
removed format for python 3.5
Browse files Browse the repository at this point in the history
  • Loading branch information
fernando79513 committed Mar 19, 2024
1 parent 2ccd227 commit 39e3274
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 18 deletions.
14 changes: 7 additions & 7 deletions contrib/genio/bin/brightness_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,22 +126,22 @@ def brightness_test(self, target_interface):

exit_status = 0
find_target_display = False
print(f'Available Interfaces: {self.interfaces}')
print('Available Interfaces: {}'.format(self.interfaces))
for interface in self.interfaces:
if target_interface in interface:
find_target_display = True
# Get the current brightness which we can restore later
original_brightness = self.get_actual_brightness(interface)
print(f'Current brightness: {original_brightness}')
print('Current brightness: {}'.format(original_brightness))

# Get the maximum value for brightness
max_brightness = self.get_max_brightness(interface)
print(f'Maximum brightness: {max_brightness}\n')
print('Maximum brightness: {}\n'.format(max_brightness))

for m in [0, 0.25, 0.5, 0.75, 1]:
# Set the brightness to half the max value
current_brightness = math.ceil(max_brightness * m)
print(f'Set the brightness as {current_brightness}')
print('Set the brightness as {}'.format(current_brightness))
self.write_value(
current_brightness,
os.path.join(interface, 'brightness'))
Expand All @@ -159,7 +159,7 @@ def brightness_test(self, target_interface):
os.path.join(interface, 'brightness'))
print(
'Set brightness back to original value:'
f'{original_brightness}'
'{}'.format(original_brightness)
)
# Close the loop since the target display has been tested
break
Expand Down Expand Up @@ -208,12 +208,12 @@ def main():
file=sys.stderr)
exit(1)

print(f"Test the brightness of '{args.display}' display")
print("Test the brightness of '{}' display".format(args.display))

target_interface = ''
try:
target_interface = tables[args.platform][args.display]
print(f"Interface: {target_interface}\n")
print("Interface: {}\n".format(target_interface))
except KeyError:
raise SystemExit(
f"ERROR: no suitable interface of {args.display} display")
Expand Down
4 changes: 2 additions & 2 deletions contrib/genio/bin/cpu_idle.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ def output_checker(cpu, state, name, disable, usage):
@param:usage
'''
fail = 0
print(f'CPU node: cpu/{cpu}/cpuidle/state{state}')
print(f'Got name: {name[0]}, disable: {disable[0]}, usage: {usage}')
print('CPU node: cpu/{}/cpuidle/state{}'.format(cpu, state))
print('Got name: {}, disable: {}, usage: {}'.format(name[0], disable[0], usage))
if name[0] != name[1]:
node_path = GENERAL_PATH.format(cpu, state, 'name')
error_handler('name', node_path, name[0], name[1])
Expand Down
4 changes: 2 additions & 2 deletions contrib/genio/bin/pmic_regulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ def test_regulator(soc):
expect_set = mt8365_MAIN_REGULATORS if soc == 'mt8365' else MAIN_REGULATORS
current_set = read_all_name()
for node in expect_set:
print(f'Checking the \'{node}\' node exists in System...')
print('Checking the \'{0}\' node exists in System...'.format(node))
if node not in current_set:
missing_node = True
print(
f' - ERROR: expect the \'{node}\' node exist but it doesn\'t')
' - ERROR: expect the \'{0}\' node exist but it doesn\'t'.format(node))

if missing_node:
print('Test Fail')
Expand Down
6 changes: 3 additions & 3 deletions contrib/genio/bin/serialcheck.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ def runcmd(command):

def test_uart_by_serialcheck(soc):
base_path = os.environ.get('PLAINBOX_SESSION_SHARE', '/tmp')
file_path = f'{base_path}/binary'
runcmd([f'dd if=/dev/urandom of={file_path} count=1 bs=4096'])
file_path = '{}/binary'.format(base_path)
runcmd(['dd if=/dev/urandom of={} count=1 bs=4096'.format(file_path)])

golden_msg = (
'cts: 0 dsr: 0 rng: 0 dcd: 0 rx: 12288'
Expand All @@ -39,7 +39,7 @@ def test_uart_by_serialcheck(soc):
fail = False
for br in available_baudrate:
print('\n' + '*' * 80)
print(f'Testing baudrate: {br}\n')
print('Testing baudrate: {}\n'.format(br))
ret = runcmd([cmd.format(tty_node, file_path, br)])
print(ret.stdout)
if ret.returncode != 0 or ret.stdout.split('\n')[-2] != golden_msg:
Expand Down
8 changes: 4 additions & 4 deletions contrib/genio/bin/spidev_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ def test_spi_content_consistency(platform):

check_spi_node(spi_path)

test_bin_path = f'{PLAINBOX_PROVIDER_DATA}/spi/test.bin'
test_bin_path = '{}/spi/test.bin'.format(PLAINBOX_PROVIDER_DATA)
cmd = (
f'genio-test-tool.spidev-test -D'
f' {spi_path} -s 400000 -i {test_bin_path} -v'
'genio-test-tool.spidev-test -D'
' {} -s 400000 -i {} -v'.format(spi_path, test_bin_path)
)
print(f'Run command: {cmd}\n')
print('Run command: {}\n'.format(cmd))
spi_ret = runcmd([cmd])
print(spi_ret.stdout)

Expand Down

0 comments on commit 39e3274

Please sign in to comment.