[extensions-web] cron: added job for GNOME Software
- From: Yuri Konotopov <ykonotopov src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [extensions-web] cron: added job for GNOME Software
- Date: Sun, 9 Apr 2017 20:07:31 +0000 (UTC)
commit f607f987aa80cf45f09b26e55a0ae0daab9a1973
Author: Yuri Konotopov <ykonotopov gnome org>
Date: Mon Apr 10 00:07:19 2017 +0400
cron: added job for GNOME Software
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=779591#c11
bin/sweettooth-cron-software | 24 ++++++++++++++++++++++++
1 files changed, 24 insertions(+), 0 deletions(-)
---
diff --git a/bin/sweettooth-cron-software b/bin/sweettooth-cron-software
new file mode 100755
index 0000000..9ea1d6f
--- /dev/null
+++ b/bin/sweettooth-cron-software
@@ -0,0 +1,24 @@
+#!/usr/bin/env python
+
+import os
+import sys
+import django
+
+import json
+
+_path = os.path.dirname(__file__)
+
+os.environ['DJANGO_SETTINGS_MODULE'] = 'sweettooth.settings'
+sys.path.extend([os.path.join(_path, '..'),
+ os.path.join(_path, '..', 'sweettooth')])
+
+from django.contrib.staticfiles.storage import staticfiles_storage
+from sweettooth.extensions import models, views
+
+django.setup()
+
+version_qs = models.ExtensionVersion.objects.visible()
+queryset = models.Extension.objects.distinct().filter(versions__in=version_qs)[:1000]
+
+with open(staticfiles_storage.path("extensions.json"), 'w') as outfile:
+ json.dump(dict(extensions=[views.ajax_details(e) for e in queryset]), outfile)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]