Add pylama.ini. Add pylama fixes.

This commit is contained in:
Jarosław Wieczorek 2020-12-20 12:31:46 +01:00
parent 7c417b7298
commit 4d275c855d
3 changed files with 15 additions and 6 deletions

View File

@ -3,7 +3,7 @@ from PyQt5.QtWidgets import QApplication
import sys import sys
if __name__=='__main__': if __name__ == '__main__':
app = QApplication(sys.argv) app = QApplication(sys.argv)
w = MainWindow() w = MainWindow()
w.show() w.show()

9
pylama.ini Normal file
View File

@ -0,0 +1,9 @@
[pylama]
linters = pep8,pyflakes
format = pylint
skip = *_ui.py
#ignore = E201,E202,E231,E701
[pep8]
max_line_length = 200

View File

@ -1,10 +1,10 @@
from PyQt5.QtGui import QPixmap from PyQt5.QtGui import QPixmap
from PyQt5.QtWidgets import * from PyQt5.QtWidgets import QMainWindow, QLabel,\
QFileDialog, QDialog, QDialogButtonBox, QVBoxLayout
from PyQt5.QtCore import Qt from PyQt5.QtCore import Qt
from src.python.ui.mainwindow_ui import Ui_MainWindow from src.python.ui.mainwindow_ui import Ui_MainWindow
class MainWindow(QMainWindow, Ui_MainWindow): class MainWindow(QMainWindow, Ui_MainWindow):
def __init__(self, parent=None): def __init__(self, parent=None):
super(MainWindow, self).__init__(parent=parent) super(MainWindow, self).__init__(parent=parent)
@ -47,7 +47,7 @@ class MainWindow(QMainWindow, Ui_MainWindow):
file_formats = "All Files (*);;JPG (*.jpg);;PNG (*.png)" file_formats = "All Files (*);;JPG (*.jpg);;PNG (*.png)"
file, _ = dialog.getOpenFileName(self, "QFileDialog.getOpenFileName()", "", file_formats, options=dialog.options()) file, _ = dialog.getOpenFileName(self, "QFileDialog.getOpenFileName()", "", file_formats, options=dialog.options())
if not file: if not file:
msg = F"[!] Nie wybrano żadnego pliku." msg = "[!] Nie wybrano żadnego pliku."
dialog = self.create_custom_dialog(title='Ostrzeżenie', msg=msg) dialog = self.create_custom_dialog(title='Ostrzeżenie', msg=msg)
dialog.exec_() dialog.exec_()
@ -85,7 +85,7 @@ class MainWindow(QMainWindow, Ui_MainWindow):
file_formats = "All Files (*);;mp3 (*.mp3);;wav (*.wav)" file_formats = "All Files (*);;mp3 (*.mp3);;wav (*.wav)"
file, _ = dialog.getOpenFileName(self, "QFileDialog.getOpenFileName()", "", file_formats, options=dialog.options()) file, _ = dialog.getOpenFileName(self, "QFileDialog.getOpenFileName()", "", file_formats, options=dialog.options())
if not file: if not file:
msg = F"[!] Nie wybrano żadnego pliku." msg = "[!] Nie wybrano żadnego pliku."
dialog = self.create_custom_dialog(title='Ostrzeżenie', msg=msg) dialog = self.create_custom_dialog(title='Ostrzeżenie', msg=msg)
dialog.exec_() dialog.exec_()
@ -106,4 +106,4 @@ class MainWindow(QMainWindow, Ui_MainWindow):
def generate_video_podcast(self): def generate_video_podcast(self):
# TODO: Change to pure python # TODO: Change to pure python
"""Generate podcast based on values from UI.""" """Generate podcast based on values from UI."""
pass pass