Skip to content

Commit

Permalink
Run linting
Browse files Browse the repository at this point in the history
  • Loading branch information
Sj-Si committed Jan 15, 2024
1 parent f49c220 commit 1fdc18e
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions modules/ui_extra_networks.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
from fastapi.exceptions import HTTPException

from modules.infotext_utils import image_from_url_text
from modules.ui_components import ToolButton

extra_pages = []
allowed_dirs = set()
Expand Down Expand Up @@ -225,7 +224,6 @@ def create_item_html(
width = f"width: {shared.opts.extra_networks_card_width}px;" if shared.opts.extra_networks_card_width else ''
background_image = f'<img src="{html.escape(preview)}" class="preview" loading="lazy">' if preview else ''


onclick = item.get("onclick", None)
if onclick is None:
# Don't quote prompt/neg_prompt since they are stored as js strings already.
Expand All @@ -239,7 +237,7 @@ def create_item_html(
}
)
onclick = html.escape(onclick)

btn_copy_path = self.btn_copy_path_tpl.format(**{"filename": item["filename"]})
btn_metadata = ""
metadata = item.get("metadata")
Expand Down Expand Up @@ -551,8 +549,6 @@ def tab_name_score(name):
return sorted(pages, key=lambda x: tab_scores[x.name])

def create_ui(interface: gr.Blocks, unrelated_tabs, tabname):
from modules.ui import switch_values_symbol

ui = ExtraNetworksUi()
ui.pages = []
ui.pages_contents = []
Expand Down Expand Up @@ -588,6 +584,9 @@ def create_ui(interface: gr.Blocks, unrelated_tabs, tabname):
ui.button_save_preview = gr.Button('Save preview', elem_id=tabname+"_save_preview", visible=False)
ui.preview_target_filename = gr.Textbox('Preview save filename', elem_id=tabname+"_preview_filename", visible=False)

for tab in unrelated_tabs:
tab.select(fn=None, _js='function(){ extraNetworksUrelatedTabSelected("' + tabname + '"); }', inputs=[], outputs=[], show_progress=False)

def create_html():
ui.pages_contents = [pg.create_html(ui.tabname) for pg in ui.stored_extra_pages]

Expand Down

0 comments on commit 1fdc18e

Please sign in to comment.