Commit 9ba63dc Project wide flake8 fixes

3 files Authored and Committed by pingou 7 months ago
Project wide flake8 fixes

Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>

    
 1 @@ -83,6 +83,7 @@
 2   
 3       return wrapper
 4   
 5 + 
 6   @asyncio.coroutine
 7   def _get_pkg(branch, name=None, action=None, srcname=None):
 8       ''' Return the pkg information for the given package in the specified
 9 @@ -134,7 +135,8 @@
10   
11   def _get_pretty(request):
12       pretty = False
13 -     get_params = MultiDict(urllib.parse.parse_qsl(request.query_string.lower()))
14 +     get_params = MultiDict(urllib.parse.parse_qsl(
15 +         request.query_string.lower()))
16       if get_params.get('pretty'):
17           if str(get_params.get('pretty', None)) in ['1', 'true']:
18               pretty = True
19 @@ -174,7 +176,8 @@
20                       out[datatype] = data
21   
22               # New meta-data present for soft dependency management in RPM
23 -             for datatype in ['enhances', 'recommends', 'suggests', 'supplements']:
24 +             for datatype in [
25 +                     'enhances', 'recommends', 'suggests', 'supplements']:
26                   data = yield from mdapilib.get_package_info(
27                       session, pkg.pkgKey, datatype.capitalize())
28                   if data:
29 @@ -214,8 +217,9 @@
30       if pretty:
31           args = dict(sort_keys=True, indent=4, separators=(',', ': '))
32   
33 -     output = web.Response(body=json.dumps(output, **args).encode('utf-8'),
34 -                         content_type='application/json')
35 +     output = web.Response(
36 +         body=json.dumps(output, **args).encode('utf-8'),
37 +         content_type='application/json')
38       return output
39   
40   
41 @@ -233,8 +237,10 @@
42       if pretty:
43           args = dict(sort_keys=True, indent=4, separators=(',', ': '))
44   
45 -     return web.Response(body=json.dumps(output, **args).encode('utf-8'),
46 -                         content_type='application/json')
47 +     return web.Response(
48 +         body=json.dumps(output, **args).encode('utf-8'),
49 +         content_type='application/json')
50 + 
51   
52   @asyncio.coroutine
53   @allows_jsonp
54 @@ -263,8 +269,9 @@
55       if pretty:
56           args = dict(sort_keys=True, indent=4, separators=(',', ': '))
57   
58 -     return web.Response(body=json.dumps(output, **args).encode('utf-8'),
59 -                         content_type='application/json')
60 +     return web.Response(
61 +         body=json.dumps(output, **args).encode('utf-8'),
62 +         content_type='application/json')
63   
64   
65   @asyncio.coroutine
66 @@ -294,8 +301,9 @@
67       if pretty:
68           args = dict(sort_keys=True, indent=4, separators=(',', ': '))
69   
70 -     return web.Response(body=json.dumps(output, **args).encode('utf-8'),
71 -                         content_type='application/json')
72 +     return web.Response(
73 +         body=json.dumps(output, **args).encode('utf-8'),
74 +         content_type='application/json')
75   
76   
77   @asyncio.coroutine
78 @@ -305,7 +313,8 @@
79       pretty = _get_pretty(request)
80       output = sorted(list(set([
81           # Remove the front part `mdapi-` and the end part -<type>.sqlite
82 -         filename.replace('mdapi-', '').rsplit('-', 2)[0].replace('-updates', '')
83 +         filename.replace('mdapi-', '').rsplit('-', 2)[0].replace(
84 +             '-updates', '')
85           for filename in os.listdir(CONFIG['DB_FOLDER'])
86           if filename.startswith('mdapi') and filename.endswith('.sqlite')
87       ])))
 1 @@ -113,7 +113,6 @@
 2           return simple_match
 3   
 4       # If there is not a direct match, look by the sourcerpm name
 5 -     output = None
 6       cnt = 0
 7       try:
 8           pkg = session.query(
 9 @@ -169,6 +168,7 @@
10   
11       return output
12   
13 + 
14   @asyncio.coroutine
15   def get_package_info(session, pkgKey, tablename):
16       ''' Return the information contained in the specified table for the
17 @@ -196,6 +196,7 @@
18   
19       return output
20   
21 + 
22   @asyncio.coroutine
23   def get_co_packages(session, srcpkg_name):
24       ''' Return the name of all the packages coming from the same
25 @@ -220,6 +221,7 @@
26   
27       return output
28   
29 + 
30   @asyncio.coroutine
31   def get_files(session, pkg_id):
32       ''' Return the list of all the files in a package given its key.
33 @@ -246,6 +248,7 @@
34   
35       return output
36   
37 + 
38   @asyncio.coroutine
39   def get_changelog(session, pkg_id):
40       ''' Return the list of all the changelog in a package given its key.
1 @@ -113,7 +113,6 @@
2       __tablename__ = 'conflicts'
3   
4   
5 - 
6   class Obsoletes(BASEDEP):
7       ''' Maps the provides table in the primary.sqlite database from
8       repodata to a python object.