to avoid update issues, dont import ox in update.py

This commit is contained in:
j 2014-10-05 20:10:36 +00:00
parent 90073aa63d
commit 5e130a7c9b

View file

@ -11,7 +11,7 @@ if os.path.exists(activate_this):
import sys import sys
import subprocess import subprocess
import ox import urllib2
import json import json
from os.path import join, exists from os.path import join, exists
@ -25,9 +25,12 @@ def get(*cmd):
stdout, error = p.communicate() stdout, error = p.communicate()
return stdout return stdout
def get_json(url):
return json.loads(urllib2.urlopen(url).read())
def get_release(): def get_release():
try: try:
return json.loads(ox.net.read_url('https://pan.do/json/release.json')) return get_json('https://pan.do/json/release.json')
except: except:
print "failed to load https://pan.do/ra, check your internet connection" print "failed to load https://pan.do/ra, check your internet connection"
sys.exit(1) sys.exit(1)
@ -148,8 +151,6 @@ if __name__ == "__main__":
run('./manage.py', 'compile_pyc') run('./manage.py', 'compile_pyc')
if pandora_old_revno != pandora_new_revno: if pandora_old_revno != pandora_new_revno:
os.chdir(base) os.chdir(base)
if pandora_old_revno < '4379':
run('./bin/pip', 'install', 'six>=1.5.2')
run('./update.py', 'postupdate', pandora_old_revno, pandora_new_revno) run('./update.py', 'postupdate', pandora_old_revno, pandora_new_revno)
if not development: if not development:
print 'pan.do/ra is at the latest stable release, you can run "./update.py dev" to update to the development version' print 'pan.do/ra is at the latest stable release, you can run "./update.py dev" to update to the development version'