We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ok updated, when converting to GHA, we don't need that uglyKEYcheck anymore. so i don't bring it here.
uglyKEYcheck
import yaml import requests from uglyKEYcheck import search_in_url maindomain = "https://aiidateam.github.io/aiida-registry/" def load_yaml_file(file_path): with open(file_path, 'r') as file: return yaml.safe_load(file) def save_yaml_file(file_path, data): with open(file_path, 'w') as file: yaml.safe_dump(data, file, sort_keys=False) def check_if_toml(url): new_url = '/'.join(url.split('/')[:-1]) + '/pyproject.toml' response = requests.head(new_url, timeout=10) if response.status_code == 404: return None else: return new_url def check_urls(data): updates = False for plugin, info in data.items(): url = info.get("plugin_info") if url: try: response = requests.get(url, allow_redirects=True) if response.status_code == 404: new_url = check_if_toml(url) if new_url: print(f"{plugin}: returned a 404 status. But *pyproject.toml* detected!") if search_in_url(maindomain+plugin, 'W002'): data[plugin]["plugin_info"] = new_url updates = True print(plugin, ' updated') else: print(f"{plugin}: returned a 404 status. No *pyproject.toml* detected.") else: pass except requests.RequestException as e: print(f"Error checking {plugin}: {url}. Error: {e}") return updates yaml_file_path = 'plugins.yaml' data = load_yaml_file(yaml_file_path) if check_urls(data): save_yaml_file('plugins-out.yaml', data) print("YAML file updated.")
Originally posted by @khsrali in #309 (comment)
The text was updated successfully, but these errors were encountered:
khsrali
No branches or pull requests
ok updated, when converting to GHA, we don't need that
uglyKEYcheck
anymore. so i don't bring it here.Originally posted by @khsrali in #309 (comment)
The text was updated successfully, but these errors were encountered: