summaryrefslogtreecommitdiffstats
path: root/git-interface/git-auth.py
diff options
context:
space:
mode:
authorLukas Fleischer <lfleischer@archlinux.org>2016-09-20 20:18:24 +0200
committerLukas Fleischer <lfleischer@archlinux.org>2016-09-29 22:07:06 +0200
commitdc3fd60715a5b17b9542ec888c6eaeb14c284e2b (patch)
tree18d9f17b8d582409f0db55ee32fc5efa674aaa2e /git-interface/git-auth.py
parent1946486a67d6085318e00c753d341ab05d12904c (diff)
downloadaur-dc3fd60715a5b17b9542ec888c6eaeb14c284e2b.tar.gz
aur-dc3fd60715a5b17b9542ec888c6eaeb14c284e2b.tar.xz
Use setuptools to install Python modules
Instead of using relative imports, add support for installing the config and db Python modules to a proper location using setuptools. Change all git-interface scripts to access those modules from the search path. Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
Diffstat (limited to 'git-interface/git-auth.py')
-rwxr-xr-xgit-interface/git-auth.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/git-interface/git-auth.py b/git-interface/git-auth.py
index d3b0188b..022b0fff 100755
--- a/git-interface/git-auth.py
+++ b/git-interface/git-auth.py
@@ -4,8 +4,8 @@ import shlex
import re
import sys
-import config
-import db
+import aurweb.config
+import aurweb.db
def format_command(env_vars, command, ssh_opts, ssh_key):
@@ -24,17 +24,17 @@ def format_command(env_vars, command, ssh_opts, ssh_key):
def main():
- valid_keytypes = config.get('auth', 'valid-keytypes').split()
- username_regex = config.get('auth', 'username-regex')
- git_serve_cmd = config.get('auth', 'git-serve-cmd')
- ssh_opts = config.get('auth', 'ssh-options')
+ valid_keytypes = aurweb.config.get('auth', 'valid-keytypes').split()
+ username_regex = aurweb.config.get('auth', 'username-regex')
+ git_serve_cmd = aurweb.config.get('auth', 'git-serve-cmd')
+ ssh_opts = aurweb.config.get('auth', 'ssh-options')
keytype = sys.argv[1]
keytext = sys.argv[2]
if keytype not in valid_keytypes:
exit(1)
- conn = db.Connection()
+ conn = aurweb.db.Connection()
cur = conn.execute("SELECT Users.Username, Users.AccountTypeID FROM Users "
"INNER JOIN SSHPubKeys ON SSHPubKeys.UserID = Users.ID "