Skip to content

Commit

Permalink
[ci] auto-format
Browse files Browse the repository at this point in the history
  • Loading branch information
brostosjoined authored and github-actions[bot] committed Oct 3, 2023
1 parent 5c86064 commit e57c541
Showing 1 changed file with 13 additions and 15 deletions.
28 changes: 13 additions & 15 deletions plugin_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
PLUGIN_DIRECTORY = _env["python_directory_user"]
loop = babase._asyncio._asyncio_event_loop


def _regexp_friendly_class_name_shortcut(string): return string.replace(".", "\\.")


Expand Down Expand Up @@ -101,7 +102,7 @@ def send_network_request(request):


async def async_send_network_request(request):

response = await loop.run_in_executor(None, send_network_request, request)
return response

Expand Down Expand Up @@ -130,7 +131,7 @@ def stream_network_response_to_file(request, file, md5sum=None, retries=3):


async def async_stream_network_response_to_file(request, file, md5sum=None, retries=3):

content = await loop.run_in_executor(
None,
stream_network_response_to_file,
Expand Down Expand Up @@ -538,7 +539,7 @@ async def get_content(self):
if self._content is None:
if not self.is_installed:
raise PluginNotInstalled("Plugin is not available locally.")

self._content = await loop.run_in_executor(None, self._get_content)
return self._content

Expand Down Expand Up @@ -670,7 +671,7 @@ def set_version(self, version):

async def set_content(self, content):
if not self._content:

await loop.run_in_executor(None, self._set_content, content)
self._content = content
return self
Expand Down Expand Up @@ -856,7 +857,7 @@ def __init__(self, plugin, origin_widget, button_callback=lambda: None):
self.plugin = plugin
self.button_callback = button_callback
self.scale_origin = origin_widget.get_screen_space_center()

loop.create_task(self.draw_ui())

def get_description(self, minimum_character_offset=40):
Expand Down Expand Up @@ -1108,7 +1109,7 @@ async def asyncio_handler(fn, self, *args, **kwargs):

def wrapper(self, *args, **kwargs):
self._ok()

if asyncio.iscoroutinefunction(fn):
loop.create_task(asyncio_handler(fn, self, *args, **kwargs))
else:
Expand Down Expand Up @@ -1370,8 +1371,6 @@ def __init__(self, origin_widget):
# autoselect=True,
description="Add Source")



bui.buttonwidget(parent=self._root_widget,
position=(330, 28),
size=(37, 37),
Expand Down Expand Up @@ -1476,7 +1475,7 @@ def _update_custom_sources_widget(self):
on_activate_call=self.show_sources_window)

def popup_menu_selected_choice(self, window, choice):

loop.create_task(self._asyncio_callback(choice))

def popup_menu_closing(self, window):
Expand All @@ -1498,7 +1497,6 @@ def __init__(self, transition: str = "in_right", origin_widget: bui.Widget = Non
self.selected_category = None
self.plugins_in_current_view = {}


loop.create_task(self.draw_index())

self._width = (700 if _uiscale is babase.UIScale.SMALL
Expand Down Expand Up @@ -1693,7 +1691,7 @@ def draw_search_bar(self):
description=filter_txt)
self._last_filter_text = None
self._last_filter_plugins = []

loop.create_task(self.process_search_term())

async def process_search_term(self):
Expand Down Expand Up @@ -1752,7 +1750,7 @@ def draw_refresh_icon(self):
500 if _uiscale is babase.UIScale.MEDIUM else 510)
refresh_pos_y = (180 if _uiscale is babase.UIScale.SMALL else
108 if _uiscale is babase.UIScale.MEDIUM else 120)

controller_button = bui.buttonwidget(parent=self._root_widget,
# autoselect=True,
position=(refresh_pos_x, refresh_pos_y),
Expand Down Expand Up @@ -1909,7 +1907,7 @@ def __init__(self, plugin_manager, origin_widget):
self._plugin_manager = plugin_manager
self.scale_origin = origin_widget.get_screen_space_center()
self.settings = babase.app.config["Community Plugin Manager"]["Settings"].copy()

loop.create_task(self.draw_ui())

async def draw_ui(self):
Expand Down Expand Up @@ -2029,7 +2027,7 @@ async def draw_ui(self):
plugin_manager_update_available = False
if plugin_manager_update_available:
text_color = (0.75, 0.2, 0.2)

button_size = (95 * s, 32 * s)
update_button_label = f'Update to v{plugin_manager_update_available[0]}'
self._update_button = bui.buttonwidget(parent=self._root_widget,
Expand Down Expand Up @@ -2484,5 +2482,5 @@ def on_app_running(self) -> None:
DNSBlockWorkaround.apply()
asyncio.set_event_loop(babase._asyncio._asyncio_event_loop)
startup_tasks = StartupTasks()

loop.create_task(startup_tasks.execute())

0 comments on commit e57c541

Please sign in to comment.