Commit 6f1257b8 authored by Chris Lamb's avatar Chris Lamb 💬

Fix a number of flake8 warnings.

parent fc7bbc25
...@@ -37,7 +37,7 @@ def parse_submission(request): ...@@ -37,7 +37,7 @@ def parse_submission(request):
raw_text_gpg_stripped = data.dump() raw_text_gpg_stripped = data.dump()
## Parse GPG info ######################################################### # Parse GPG info #########################################################
uid = None uid = None
data.raw_text = raw_text data.raw_text = raw_text
...@@ -53,7 +53,7 @@ def parse_submission(request): ...@@ -53,7 +53,7 @@ def parse_submission(request):
if uid is None: if uid is None:
raise InvalidSubmission("Could not determine GPG uid") raise InvalidSubmission("Could not determine GPG uid")
## Check whether .buildinfo already exists ################################ # Check whether .buildinfo already exists ################################
def create_submission(buildinfo): def create_submission(buildinfo):
submission = buildinfo.submissions.create( submission = buildinfo.submissions.create(
...@@ -66,7 +66,7 @@ def parse_submission(request): ...@@ -66,7 +66,7 @@ def parse_submission(request):
return submission return submission
## Parse new .buildinfo ################################################### # Parse new .buildinfo ###################################################
def get_or_create(model, field): def get_or_create(model, field):
try: try:
...@@ -106,7 +106,7 @@ def parse_submission(request): ...@@ -106,7 +106,7 @@ def parse_submission(request):
buildinfo.get_storage_name(), ContentFile(raw_text_gpg_stripped) buildinfo.get_storage_name(), ContentFile(raw_text_gpg_stripped)
) )
## Parse binaries ######################################################### # Parse binaries #########################################################
try: try:
binary_names = set(data['Binary'].split(' ')) binary_names = set(data['Binary'].split(' '))
...@@ -123,7 +123,7 @@ def parse_submission(request): ...@@ -123,7 +123,7 @@ def parse_submission(request):
binary=Binary.objects.get_or_create(name=x)[0] binary=Binary.objects.get_or_create(name=x)[0]
) )
## Parse checksums ######################################################## # Parse checksums ########################################################
hashes = ('Md5', 'Sha1', 'Sha256') hashes = ('Md5', 'Sha1', 'Sha256')
...@@ -153,7 +153,7 @@ def parse_submission(request): ...@@ -153,7 +153,7 @@ def parse_submission(request):
"Checksums-{}: {} != {}".format(x, existing, size) "Checksums-{}: {} != {}".format(x, existing, size)
) )
## Create Checksum instances ############################################## # Create Checksum instances ##############################################
for k, v in sorted(checksums.items()): for k, v in sorted(checksums.items()):
# Match with Binary instances if possible # Match with Binary instances if possible
...@@ -163,7 +163,7 @@ def parse_submission(request): ...@@ -163,7 +163,7 @@ def parse_submission(request):
buildinfo.checksums.create(filename=k, **v) buildinfo.checksums.create(filename=k, **v)
## Validate Installed-Build-Depends ####################################### # Validate Installed-Build-Depends #######################################
for x in data['Installed-Build-Depends'].strip().splitlines(): for x in data['Installed-Build-Depends'].strip().splitlines():
m = re_installed_build_depends.match(x.strip()) m = re_installed_build_depends.match(x.strip())
......
import datetime
from django.db import models, transaction from django.db import models, transaction
from django.utils import timezone from django.utils import timezone
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
import os import os
import sys import sys
from os.path import join, dirname, abspath from os.path import dirname, abspath
sys.path.insert(0, dirname(dirname(abspath(__file__)))) sys.path.insert(0, dirname(dirname(abspath(__file__))))
......
import datetime
from django.db import models from django.db import models
from django.urls import reverse from django.urls import reverse
from django.utils import timezone from django.utils import timezone
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment