webcode-tk 1.2.8__tar.gz → 1.2.11__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.8 → webcode_tk-1.2.11}/PKG-INFO +1 -1
- {webcode_tk-1.2.8 → webcode_tk-1.2.11}/pyproject.toml +1 -1
- {webcode_tk-1.2.8 → webcode_tk-1.2.11}/webcode_tk/__init__.py +1 -1
- {webcode_tk-1.2.8 → webcode_tk-1.2.11}/webcode_tk/css_tools.py +1 -0
- {webcode_tk-1.2.8 → webcode_tk-1.2.11}/webcode_tk/html_tools.py +23 -0
- {webcode_tk-1.2.8 → webcode_tk-1.2.11}/webcode_tk/validator_tools.py +0 -15
- {webcode_tk-1.2.8 → webcode_tk-1.2.11}/LICENSE.rst +0 -0
- {webcode_tk-1.2.8 → webcode_tk-1.2.11}/README.rst +0 -0
- {webcode_tk-1.2.8 → webcode_tk-1.2.11}/webcode_tk/animation_tools.py +0 -0
- {webcode_tk-1.2.8 → webcode_tk-1.2.11}/webcode_tk/cascade_tools.py +0 -0
- {webcode_tk-1.2.8 → webcode_tk-1.2.11}/webcode_tk/color_keywords.py +0 -0
- {webcode_tk-1.2.8 → webcode_tk-1.2.11}/webcode_tk/color_tools.py +0 -0
- {webcode_tk-1.2.8 → webcode_tk-1.2.11}/webcode_tk/contrast_tools.py +0 -0
- {webcode_tk-1.2.8 → webcode_tk-1.2.11}/webcode_tk/font_tools.py +0 -0
- {webcode_tk-1.2.8 → webcode_tk-1.2.11}/webcode_tk/sample_report.json +0 -0
- {webcode_tk-1.2.8 → webcode_tk-1.2.11}/webcode_tk/utils.py +0 -0
- {webcode_tk-1.2.8 → webcode_tk-1.2.11}/webcode_tk/ux_tools.py +0 -0
|
@@ -2675,6 +2675,7 @@ def get_properties_applied_report(project_dir: str, goals: dict) -> list:
|
|
|
2675
2675
|
)
|
|
2676
2676
|
if selector_type == "grouped_selector":
|
|
2677
2677
|
sel_split = selector.split(",")
|
|
2678
|
+
sel_split = [s.strip() for s in sel_split]
|
|
2678
2679
|
if element in sel_split:
|
|
2679
2680
|
take_targetted_properties(
|
|
2680
2681
|
properties_found,
|
|
@@ -50,6 +50,29 @@ def get_all_html_files(dir_path: str) -> list:
|
|
|
50
50
|
return html_files
|
|
51
51
|
|
|
52
52
|
|
|
53
|
+
def get_image_hotlinks(soup: BeautifulSoup) -> list:
|
|
54
|
+
"""Returns a list of all img src values that are external (hotlinked) URLs.
|
|
55
|
+
|
|
56
|
+
Hotlinked images are those with src attributes pointing to external
|
|
57
|
+
domains rather than local/relative paths. I ask that all students avoid
|
|
58
|
+
hotlinking images, as it's bad form and generally frowned upon.
|
|
59
|
+
|
|
60
|
+
Args:
|
|
61
|
+
soup: html soupt object.
|
|
62
|
+
|
|
63
|
+
Returns:
|
|
64
|
+
hotlinks: a list of hotlinked image srcs"""
|
|
65
|
+
hotlinks = []
|
|
66
|
+
# Get all img urls
|
|
67
|
+
image_elements = soup.find_all("img")
|
|
68
|
+
image_srcs = [img["src"] for img in image_elements]
|
|
69
|
+
for src in image_srcs:
|
|
70
|
+
if "http" in src[:4]:
|
|
71
|
+
hotlinks.append(src)
|
|
72
|
+
|
|
73
|
+
return hotlinks
|
|
74
|
+
|
|
75
|
+
|
|
53
76
|
def get_html(file_path: str) -> BeautifulSoup:
|
|
54
77
|
"""Returns an html document (from file_path) as a BeautifulSoup object
|
|
55
78
|
|
|
@@ -360,18 +360,3 @@ if __name__ == "__main__":
|
|
|
360
360
|
print("report is a {}.".format(type(report)))
|
|
361
361
|
for item in report:
|
|
362
362
|
print(item)
|
|
363
|
-
num_errors = get_num_markup_errors(report)
|
|
364
|
-
# how many html files in project directory?
|
|
365
|
-
html_files = get_html_file_names()
|
|
366
|
-
|
|
367
|
-
# test getting number of errorsz
|
|
368
|
-
print(get_num_errors(report))
|
|
369
|
-
|
|
370
|
-
css_code = clerk.file_to_string("tests/test_files/css_for_testing.css")
|
|
371
|
-
css_validator_results = validate_css(css_code)
|
|
372
|
-
is_valid = is_css_valid(css_validator_results)
|
|
373
|
-
print(is_valid)
|
|
374
|
-
css_validator_results = validate_css("p } color: #336699; }")
|
|
375
|
-
print(css_validator_results)
|
|
376
|
-
is_valid = is_css_valid(css_validator_results)
|
|
377
|
-
print(is_valid)
|
|
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
|