webcode-tk 1.2.18__tar.gz → 1.2.20__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {webcode_tk-1.2.18 → webcode_tk-1.2.20}/PKG-INFO +1 -1
- {webcode_tk-1.2.18 → webcode_tk-1.2.20}/pyproject.toml +1 -1
- {webcode_tk-1.2.18 → webcode_tk-1.2.20}/webcode_tk/__init__.py +1 -1
- {webcode_tk-1.2.18 → webcode_tk-1.2.20}/webcode_tk/font_tools.py +18 -8
- {webcode_tk-1.2.18 → webcode_tk-1.2.20}/LICENSE.rst +0 -0
- {webcode_tk-1.2.18 → webcode_tk-1.2.20}/README.rst +0 -0
- {webcode_tk-1.2.18 → webcode_tk-1.2.20}/webcode_tk/_style_inheritance.py +0 -0
- {webcode_tk-1.2.18 → webcode_tk-1.2.20}/webcode_tk/animation_tools.py +0 -0
- {webcode_tk-1.2.18 → webcode_tk-1.2.20}/webcode_tk/cascade_tools.py +0 -0
- {webcode_tk-1.2.18 → webcode_tk-1.2.20}/webcode_tk/color_keywords.py +0 -0
- {webcode_tk-1.2.18 → webcode_tk-1.2.20}/webcode_tk/color_tools.py +0 -0
- {webcode_tk-1.2.18 → webcode_tk-1.2.20}/webcode_tk/contrast_tools.py +0 -0
- {webcode_tk-1.2.18 → webcode_tk-1.2.20}/webcode_tk/css_tools.py +0 -0
- {webcode_tk-1.2.18 → webcode_tk-1.2.20}/webcode_tk/html_tools.py +0 -0
- {webcode_tk-1.2.18 → webcode_tk-1.2.20}/webcode_tk/sample_report.json +0 -0
- {webcode_tk-1.2.18 → webcode_tk-1.2.20}/webcode_tk/utils.py +0 -0
- {webcode_tk-1.2.18 → webcode_tk-1.2.20}/webcode_tk/ux_tools.py +0 -0
- {webcode_tk-1.2.18 → webcode_tk-1.2.20}/webcode_tk/validator_tools.py +0 -0
|
@@ -404,9 +404,9 @@ def get_google_font_report(project_dir: str, min=1, max=2) -> str:
|
|
|
404
404
|
# Check to see the linked fonts match required number.
|
|
405
405
|
num_fonts = len(google_fonts_linked)
|
|
406
406
|
if num_fonts < min:
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
report.append(
|
|
407
|
+
result = f"fail: {filename} does not link to min number of Google "
|
|
408
|
+
result += "fonts."
|
|
409
|
+
report.append(result)
|
|
410
410
|
continue
|
|
411
411
|
|
|
412
412
|
# if we have any google fonts, are they being used?
|
|
@@ -425,12 +425,20 @@ def get_google_font_report(project_dir: str, min=1, max=2) -> str:
|
|
|
425
425
|
|
|
426
426
|
num_used = len(fonts_used)
|
|
427
427
|
if num_used >= min and num_used <= max:
|
|
428
|
-
|
|
429
|
-
|
|
428
|
+
result = (
|
|
429
|
+
f"pass: {filename} uses the correct number of Google fonts"
|
|
430
|
+
)
|
|
431
|
+
report.append(result)
|
|
432
|
+
elif num_used > max:
|
|
433
|
+
result = f"fail: {filename} has too many font families - max is "
|
|
434
|
+
result += f"{max}, and you have {num_used} families."
|
|
435
|
+
report.append(result)
|
|
430
436
|
else:
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
437
|
+
result = (
|
|
438
|
+
f"fail: {filename} with {num_used} font families does not "
|
|
439
|
+
)
|
|
440
|
+
result += "have enough applied Google fonts"
|
|
441
|
+
report.append(result)
|
|
434
442
|
return report
|
|
435
443
|
|
|
436
444
|
|
|
@@ -442,6 +450,7 @@ def extract_families(family_data: list) -> list:
|
|
|
442
450
|
family = family.strip()
|
|
443
451
|
family = family.replace('"', "")
|
|
444
452
|
family = family.replace("'", "")
|
|
453
|
+
family = family.replace("&", "")
|
|
445
454
|
families.append(family)
|
|
446
455
|
return families
|
|
447
456
|
|
|
@@ -453,6 +462,7 @@ def get_google_font_data(href: str) -> list:
|
|
|
453
462
|
for item in font_data:
|
|
454
463
|
family = item.split(":")[0]
|
|
455
464
|
family = family.replace("+", " ")
|
|
465
|
+
family = family.replace("&", "")
|
|
456
466
|
font_families.append(family)
|
|
457
467
|
return font_families
|
|
458
468
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|