mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
Refactor code to comply with flake8 and isort
Signed-off-by: Filipe Laíns <lains@archlinux.org> Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
This commit is contained in:
parent
48b58b1c2f
commit
8d1be7ea8a
11 changed files with 206 additions and 197 deletions
|
@ -1,8 +1,7 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
import os
|
||||
import shlex
|
||||
import re
|
||||
import shlex
|
||||
import sys
|
||||
|
||||
import aurweb.config
|
||||
|
|
|
@ -175,11 +175,11 @@ def pkgbase_set_comaintainers(pkgbase, userlist, user, privileged):
|
|||
i += 1
|
||||
|
||||
for userid in uids_rem:
|
||||
cur = conn.execute("DELETE FROM PackageComaintainers " +
|
||||
"WHERE PackageBaseID = ? AND UsersID = ?",
|
||||
[pkgbase_id, userid])
|
||||
subprocess.Popen((notify_cmd, 'comaintainer-remove',
|
||||
str(userid), str(pkgbase_id)))
|
||||
cur = conn.execute("DELETE FROM PackageComaintainers " +
|
||||
"WHERE PackageBaseID = ? AND UsersID = ?",
|
||||
[pkgbase_id, userid])
|
||||
subprocess.Popen((notify_cmd, 'comaintainer-remove',
|
||||
str(userid), str(pkgbase_id)))
|
||||
|
||||
conn.commit()
|
||||
conn.close()
|
||||
|
@ -268,7 +268,7 @@ def pkgbase_disown(pkgbase, user, privileged):
|
|||
cur = conn.execute("SELECT ID FROM Users WHERE Username = ?", [user])
|
||||
userid = cur.fetchone()[0]
|
||||
if userid == 0:
|
||||
raise aurweb.exceptions.InvalidUserException(user)
|
||||
raise aurweb.exceptions.InvalidUserException(user)
|
||||
|
||||
subprocess.Popen((notify_cmd, 'disown', str(userid), str(pkgbase_id)))
|
||||
|
||||
|
@ -472,7 +472,7 @@ def checkarg(cmdargv, *argdesc):
|
|||
checkarg_atmost(cmdargv, *argdesc)
|
||||
|
||||
|
||||
def serve(action, cmdargv, user, privileged, remote_addr):
|
||||
def serve(action, cmdargv, user, privileged, remote_addr): # noqa: C901
|
||||
if enable_maintenance:
|
||||
if remote_addr not in maintenance_exc:
|
||||
raise aurweb.exceptions.MaintenanceException
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
import os
|
||||
import pygit2
|
||||
import re
|
||||
import subprocess
|
||||
import sys
|
||||
import time
|
||||
|
||||
import pygit2
|
||||
import srcinfo.parse
|
||||
import srcinfo.utils
|
||||
|
||||
|
@ -75,7 +75,7 @@ def create_pkgbase(conn, pkgbase, user):
|
|||
return pkgbase_id
|
||||
|
||||
|
||||
def save_metadata(metadata, conn, user):
|
||||
def save_metadata(metadata, conn, user): # noqa: C901
|
||||
# Obtain package base ID and previous maintainer.
|
||||
pkgbase = metadata['pkgbase']
|
||||
cur = conn.execute("SELECT ID, MaintainerUID FROM PackageBases "
|
||||
|
@ -232,7 +232,7 @@ def die_commit(msg, commit):
|
|||
exit(1)
|
||||
|
||||
|
||||
def main():
|
||||
def main(): # noqa: C901
|
||||
repo = pygit2.Repository(repo_path)
|
||||
|
||||
user = os.environ.get("AUR_USER")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue