Skip to content

Commit

Permalink
Update prtester.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Bockiii authored Oct 14, 2024
1 parent af26d84 commit b6bfbaf
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions .github/prtester.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ def main(instances: Iterable[Instance], with_upload: bool, with_reduced_upload:

def testBridges(instance: Instance, bridge_cards: Iterable, with_upload: bool, with_reduced_upload: bool) -> Iterable:
instance_suffix = ''
tester_url = 'https://bockiii.github.io/prs/'
if instance.name:
instance_suffix = f' ({instance.name})'
table_rows = []
Expand Down Expand Up @@ -140,10 +141,10 @@ def testBridges(instance: Instance, bridge_cards: Iterable, with_upload: bool, w
if status_is_ok:
status = '✔️'
if with_upload and (not with_reduced_upload or not status_is_ok):
termpad = requests.post(url="https://termpad.com/", data=page_text)
termpad_url = termpad.text.strip()
termpad_url = termpad_url.replace('termpad.com/','termpad.com/raw/')
table_rows.append(f'| {bridge_name} | [{form_number} {context_name}{instance_suffix}]({termpad_url}) | {status} |')
filename = os.getcwd() + '/' + {instance.name} + '_' + {form_number} + '.html'
with open(file=filename, mode='w+', encoding='utf-8') as file:
file.write(page_text)
table_rows.append(f'| {bridge_name} | [{form_number} {context_name}{instance_suffix}]({tester_url}) | {status} |')
form_number += 1
return table_rows

Expand Down Expand Up @@ -187,4 +188,4 @@ def getFirstLine(value: str) -> str:
with_reduced_upload=args.reduced_upload and not args.no_upload,
title=args.title,
output_file=args.output_file
);
);

0 comments on commit b6bfbaf

Please sign in to comment.