webcode-tk 1.2.18__tar.gz → 1.2.19__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.
@@ -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,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "webcode-tk"
3
- version = "1.2.18"
3
+ version = "1.2.19"
4
4
  description = "A set of tools for inspecting HTML and CSS code"
5
5
  authors = ["hundredvisionsguy <cwinikka@gmail.com>"]
6
6
  keywords = ["html", "validation", "css", ]
@@ -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"
@@ -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
 
File without changes
File without changes