Log dialog viewer as a separate tool

Added entry point and main() to enable
using log viewer as a separate tool.
This commit is contained in:
Marta Marczykowska-Górecka 2018-06-20 21:01:49 +02:00
parent 8de26419c1
commit 6b206d2050
No known key found for this signature in database
GPG Key ID: 9A752C30B26FD04B
3 changed files with 21 additions and 2 deletions

View File

@ -19,7 +19,7 @@
# with this program; if not, see <http://www.gnu.org/licenses/>.
#
#
import sys
from PyQt4 import QtCore # pylint: disable=import-error
from PyQt4 import QtGui # pylint: disable=import-error
@ -27,6 +27,8 @@ from . import ui_logdlg # pylint: disable=no-name-in-module
from . import clipboard
import os
from qubesadmin import Qubes
# Display only this size of log
LOG_DISPLAY_SIZE = 1024*1024
@ -65,3 +67,18 @@ class LogDialog(ui_logdlg.Ui_LogDialog, QtGui.QDialog):
def copy_to_clipboard_triggered(self):
clipboard.copy_text_to_qubes_clipboard(self.displayed_text)
def main():
qubes_app = Qubes()
qt_app = QtGui.QApplication(sys.argv)
log_window = LogDialog(qubes_app, sys.argv[1])
log_window.show()
qt_app.exec_()
qt_app.exit()
if __name__ == "__main__":
main()

View File

@ -66,6 +66,7 @@ rm -rf $RPM_BUILD_ROOT
/usr/bin/qubes-backup
/usr/bin/qubes-backup-restore
/usr/bin/qubes-qube-manager
/usr/bin/qubes-log-viewer
/usr/libexec/qubes-manager/mount_for_backup.sh
/usr/libexec/qubes-manager/qvm_about.sh

View File

@ -24,6 +24,7 @@ if __name__ == '__main__':
'qubes-vm-boot-from-device = qubesmanager.bootfromdevice:main',
'qubes-backup = qubesmanager.backup:main',
'qubes-backup-restore = qubesmanager.restore:main',
'qubes-qube-manager = qubesmanager.qube_manager:main'
'qubes-qube-manager = qubesmanager.qube_manager:main',
'qubes-log-viewer = qubesmanager.log_dialog:main'
],
})