Skip to content

Commit

Permalink
Fix generating library hyperlinks when pip uses a git source
Browse files Browse the repository at this point in the history
  • Loading branch information
kizniche committed Feb 2, 2025
1 parent 2c642b5 commit 193285d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@
{{_("Library")}}:
{% for each_lib in dict_inputs[each_input.device]['dependencies_module'] -%}
{% if each_lib[0] == 'pip-pypi' %}
{% if "==" in each_lib[2] %}
{% if each_lib[2].startswith("git+") %}
{{each_lib[2]}}
{% elif "==" in each_lib[2] %}
<a href="https://pypi.org/project/{{each_lib[2].split('==')[0]}}/{{each_lib[2].split('==')[1]}}" target="_blank">{{each_lib[2].split('==')[0]}}</a>
{% else %}
<a href="https://pypi.org/project/{{each_lib[2]}}" target="_blank">{{each_lib[2]}}</a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,13 @@
{{_("Library")}}:
{% for each_lib in dict_controllers[each_function.device]['dependencies_module'] -%}
{% if each_lib[0] == 'pip-pypi' %}
{% if "==" in each_lib[2] %}
<a href="https://pypi.org/project/{{each_lib[2].split('==')[0]}}/{{each_lib[2].split('==')[1]}}" target="_blank">{{each_lib[2].split('==')[0]}}</a>
{% else %}
<a href="https://pypi.org/project/{{each_lib[2]}}" target="_blank">{{each_lib[2]}}</a>
{% endif %}
{% if each_lib[2].startswith("git+") %}
{{each_lib[2]}}
{% elif "==" in each_lib[2] %}
<a href="https://pypi.org/project/{{each_lib[2].split('==')[0]}}/{{each_lib[2].split('==')[1]}}" target="_blank">{{each_lib[2].split('==')[0]}}</a>
{% else %}
<a href="https://pypi.org/project/{{each_lib[2]}}" target="_blank">{{each_lib[2]}}</a>
{% endif %}
{% elif each_lib[0] == 'internal' %}
{{each_lib[2]}}
{% else %}
Expand Down
4 changes: 3 additions & 1 deletion mycodo/mycodo_flask/templates/pages/output_options.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@
{{_("Library")}}:
{% for each_lib in dict_outputs[each_output.output_type]['dependencies_module'] -%}
{%- if each_lib[0] == 'pip-pypi' -%}
{%- if "==" in each_lib[2] -%}
{%- if each_lib[2].startswith("git+") -%}
{{each_lib[2]}}
{%- elif "==" in each_lib[2] -%}
<a href="https://pypi.org/project/{{each_lib[2].split('==')[0]}}/{{each_lib[2].split('==')[1]}}" target="_blank">{{each_lib[2].split('==')[0]}}</a>
{%- else -%}
<a href="https://pypi.org/project/{{each_lib[2]}}" target="_blank">{{each_lib[2]}}</a>
Expand Down

0 comments on commit 193285d

Please sign in to comment.