Merge branch 'gitlab-ci-pylint' into 'master'

lint ci stage

See merge request openlp/openlp!14
This commit is contained in:
Raoul Snyman 2019-09-18 16:44:39 +00:00
commit 0a3995a60d
4 changed files with 37 additions and 24 deletions

View File

@ -1,6 +1,20 @@
stages: stages:
- lint
- test - test
lint:
stage: lint
image: python
before_script:
- apt-get update
# packages required for dbus-python
- apt-get -y install libdbus-1-dev libdbus-glib-1-dev
# packages required for pyodbc
- apt-get -y install unixodbc unixodbc-dev
- pip install -e .[test]
script:
- flake8
test-debian: test-debian:
stage: test stage: test
variables: variables:

View File

@ -9,14 +9,14 @@
from PyQt4 import QtCore, QtGui from PyQt4 import QtCore, QtGui
class Ui_AuditDetailDialog(object): class Ui_AuditDetailDialog(object):
def setupUi(self, AuditDetailDialog): def setupUi(self, AuditDetailDialog):
AuditDetailDialog.setObjectName(u'AuditDetailDialog') AuditDetailDialog.setObjectName(u'AuditDetailDialog')
AuditDetailDialog.resize(593, 501) AuditDetailDialog.resize(593, 501)
self.buttonBox = QtGui.QDialogButtonBox(AuditDetailDialog) self.buttonBox = QtGui.QDialogButtonBox(AuditDetailDialog)
self.buttonBox.setGeometry(QtCore.QRect(420, 470, 170, 25)) self.buttonBox.setGeometry(QtCore.QRect(420, 470, 170, 25))
self.buttonBox.setStandardButtons( self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel | QtGui.QDialogButtonBox.Ok)
QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok)
self.buttonBox.setObjectName(u'buttonBox') self.buttonBox.setObjectName(u'buttonBox')
self.FileGroupBox = QtGui.QGroupBox(AuditDetailDialog) self.FileGroupBox = QtGui.QGroupBox(AuditDetailDialog)
self.FileGroupBox.setGeometry(QtCore.QRect(10, 370, 571, 70)) self.FileGroupBox.setGeometry(QtCore.QRect(10, 370, 571, 70))

View File

@ -26,6 +26,7 @@ from PyQt4 import QtCore, QtGui
from auditdetaildialog import Ui_AuditDetailDialog from auditdetaildialog import Ui_AuditDetailDialog
class AuditDetailForm(QtGui.QDialog, Ui_AuditDetailDialog): class AuditDetailForm(QtGui.QDialog, Ui_AuditDetailDialog):
""" """
Class documentation goes here. Class documentation goes here.
@ -68,10 +69,8 @@ class AuditDetailForm(QtGui.QDialog, Ui_AuditDetailDialog):
self.resetWindow() self.resetWindow()
def defineOutputLocation(self): def defineOutputLocation(self):
path = QtGui.QFileDialog.getExistingDirectory(self, path = QtGui.QFileDialog.getExistingDirectory(self, self.trUtf8(u'Output File Location'),
self.trUtf8(u'Output File Location'),
self.parent.config.get_last_dir(1)) self.parent.config.get_last_dir(1))
path = unicode(path)
if path != u'': if path != u'':
self.parent.config.set_last_dir(path, 1) self.parent.config.set_last_dir(path, 1)
self.FileLineEdit.setText(path) self.FileLineEdit.setText(path)
@ -97,10 +96,10 @@ class AuditDetailForm(QtGui.QDialog, Ui_AuditDetailDialog):
self.ThirdToTimeEdit.setEnabled(True) self.ThirdToTimeEdit.setEnabled(True)
def accept(self): def accept(self):
print self.DetailedReport.isChecked() print(self.DetailedReport.isChecked())
print self.SummaryReport.isChecked() print(self.SummaryReport.isChecked())
print self.FromDateEdit.date() print(self.FromDateEdit.date())
print self.ToDateEdit.date() print(self.ToDateEdit.date())
if self.DetailedReport.isChecked(): if self.DetailedReport.isChecked():
self.detailedReport() self.detailedReport()
else: else:
@ -108,15 +107,15 @@ class AuditDetailForm(QtGui.QDialog, Ui_AuditDetailDialog):
self.close() self.close()
def detailedReport(self): def detailedReport(self):
print "detailed" print("detailed")
filename = u'audit_det_%s_%s.txt' % \ filename = u'audit_det_%s_%s.txt' % \
(self.FromDateEdit.date().toString(u'ddMMyyyy'), (self.FromDateEdit.date().toString(u'ddMMyyyy'),
self.ToDateEdit.date().toString(u'ddMMyyyy')) self.ToDateEdit.date().toString(u'ddMMyyyy'))
print filename print(filename)
def summaryReport(self): def summaryReport(self):
print "summary" print("summary")
filename = u'audit_sum_%s_%s.txt' % \ filename = u'audit_sum_%s_%s.txt' % \
(self.FromDateEdit.date().toString(u'ddMMyyyy'), (self.FromDateEdit.date().toString(u'ddMMyyyy'),
self.ToDateEdit.date().toString(u'ddMMyyyy')) self.ToDateEdit.date().toString(u'ddMMyyyy'))
print filename print(filename)

View File

@ -197,16 +197,16 @@ using a computer and a data projector.""",
'sword-bibles': ['pysword'], 'sword-bibles': ['pysword'],
# Required for scripts/*.py: # Required for scripts/*.py:
'jenkins': ['python-jenkins'], 'jenkins': ['python-jenkins'],
'launchpad': ['launchpadlib'] 'launchpad': ['launchpadlib'],
}, 'test': [
tests_require=[
'pylint',
'PyMuPDF', 'PyMuPDF',
'pyodbc', 'pyodbc',
'pysword', 'pysword',
'pytest', 'pytest',
'python-xlib; platform_system=="Linux"' 'python-xlib; platform_system=="Linux"',
], 'flake8',
]
},
setup_requires=['pytest-runner'], setup_requires=['pytest-runner'],
entry_points={'gui_scripts': ['openlp = openlp.__main__:start']} entry_points={'gui_scripts': ['openlp = openlp.__main__:start']}
) )