Skip to content

Commit

Permalink
Fix code style issues with Black
Browse files Browse the repository at this point in the history
  • Loading branch information
weee-open-bot committed Oct 23, 2024
1 parent 4f76285 commit 98ce2a2
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 31 deletions.
2 changes: 1 addition & 1 deletion basilico.py
Original file line number Diff line number Diff line change
Expand Up @@ -778,7 +778,7 @@ def sudo_password(self, _cmd: str, password: str):

result = subprocess.run(
["sudo", "-vS"],
input=password+"\n",
input=password + "\n",
encoding="utf-8",
stderr=subprocess.PIPE,
stdout=subprocess.PIPE,
Expand Down
2 changes: 1 addition & 1 deletion constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@

# BASILICO

#TODO
# TODO

# GENERIC
VERSION = "2.0.0"
14 changes: 4 additions & 10 deletions pinolo.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def setup(self):
self.actionSourceCode.triggered.connect(self.open_source_code)
self.actionAboutUs.triggered.connect(self.open_website)
self.actionVersion.triggered.connect(self.show_version)

def start_client(self):
"""This method must be called in __init__ function of Ui class
to initialize pinolo session"""
Expand Down Expand Up @@ -516,10 +516,7 @@ def load_system(self, std=False, drives=None):
if self.default_system_path:
directory = self.default_system_path.rsplit("/", 1)[0] + "/"
else:
critical_dialog(
"There is no default image set in Pinolo settings.",
dialog_type="ok"
)
critical_dialog("There is no default image set in Pinolo settings.", dialog_type="ok")
return
if drives_qty == 0:
if not std:
Expand Down Expand Up @@ -801,7 +798,7 @@ def resize_queue_table_to_contents(self):

def _send_sudo_password(self, password: str):
# password = password.replace('\\', '\\\\').replace(" ", "\\ ")
self.client.send(f'sudo_password {password}')
self.client.send(f"sudo_password {password}")

def gui_update(self, cmd: str, params: str):
"""
Expand Down Expand Up @@ -943,10 +940,7 @@ def gui_update(self, cmd: str, params: str):
self._send_sudo_password(passwd)
else:
warning_dialog(
"You did not enter the root password.\n"
"Some commands may not work correctly.\n"
"Refresh to insert the password.",
dialog_type="ok"
"You did not enter the root password.\n" "Some commands may not work correctly.\n" "Refresh to insert the password.", dialog_type="ok"
)

self.check_disk_usage()
Expand Down
1 change: 1 addition & 0 deletions ui/SelectSystemDialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ def retranslateUi(self, SelectSystemDialog):

if __name__ == "__main__":
import sys

app = QtWidgets.QApplication(sys.argv)
SelectSystemDialog = QtWidgets.QDialog()
ui = Ui_SelectSystemDialog()
Expand Down
11 changes: 4 additions & 7 deletions widgets/NetworkSettings.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,17 +184,14 @@ def load_completer(self):

def find_image(self):
"""
This function opens a different dialog if
the user is in local or remote mode to search for a cannolo image.
This function opens a different dialog if
the user is in local or remote mode to search for a cannolo image.
"""

if self.parent.serverMode == REMOTE_MODE:
directory = self.defaultSystemLineEdit.text()
if directory == '':
warning_dialog(
"Il path per l'immagine di sistema di default è vuoto. Impostalo plz.",
dialog_type="ok"
)
if directory == "":
warning_dialog("Il path per l'immagine di sistema di default è vuoto. Impostalo plz.", dialog_type="ok")
return
splitted_dir = directory.rsplit("/", 1)
if len(splitted_dir[1].split(".")) > 1:
Expand Down
18 changes: 6 additions & 12 deletions widgets/SelectSystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,9 @@
from pinolo import PinoloMainWindow
from widgets.NetworkSettings import NetworkSettings


class SelectSystemDialog(QDialog, Ui_SelectSystemDialog):
def __init__(
self,
parent: QObject,
is_load_system: bool,
path: str,
images: list = None,
network_settings_dialog: 'NetworkSettings' = None
):
def __init__(self, parent: QObject, is_load_system: bool, path: str, images: list = None, network_settings_dialog: "NetworkSettings" = None):
super(SelectSystemDialog, self).__init__(parent)
self.setupUi(self)

Expand Down Expand Up @@ -47,7 +41,7 @@ def ask_for_image(self, images: list):

def select(self):
"""
Selected iso from isoList is set as default system path in network settings.
Selected iso from isoList is set as default system path in network settings.
"""

if self.isoList.currentItem() is None:
Expand All @@ -58,12 +52,12 @@ def select(self):
for iso_dir in self.images:
if iso in iso_dir:
if self.is_load_system:
pinolo: 'PinoloMainWindow' = self.parent()
pinolo: "PinoloMainWindow" = self.parent()
pinolo.load_selected_system(iso_dir, iso)
break
else:
network_settings: 'NetworkSettings' = self.parent()
network_settings: "NetworkSettings" = self.parent()
network_settings.defaultSystemLineEdit.setText(iso_dir)
break

self.close()
self.close()

0 comments on commit 98ce2a2

Please sign in to comment.