Functions | |
str | attention_color_string () |
str | bright_color_string () |
def | construct_git_url (repo, filename) |
Optional[str] | get_assigned_string_literal (str line) |
def | get_desc_regex (repo) |
str | get_macro_version_from_file (str filename) |
def | get_metadata_url (url) |
def | get_readme_html_url (repo) |
def | get_readme_url (repo) |
def | get_zip_url (repo) |
bool | is_darkmode () |
bool | is_float (Any element) |
bool | recognized_git_location (repo) |
def | remove_directory_if_empty (dir) |
None | repair_git_repo (str repo_url, str clone_dir) |
def | restart_freecad () |
def | symlink (source, link_name) |
def | update_macro_details (old_macro, new_macro) |
None | update_macro_installation_details (repo) |
str | warning_color_string () |
Variables | |
translate = FreeCAD.Qt.translate | |
str addonmanager_utilities.attention_color_string | ( | ) |
A shade of orange, adapted to darkmode if possible. Targets a minimum 7:1 contrast ratio.
References is_darkmode().
str addonmanager_utilities.bright_color_string | ( | ) |
A shade of green, adapted to darkmode if possible. Targets a minimum 7:1 contrast ratio.
References is_darkmode().
def addonmanager_utilities.construct_git_url | ( | repo, | |
filename | |||
) |
Returns a direct download link to a file in an online Git repo
Referenced by get_metadata_url(), and get_readme_url().
Look for a line of the form my_var = "A string literal" and return the string literal. If the assignment is of a floating point value, that value is converted to a string and returned. If neither is true, returns None.
References is_float().
Referenced by get_macro_version_from_file().
def addonmanager_utilities.get_desc_regex | ( | repo | ) |
Returns a regex string that extracts a WB description to be displayed in the description panel of the Addon manager, if the README could not be found
Get the version of the macro from a local macro file. Supports strings, ints, and floats, as well as a reference to __date__
References get_assigned_string_literal().
Referenced by update_macro_installation_details().
def addonmanager_utilities.get_metadata_url | ( | url | ) |
Returns the location of a package.xml metadata file
References construct_git_url().
def addonmanager_utilities.get_readme_html_url | ( | repo | ) |
Returns the location of a html file containing readme
def addonmanager_utilities.get_readme_url | ( | repo | ) |
Returns the location of a readme file
References construct_git_url().
def addonmanager_utilities.get_zip_url | ( | repo | ) |
Returns the location of a zip file from a repo, if available
bool addonmanager_utilities.is_darkmode | ( | ) |
Heuristics to determine if we are in a darkmode stylesheet
Referenced by attention_color_string(), bright_color_string(), and warning_color_string().
bool addonmanager_utilities.is_float | ( | Any | element | ) |
Referenced by get_assigned_string_literal().
bool addonmanager_utilities.recognized_git_location | ( | repo | ) |
Returns whether this repo is based at a known git repo location: works with github, gitlab, framagit, and salsa.debian.org
def addonmanager_utilities.remove_directory_if_empty | ( | dir | ) |
Remove the directory if it is empty Directory FreeCAD.getUserMacroDir(True) will not be removed even if empty.
def addonmanager_utilities.restart_freecad | ( | ) |
Shuts down and restarts FreeCAD
def addonmanager_utilities.symlink | ( | source, | |
link_name | |||
) |
Creates a symlink of a file, if possible. Note that it fails on most modern Windows installations
def addonmanager_utilities.update_macro_details | ( | old_macro, | |
new_macro | |||
) |
Update a macro with information from another one Update a macro with information from another one, supposedly the same but from a different source. The first source is supposed to be git, the second one the wiki.
None addonmanager_utilities.update_macro_installation_details | ( | repo | ) |
References get_macro_version_from_file().
str addonmanager_utilities.warning_color_string | ( | ) |
A shade of red, adapted to darkmode if possible. Targets a minimum 7:1 contrast ratio.
References is_darkmode().
addonmanager_utilities.translate = FreeCAD.Qt.translate |