1
0
mirror of https://github.com/konpa/devicon.git synced 2025-08-15 11:04:13 +02:00

New Feature: Upgrade Peekbot (#966)

* Moved stroke detection down

* Add code to retry no connection in peekbot

* Change upload artifact to earlier version

* Clean up logging msg

* Add ability to customize port number

* Update Selenium and geckodriver

* Move upload-artifact version to 2.2.4

* Add logging for webdriver retry

* Add color checking to peek-bot
This commit is contained in:
Thomas Bui
2021-12-21 12:33:41 -08:00
committed by GitHub
parent 34a54bcf1a
commit 2a8c499605
9 changed files with 112 additions and 26 deletions

View File

@@ -7,17 +7,17 @@ def main():
runner = None
try:
args = arg_getters.get_selenium_runner_args(peek_mode=True)
new_icons = filehandler.get_json_file_content(args.devicon_json_path)
all_icons = filehandler.get_json_file_content(args.devicon_json_path)
# get only the icon object that has the name matching the pr title
filtered_icon = util.find_object_added_in_pr(new_icons, args.pr_title)
filtered_icon = util.find_object_added_in_pr(all_icons, args.pr_title)
check_devicon_object(filtered_icon)
print("Icon being checked:", filtered_icon, sep = "\n", end='\n\n')
runner = PeekSeleniumRunner(args.download_path, args.geckodriver_path, args.headless)
svgs = filehandler.get_svgs_paths([filtered_icon], args.icons_folder_path, True)
screenshot_folder = filehandler.create_screenshot_folder("./")
svgs_with_strokes = runner.peek(svgs, screenshot_folder)
svgs_with_strokes = runner.peek(svgs, screenshot_folder, filtered_icon)
print("Task completed.")
message = ""
@@ -36,6 +36,7 @@ def main():
def check_devicon_object(icon: dict):
"""
Check that the devicon object added is up to standard.
:param icon: a dictionary containing info on an icon. Taken from the devicon.json.
:return a string containing the error messages if any.
"""
err_msgs = []