webcode-tk 1.2.18__py3-none-any.whl → 1.2.19__py3-none-any.whl

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/__init__.py CHANGED
@@ -40,4 +40,4 @@
40
40
  - **`validator_tools`**: sends HTML or CSS code to the W3C Validator to check
41
41
  for errors.
42
42
  """
43
- __version__ = "1.2.18"
43
+ __version__ = "1.2.19"
webcode_tk/font_tools.py CHANGED
@@ -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
- data = f"fail: {filename} does not link to min number of Google "
408
- data += "fonts."
409
- report.append(data)
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
- data = f"pass: {filename} uses the correct number of Google fonts"
429
- report.append(data)
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
- data = f"fail: {filename} with {num_used} font families does not "
432
- data += "have enough applied Google fonts"
433
- report.append(data)
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
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: webcode-tk
3
- Version: 1.2.18
3
+ Version: 1.2.19
4
4
  Summary: A set of tools for inspecting HTML and CSS code
5
5
  License: MIT
6
6
  License-File: LICENSE.rst
@@ -1,4 +1,4 @@
1
- webcode_tk/__init__.py,sha256=23ZVXqyx5zzH4KzHsOkB4Nc4ee1EH-252M9AMO7z_mc,1759
1
+ webcode_tk/__init__.py,sha256=MZioMDKm73mh0CFf0JdUtNrOb0bBJ2OMgbpUs03rx08,1759
2
2
  webcode_tk/_style_inheritance.py,sha256=LtJM2jPPF6kHOs1LKyenSdpZ5cSiDwZ02Y1UAsSJR8o,13778
3
3
  webcode_tk/animation_tools.py,sha256=pBRo-30AUxKIi6YLQIyWzGbkkexUhkwGS_IXngWK0qc,12261
4
4
  webcode_tk/cascade_tools.py,sha256=nCID-4s8Jwum8eEkLCYxNETGqroz_j3VLdj_Tgi0S0k,75242
@@ -6,13 +6,13 @@ webcode_tk/color_keywords.py,sha256=zBJOQ_AQDHo1Rcgsn1D2P8v1WsHxm5g-ECwgsRTF91A,
6
6
  webcode_tk/color_tools.py,sha256=FEbv_1fIw4qqnXvRTPkNtb-3-IhhrQX82jXTmVm7aJY,33430
7
7
  webcode_tk/contrast_tools.py,sha256=yhZTjNgOSklMm3aEX-NlI_n1s2m1ir3acNfafoSQA44,47614
8
8
  webcode_tk/css_tools.py,sha256=gOwHDnSphQoyW5FQC7Plv6l4hUq72IaPG2hCXBY60eE,110099
9
- webcode_tk/font_tools.py,sha256=TykTpAObTJRV5f-mO5YOEVI8kFC95gF5iaYkwayhJUQ,14758
9
+ webcode_tk/font_tools.py,sha256=AUIfRn4BkzEak2oik4-xY3FgUZR2oAEJ_thb9sOEqrQ,15127
10
10
  webcode_tk/html_tools.py,sha256=LjiVbWVwarOQPWcBb4KTb70dnYxoC3HUGFtjt3LheuE,15706
11
11
  webcode_tk/sample_report.json,sha256=2aS7bG-SBb0dd7hUTF4oLx9wRM_Y36cBiTSLvGg8O3U,742
12
12
  webcode_tk/utils.py,sha256=u6OzKUzHdpIqJa4nRzmiZWwx2wfZMBaTT60enEhv_7A,457
13
13
  webcode_tk/ux_tools.py,sha256=cmmvk8mKc9hnQSk7e7lT1oJd6RVMv0zI560ty4XxH98,17432
14
14
  webcode_tk/validator_tools.py,sha256=MnAM76dGJll4zMOAhJU2c8NiQ_tzENx9KYKTClFT4cc,12393
15
- webcode_tk-1.2.18.dist-info/METADATA,sha256=zYmBx7cQ-2-3U0HEQlYljZKQrFwZWGi7v9i51xIWXjI,1625
16
- webcode_tk-1.2.18.dist-info/WHEEL,sha256=EGEvSphFYqXKs23-kQBeyNoJP1nrT8ZJKQoi5p5DYL8,88
17
- webcode_tk-1.2.18.dist-info/licenses/LICENSE.rst,sha256=pQATSvV-waHNcl3zpaU8JGEV51KvC33JoSkt9il8Mss,35430
18
- webcode_tk-1.2.18.dist-info/RECORD,,
15
+ webcode_tk-1.2.19.dist-info/METADATA,sha256=c8VJcjEw0REzOXtjz-8eAuF-suaKzYwh6c2QC42yZRo,1625
16
+ webcode_tk-1.2.19.dist-info/WHEEL,sha256=EGEvSphFYqXKs23-kQBeyNoJP1nrT8ZJKQoi5p5DYL8,88
17
+ webcode_tk-1.2.19.dist-info/licenses/LICENSE.rst,sha256=pQATSvV-waHNcl3zpaU8JGEV51KvC33JoSkt9il8Mss,35430
18
+ webcode_tk-1.2.19.dist-info/RECORD,,