diff --git a/.flake8 b/.flake8 new file mode 100644 index 00000000..05bd31a4 --- /dev/null +++ b/.flake8 @@ -0,0 +1,2 @@ +[flake8] +ignore: W605 diff --git a/sd-journalist/sd-process-display b/sd-journalist/sd-process-display index 84696164..738c5440 100644 --- a/sd-journalist/sd-process-display +++ b/sd-journalist/sd-process-display @@ -1,7 +1,7 @@ import sys import PyQt4.QtCore as QtCore from PyQt4.QtGui import QDialog, QDialogButtonBox, QApplication, \ - QLabel, QVBoxLayout, QImage, QPixmap + QLabel, QVBoxLayout, QImage, QPixmap from PyQt4.QtCore import Qt import os import threading diff --git a/sd-svs/decrypt-sd-submission b/sd-svs/decrypt-sd-submission index d627aaad..ddf55634 100755 --- a/sd-svs/decrypt-sd-submission +++ b/sd-svs/decrypt-sd-submission @@ -37,7 +37,7 @@ try: # given a malicious tarball tar.extractall(tmpdir) -except Exception as e: +except Exception: send_progress("DECRYPTION_BUNDLE_OPEN_FAILURE") # although we're exiting with failure, we return a # 0 exit code so xdg does not try to re-open this file with @@ -139,7 +139,7 @@ try: print(os.path.join(tmpdir, "extracted")) distutils.dir_util.copy_tree(os.path.join(tmpdir, "extracted"), "/home/user/Sources/", update=1) -except Exception as e: +except Exception: send_progress("DECRYPTED_BUNDLE_COPY_FAILURE") shutil.rmtree(tmpdir) sys.exit(0) diff --git a/tests/integration/test_integration b/tests/integration/test_integration index dfa758ff..2d595517 100755 --- a/tests/integration/test_integration +++ b/tests/integration/test_integration @@ -142,13 +142,13 @@ def run_q(n): if run_q("full-success"): receiver.expected_states = [ - "DECRYPTION_PROCESS_START", - "SUBMISSION_BUNDLE_UNBUNDLED", - "SUBMISSION_FILES_EXTRACTED", - "SUBMISSION_FILE_DECRYPTION_SUCCEEDED", - "SUBMISSION_FILE_DECRYPTION_SUCCEEDED", - "DECRYPTED_BUNDLE_ON_SVS", - "DECRYPTED_FILES_AVAILABLE", + "DECRYPTION_PROCESS_START", + "SUBMISSION_BUNDLE_UNBUNDLED", + "SUBMISSION_FILES_EXTRACTED", + "SUBMISSION_FILE_DECRYPTION_SUCCEEDED", + "SUBMISSION_FILE_DECRYPTION_SUCCEEDED", + "DECRYPTED_BUNDLE_ON_SVS", + "DECRYPTED_FILES_AVAILABLE", ] receiver.cmd = ["qvm-open-in-vm", "sd-svs", "./all.sd-xfer"] receiver.test_name = "full successful open" @@ -156,8 +156,8 @@ if run_q("full-success"): if run_q("empty-download"): receiver.expected_states = [ - "DECRYPTION_PROCESS_START", - "DECRYPTION_BUNDLE_OPEN_FAILURE", + "DECRYPTION_PROCESS_START", + "DECRYPTION_BUNDLE_OPEN_FAILURE", ] receiver.cmd = ["qvm-open-in-vm", "sd-svs", "./empty.sd-xfer"] receiver.test_name = "empty sd-xfer" @@ -165,12 +165,12 @@ if run_q("empty-download"): if run_q("bad-gpg-key"): receiver.expected_states = [ - "DECRYPTION_PROCESS_START", - "SUBMISSION_BUNDLE_UNBUNDLED", - "SUBMISSION_FILES_EXTRACTED", - "SUBMISSION_FILE_DECRYPTION_FAILED", - "SUBMISSION_FILE_DECRYPTION_FAILED", - "SUBMISSION_FILE_NO_FILES_FOUND", + "DECRYPTION_PROCESS_START", + "SUBMISSION_BUNDLE_UNBUNDLED", + "SUBMISSION_FILES_EXTRACTED", + "SUBMISSION_FILE_DECRYPTION_FAILED", + "SUBMISSION_FILE_DECRYPTION_FAILED", + "SUBMISSION_FILE_NO_FILES_FOUND", ] receiver.cmd = ["qvm-open-in-vm", "sd-svs", "./bad-key.sd-xfer"] receiver.test_name = "bad encryption key" diff --git a/tests/test_svs.py b/tests/test_svs.py index 30d8e38f..3b933a51 100644 --- a/tests/test_svs.py +++ b/tests/test_svs.py @@ -10,28 +10,28 @@ def setUp(self): def test_decrypt_sd_submission(self): self.assertFilesMatch( - "/usr/bin/decrypt-sd-submission", - "sd-svs/decrypt-sd-submission") + "/usr/bin/decrypt-sd-submission", + "sd-svs/decrypt-sd-submission") def test_decrypt_sd_submission_desktop(self): self.assertFilesMatch( - "/usr/share/applications/decrypt-sd-submission.desktop", - "sd-svs/decrypt-sd-submission.desktop") + "/usr/share/applications/decrypt-sd-submission.desktop", + "sd-svs/decrypt-sd-submission.desktop") def test_decrypt_sd_user_profile(self): self.assertFilesMatch( - "/etc/profile.d/sd-svs-qubes-gpg-domain.sh", - "sd-svs/dot-profile") + "/etc/profile.d/sd-svs-qubes-gpg-domain.sh", + "sd-svs/dot-profile") def test_open_in_dvm_desktop(self): self.assertFilesMatch( - "/usr/share/applications/open-in-dvm.desktop", - "sd-svs/open-in-dvm.desktop") + "/usr/share/applications/open-in-dvm.desktop", + "sd-svs/open-in-dvm.desktop") def test_mimeapps(self): self.assertFilesMatch( - "/usr/share/applications/mimeapps.list", - "sd-svs/mimeapps.list") + "/usr/share/applications/mimeapps.list", + "sd-svs/mimeapps.list") def load_tests(loader, tests, pattern):