Skip to content

Commit f6d6286

Browse files
authored
Merge branch 'main' into test-speaker-names
2 parents d26a6b9 + e367a52 commit f6d6286

14 files changed

+22
-33
lines changed

.tests/ids_unique.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def check_ids_unique(data_root, verbose=False):
2525
if paths_by_id:
2626
print('Duplicate IDs found:')
2727
for id_, paths in paths_by_id.items():
28-
print('ID {}'.format(id_))
28+
print(f'ID {id_}')
2929
for path in paths:
3030
print('\t', path)
3131
sys.exit(1)

.tests/languages.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def check_ids_unique(data_root, verbose=False):
4545
if bad_lang_by_path:
4646
print('Incorrect languages found:')
4747
for path, lang in bad_lang_by_path.items():
48-
print('{} {}'.format(lang, path))
48+
print(f'{lang} {path}')
4949
sys.exit(1)
5050

5151

.tests/requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,5 @@ jinja2
33
jsonschema
44
pathschema
55
pygments
6-
six
76
termcolor
87
unidecode

.tests/schemas.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def check_schemas(data_root, schemas_dir, verbose=False):
2828
try:
2929
blob = json.load(fp)
3030
except json.decoder.JSONDecodeError as e:
31-
print('\nError JSON-decoding {}'.format(file_path),
31+
print(f'\nError JSON-decoding {file_path}',
3232
flush=True)
3333
if verbose:
3434
print(e, flush=True)

.tests/shape.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def check_render_rest(data_root, verbose=False):
2525

2626
if error_by_path:
2727
for path, blobs in error_by_path.items():
28-
print('Incorrect serialization order in {}'.format(path), flush=True)
28+
print(f'Incorrect serialization order in {path}', flush=True)
2929
blobs = tuple(blob.splitlines(keepends=True) for blob in blobs)
3030
if verbose:
3131
print(''.join(difflib.ndiff(*blobs)), end="")

.tests/slugs_unique.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def check_slugs_unique(data_root, verbose=False):
4040
if paths_by_combo:
4141
print('Duplicate slug combinations found:')
4242
for combo, paths in paths_by_combo.items():
43-
print('Combination {}'.format(combo))
43+
print(f'Combination {combo}')
4444
for path in paths:
4545
print('\t', path)
4646
sys.exit(1)

tools/csv2rst.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#!/usr/bin/env python3
2-
# coding: utf-8
32
"""
43
Prints a table of contents for a lightning talks description field.
54
@@ -42,10 +41,9 @@ def body_line(time, speaker, title, first_line=False):
4241
hiperlink_underscore = ''
4342
else:
4443
hiperlink_underscore = '_'
45-
return (" * - {}{}\n"
46-
" - {}\n"
47-
" - {}\n").format(time, hiperlink_underscore,
48-
speaker.strip(), title.strip())
44+
return (f" * - {time}{hiperlink_underscore}\n"
45+
f" - {speaker.strip()}\n"
46+
f" - {title.strip()}\n")
4947

5048
head = (".. list-table:: Lightning Talks\n"
5149
" :widths: 10 30 60\n"
@@ -117,7 +115,7 @@ def main():
117115
if args.new_csv:
118116
if os.path.exists(csv_path):
119117
raise Exception(
120-
'Error creating new file. File exists: {}'.format(csv_path))
118+
f'Error creating new file. File exists: {csv_path}')
121119
else:
122120
create_sample_csv(csv_path)
123121
description = csv_description_to_rst(csv_path, video_url)

tools/fill_id_field.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#!/usr/bin/env python3
2-
# coding: utf-8
32
"""Fill id field in json video files
43
If a video file is found without id then it gets a id = max(id) + 1"""
54

@@ -21,10 +20,10 @@ def get_json_data(file_name):
2120
try:
2221
data = json.load(f_stream)
2322
except ValueError:
24-
print('Json syntax error in file {}'.format(file_name))
23+
print(f'Json syntax error in file {file_name}')
2524
raise
2625
if 'file_name' in data:
27-
print('"File_name" is not a proper field in {}'.format(file_name))
26+
print(f'"File_name" is not a proper field in {file_name}')
2827
raise ValueError
2928
data['file_name'] = file_name
3029
return data
@@ -61,9 +60,9 @@ def main():
6160
if 'id' in video.keys())
6261
most_common, times_duplicate = all_id.most_common(1)[0]
6362
if times_duplicate > 1:
64-
raise ValueError('Duplicate id: {}'.format(most_common))
63+
raise ValueError(f'Duplicate id: {most_common}')
6564
max_id = max(all_id)
66-
logging.debug('Max id: {}'.format(max_id))
65+
logging.debug(f'Max id: {max_id}')
6766

6867
# Update files
6968
video_without_id = [video for video in tb_video

tools/parse_for_detail.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def parse(path):
2929
try:
3030
data = json.load(fp)
3131
except ValueError:
32-
logging.error('Json syntax error in file {}'.format(path))
32+
logging.error(f'Json syntax error in file {path}')
3333
raise
3434

3535
source = data.get(SOURCE_KEY, '')

tools/pull_related_urls.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def pull_links_from_file(file_):
2121
try:
2222
data = json.load(fp)
2323
except ValueError:
24-
logging.error('Json syntax error in file {}'.format(file_))
24+
logging.error(f'Json syntax error in file {file_}')
2525
raise
2626

2727
description = data.get('description') or ''

0 commit comments

Comments
 (0)