summaryrefslogtreecommitdiff
path: root/apps/patchwork/bin/update-committed-patches.py
diff options
context:
space:
mode:
Diffstat (limited to 'apps/patchwork/bin/update-committed-patches.py')
-rwxr-xr-xapps/patchwork/bin/update-committed-patches.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/apps/patchwork/bin/update-committed-patches.py b/apps/patchwork/bin/update-committed-patches.py
index 5fe1755..c11b5e8 100755
--- a/apps/patchwork/bin/update-committed-patches.py
+++ b/apps/patchwork/bin/update-committed-patches.py
@@ -9,17 +9,22 @@
# accepted into sub-maintainer/custodian branches will only be marked as
# accepted once they reach the master branch.
+import os
import sys
from datetime import datetime
-from django.conf import settings
-from django.db.models import Q
from dulwich.repo import Repo
from lockfile import FileLock, LockFailed, LockTimeout
from operator import attrgetter
-from patchmetrics.crowd import Crowd
+here = os.path.abspath(os.path.dirname(__file__))
+sys.path.append(os.path.join(here, '../..'))
from patchwork.db import PatchworkDB
+
+from django.conf import settings
+from django.db.models import Q
+
+from patchmetrics.crowd import Crowd
from patchwork.models import Project, State
from patchwork.utils import (
ensure_source_checkout_for_project,
@@ -41,12 +46,7 @@ def main():
settings.AUTH_CROWD_APPLICATION_PASSWORD,
settings.AUTH_CROWD_SERVER_REST_URI)
- if settings.CROWD_USERS_DB_FILE is None:
- print >> sys.stderr, ("CROWD_USERS_DB_FILE not defined in "
- "settings.py.\n")
- sys.exit(1)
-
- cache_db = PatchworkDB(settings.CROWD_USERS_DB_FILE)
+ cache_db = PatchworkDB()
projects = Project.objects.exclude(
Q(source_tree__isnull=True) | Q(source_tree=''))