mirror of
https://github.com/onionshare/onionshare.git
synced 2025-06-08 06:43:00 -04:00
Format all code using black
This commit is contained in:
parent
8010b279e7
commit
88e151d414
87 changed files with 4293 additions and 2374 deletions
|
@ -19,19 +19,30 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
"""
|
||||
from PyQt5 import QtCore, QtWidgets, QtGui
|
||||
|
||||
|
||||
class Alert(QtWidgets.QMessageBox):
|
||||
"""
|
||||
An alert box dialog.
|
||||
"""
|
||||
def __init__(self, common, message, icon=QtWidgets.QMessageBox.NoIcon, buttons=QtWidgets.QMessageBox.Ok, autostart=True):
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
common,
|
||||
message,
|
||||
icon=QtWidgets.QMessageBox.NoIcon,
|
||||
buttons=QtWidgets.QMessageBox.Ok,
|
||||
autostart=True,
|
||||
):
|
||||
super(Alert, self).__init__(None)
|
||||
|
||||
self.common = common
|
||||
|
||||
self.common.log('Alert', '__init__')
|
||||
self.common.log("Alert", "__init__")
|
||||
|
||||
self.setWindowTitle("OnionShare")
|
||||
self.setWindowIcon(QtGui.QIcon(self.common.get_resource_path('images/logo.png')))
|
||||
self.setWindowIcon(
|
||||
QtGui.QIcon(self.common.get_resource_path("images/logo.png"))
|
||||
)
|
||||
self.setText(message)
|
||||
self.setIcon(icon)
|
||||
self.setStandardButtons(buttons)
|
||||
|
@ -49,11 +60,12 @@ class AddFileDialog(QtWidgets.QFileDialog):
|
|||
This is because the macOS sandbox requires native dialogs, and this is a Qt5
|
||||
dialog.
|
||||
"""
|
||||
|
||||
def __init__(self, common, *args, **kwargs):
|
||||
QtWidgets.QFileDialog.__init__(self, *args, **kwargs)
|
||||
|
||||
self.common = common
|
||||
self.common.log('AddFileDialog', '__init__')
|
||||
self.common.log("AddFileDialog", "__init__")
|
||||
|
||||
self.setOption(self.DontUseNativeDialog, True)
|
||||
self.setOption(self.ReadOnly, True)
|
||||
|
@ -65,5 +77,5 @@ class AddFileDialog(QtWidgets.QFileDialog):
|
|||
list_view.setSelectionMode(QtWidgets.QAbstractItemView.ExtendedSelection)
|
||||
|
||||
def accept(self):
|
||||
self.common.log('AddFileDialog', 'accept')
|
||||
self.common.log("AddFileDialog", "accept")
|
||||
QtWidgets.QDialog.accept(self)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue