import pysvn
import json
-from debian_bundle import deb822
import numpy as np
-import jinja2
+
+from ConfigParser import SafeConfigParser
+from optparse import OptionParser, OptionGroup, OptionConflictError
# Lets first assure no guarding (but annoying) warnings
import warnings
warnings.simplefilter('ignore', FutureWarning)
-warnings.filterwarnings('ignore', 'Module debian_bundle was already imported.*', UserWarning)
+warnings.filterwarnings('ignore',
+ 'Module debian_bundle was already imported.*', UserWarning)
+
+from debian import deb822
+import apt # initializes the "_system" ;)
+from apt_pkg import version_compare
-import apt
-from ConfigParser import SafeConfigParser
-from optparse import OptionParser, Option, OptionGroup, OptionConflictError
import sys
import os
import copy
import subprocess
import time
import re
+
# templating
from jinja2 import Environment, PackageLoader
# enforce delay to be friendly to DDE
time.sleep(3)
try:
- data = json.read(urllib2.urlopen(url+"?t=json").read())['r']
+ data = json.load(urllib2.urlopen(url+"?t=json"))['r']
print "SUCCESS:", url
return data
except urllib2.HTTPError, e:
except (StopIteration):
print "NOINFO:", url
return False
- except json.ReadException, e:
+ except Exception, e:
print "UDD-DOWN?:", url, type(e)
return False
try:
# change into this from python 2.6 on
#data = json.loads(urllib2.urlopen(nitrc_url + '?spec=%s' % spec).read())
- data = json.read(urllib2.urlopen(nitrc_url + '?spec=%s' % spec).read())
+ data = json.load(urllib2.urlopen(nitrc_url + '?spec=%s' % spec))
print "NITRC-SUCCESS:", spec
except urllib2.HTTPError, e:
print "NITRC-NOINFO:", spec, type(e)
if q.has_key('popcon'):
db[p]['main']['debian_popcon'] = q['popcon']
# if we have debian, need to get ubuntu
- q = dde_get(query_url + "/packages/prio-ubuntu-natty/%s" % p)
+ q = dde_get(query_url + "/packages/prio-ubuntu-precise/%s" % p)
if q and q.has_key('popcon'):
db[p]['main']['ubuntu_popcon'] = q['popcon']
else:
info[distkey]['architecture'] = [info[distkey]['architecture']]
# accumulate data for multiple over archs
else:
- comp = apt.VersionCompare(cp['version'],
- info[distkey]['version'])
+ comp = version_compare(cp['version'],
+ info[distkey]['version'])
# found another arch for the same version
if comp == 0:
info[distkey]['architecture'].append(cp['architecture'])
if len(blocks) == 1:
return blocks[0]
else:
- return [block_lines(b, level+1) for b in blocks]
+ return [block_lines(b, level+1) for b in blocks if len(b)]
def blocks_to_rst(bls, level=0):
# check if this block is an itemized beast