From 2c678ec450ea028b70b840c9872dec9116188cb6 Mon Sep 17 00:00:00 2001 From: j Date: Thu, 16 Feb 2017 18:31:46 +0100 Subject: [PATCH] use python for now --- pandora/manage.py | 2 +- update.py | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/pandora/manage.py b/pandora/manage.py index 66666a50..529afbda 100755 --- a/pandora/manage.py +++ b/pandora/manage.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/env python import os import sys diff --git a/update.py b/update.py index 84853954..70b9cd33 100755 --- a/update.py +++ b/update.py @@ -1,4 +1,4 @@ -#!/usr/bin/python3 +#!/usr/bin/python from __future__ import print_function import os @@ -14,7 +14,10 @@ with open(activate_this) as f: import sys import shutil import subprocess -import urllib.request +try: + from urllib.request import urlopen +except: + from urllib2 import urlopen import json from os.path import join, exists @@ -29,7 +32,7 @@ def get(*cmd): return stdout.decode() def get_json(url): - return json.loads(urllib.request.urlopen(url).read().decode()) + return json.loads(urlopen(url).read().decode()) def get_release(): if os.path.exists('.release'): @@ -217,7 +220,7 @@ if __name__ == "__main__": run('./bin/pip', 'install', '-r', 'requirements.txt') update_service('pandora-encoding') update_service('pandora-tasks') - if old <= 5673: + if old <= 5673: run('./pandora/manage.py', 'rebuild_documentfind') else: if len(sys.argv) == 1: