mirror of
https://git.launchpad.net/~ubuntu-release/britney/+git/britney2-ubuntu
synced 2025-05-25 17:31:29 +00:00
Switch to print_function
Signed-off-by: Julien Cristau <jcristau@debian.org>
This commit is contained in:
parent
6371eaf102
commit
94f18322db
21
britney.py
21
britney.py
@ -179,6 +179,7 @@ does for the generation of the update excuses.
|
|||||||
|
|
||||||
* The excuses are written in an HTML file.
|
* The excuses are written in an HTML file.
|
||||||
"""
|
"""
|
||||||
|
from __future__ import print_function
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
@ -255,8 +256,8 @@ class Britney(object):
|
|||||||
if self.options.nuninst_cache:
|
if self.options.nuninst_cache:
|
||||||
self.__log("Not building the list of non-installable packages, as requested", type="I")
|
self.__log("Not building the list of non-installable packages, as requested", type="I")
|
||||||
if self.options.print_uninst:
|
if self.options.print_uninst:
|
||||||
print '* summary'
|
print('* summary')
|
||||||
print '\n'.join(map(lambda x: '%4d %s' % (len(nuninst[x]), x), self.options.architectures))
|
print('\n'.join('%4d %s' % (len(nuninst[x]), x) for x in self.options.architectures))
|
||||||
return
|
return
|
||||||
|
|
||||||
# read the source and binary packages for the involved distributions
|
# read the source and binary packages for the involved distributions
|
||||||
@ -303,8 +304,8 @@ class Britney(object):
|
|||||||
self.nuninst_arch_report(nuninst, arch)
|
self.nuninst_arch_report(nuninst, arch)
|
||||||
|
|
||||||
if self.options.print_uninst:
|
if self.options.print_uninst:
|
||||||
print '* summary'
|
print('* summary')
|
||||||
print '\n'.join(map(lambda x: '%4d %s' % (len(nuninst[x]), x), self.options.architectures))
|
print('\n'.join(map(lambda x: '%4d %s' % (len(nuninst[x]), x), self.options.architectures)))
|
||||||
return
|
return
|
||||||
else:
|
else:
|
||||||
write_nuninst(self.options.noninst_status, nuninst)
|
write_nuninst(self.options.noninst_status, nuninst)
|
||||||
@ -396,7 +397,7 @@ class Britney(object):
|
|||||||
printed only if verbose logging is enabled.
|
printed only if verbose logging is enabled.
|
||||||
"""
|
"""
|
||||||
if self.options.verbose or type in ("E", "W"):
|
if self.options.verbose or type in ("E", "W"):
|
||||||
print "%s: [%s] - %s" % (type, time.asctime(), msg)
|
print("%s: [%s] - %s" % (type, time.asctime(), msg))
|
||||||
|
|
||||||
def _build_installability_tester(self, archs):
|
def _build_installability_tester(self, archs):
|
||||||
"""Create the installability tester"""
|
"""Create the installability tester"""
|
||||||
@ -2600,10 +2601,10 @@ class Britney(object):
|
|||||||
try:
|
try:
|
||||||
input = raw_input('britney> ').lower().split()
|
input = raw_input('britney> ').lower().split()
|
||||||
except EOFError:
|
except EOFError:
|
||||||
print ""
|
print("")
|
||||||
break
|
break
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
print ""
|
print("")
|
||||||
continue
|
continue
|
||||||
# quit the hint tester
|
# quit the hint tester
|
||||||
if input and input[0] in ('quit', 'exit'):
|
if input and input[0] in ('quit', 'exit'):
|
||||||
@ -2822,16 +2823,16 @@ class Britney(object):
|
|||||||
all[(pkg[SOURCE], pkg[SOURCEVER])].add(p)
|
all[(pkg[SOURCE], pkg[SOURCEVER])].add(p)
|
||||||
|
|
||||||
|
|
||||||
print '* %s' % (arch,)
|
print('* %s' % (arch,))
|
||||||
|
|
||||||
for (src, ver), pkgs in sorted(all.iteritems()):
|
for (src, ver), pkgs in sorted(all.iteritems()):
|
||||||
print ' %s (%s): %s' % (src, ver, ' '.join(sorted(pkgs)))
|
print(' %s (%s): %s' % (src, ver, ' '.join(sorted(pkgs))))
|
||||||
|
|
||||||
print
|
print
|
||||||
|
|
||||||
def output_write(self, msg):
|
def output_write(self, msg):
|
||||||
"""Simple wrapper for output writing"""
|
"""Simple wrapper for output writing"""
|
||||||
print msg,
|
print(msg, end='')
|
||||||
self.__output.write(msg)
|
self.__output.write(msg)
|
||||||
|
|
||||||
def main(self):
|
def main(self):
|
||||||
|
4
hints.py
4
hints.py
@ -12,6 +12,8 @@
|
|||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
|
|
||||||
|
from __future__ import print_function
|
||||||
|
|
||||||
from migrationitem import MigrationItem
|
from migrationitem import MigrationItem
|
||||||
|
|
||||||
class HintCollection(object):
|
class HintCollection(object):
|
||||||
@ -36,7 +38,7 @@ class HintCollection(object):
|
|||||||
try:
|
try:
|
||||||
self._hints.append(Hint(hint, user))
|
self._hints.append(Hint(hint, user))
|
||||||
except AssertionError:
|
except AssertionError:
|
||||||
print "Ignoring broken hint %r from %s" % (hint, user)
|
print("Ignoring broken hint %r from %s" % (hint, user))
|
||||||
|
|
||||||
class Hint(object):
|
class Hint(object):
|
||||||
NO_VERSION = [ 'block', 'block-all', 'block-udeb' ]
|
NO_VERSION = [ 'block', 'block-all', 'block-udeb' ]
|
||||||
|
@ -14,6 +14,8 @@
|
|||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
|
|
||||||
|
from __future__ import print_function
|
||||||
|
|
||||||
from functools import partial
|
from functools import partial
|
||||||
import os
|
import os
|
||||||
|
|
||||||
@ -106,7 +108,7 @@ class InstallabilitySolver(InstallabilityTester):
|
|||||||
# "Self-conflicts" => ignore
|
# "Self-conflicts" => ignore
|
||||||
continue
|
continue
|
||||||
if debug_solver and other not in order[key]['before']:
|
if debug_solver and other not in order[key]['before']:
|
||||||
print "N: Conflict induced order: %s before %s" % (key, other)
|
print("N: Conflict induced order: %s before %s" % (key, other))
|
||||||
order[key]['before'].add(other)
|
order[key]['before'].add(other)
|
||||||
order[other]['after'].add(key)
|
order[other]['after'].add(key)
|
||||||
|
|
||||||
@ -125,7 +127,7 @@ class InstallabilitySolver(InstallabilityTester):
|
|||||||
# "Self-dependency" => ignore
|
# "Self-dependency" => ignore
|
||||||
continue
|
continue
|
||||||
if debug_solver and other not in order[key]['after']:
|
if debug_solver and other not in order[key]['after']:
|
||||||
print "N: Removal induced order: %s before %s" % (key, other)
|
print("N: Removal induced order: %s before %s" % (key, other))
|
||||||
order[key]['after'].add(other)
|
order[key]['after'].add(other)
|
||||||
order[other]['before'].add(key)
|
order[other]['before'].add(key)
|
||||||
|
|
||||||
@ -162,13 +164,13 @@ class InstallabilitySolver(InstallabilityTester):
|
|||||||
|
|
||||||
for other in (other_adds - other_rms):
|
for other in (other_adds - other_rms):
|
||||||
if debug_solver and other != key and other not in order[key]['after']:
|
if debug_solver and other != key and other not in order[key]['after']:
|
||||||
print "N: Dependency induced order (add): %s before %s" % (key, other)
|
print("N: Dependency induced order (add): %s before %s" % (key, other))
|
||||||
order[key]['after'].add(other)
|
order[key]['after'].add(other)
|
||||||
order[other]['before'].add(key)
|
order[other]['before'].add(key)
|
||||||
|
|
||||||
for other in (other_rms - other_adds):
|
for other in (other_rms - other_adds):
|
||||||
if debug_solver and other != key and other not in order[key]['before']:
|
if debug_solver and other != key and other not in order[key]['before']:
|
||||||
print "N: Dependency induced order (remove): %s before %s" % (key, other)
|
print("N: Dependency induced order (remove): %s before %s" % (key, other))
|
||||||
order[key]['before'].add(other)
|
order[key]['before'].add(other)
|
||||||
order[other]['after'].add(key)
|
order[other]['after'].add(key)
|
||||||
|
|
||||||
@ -208,7 +210,7 @@ class InstallabilitySolver(InstallabilityTester):
|
|||||||
merged[n] = scc_id
|
merged[n] = scc_id
|
||||||
del order[n]
|
del order[n]
|
||||||
if debug_solver:
|
if debug_solver:
|
||||||
print "N: SCC: %s -- %s" % (scc_id, str(sorted(com)))
|
print("N: SCC: %s -- %s" % (scc_id, str(sorted(com))))
|
||||||
|
|
||||||
for com in comps:
|
for com in comps:
|
||||||
node = com[0]
|
node = com[0]
|
||||||
@ -223,27 +225,27 @@ class InstallabilitySolver(InstallabilityTester):
|
|||||||
|
|
||||||
|
|
||||||
if debug_solver:
|
if debug_solver:
|
||||||
print "N: -- PARTIAL ORDER --"
|
print("N: -- PARTIAL ORDER --")
|
||||||
|
|
||||||
for com in sorted(order):
|
for com in sorted(order):
|
||||||
if debug_solver and order[com]['before']:
|
if debug_solver and order[com]['before']:
|
||||||
print "N: %s <= %s" % (com, str(sorted(order[com]['before'])))
|
print("N: %s <= %s" % (com, str(sorted(order[com]['before']))))
|
||||||
if not order[com]['after']:
|
if not order[com]['after']:
|
||||||
# This component can be scheduled immediately, add it
|
# This component can be scheduled immediately, add it
|
||||||
# to "check"
|
# to "check"
|
||||||
check.add(com)
|
check.add(com)
|
||||||
elif debug_solver:
|
elif debug_solver:
|
||||||
print "N: %s >= %s" % (com, str(sorted(order[com]['after'])))
|
print("N: %s >= %s" % (com, str(sorted(order[com]['after']))))
|
||||||
|
|
||||||
if debug_solver:
|
if debug_solver:
|
||||||
print "N: -- END PARTIAL ORDER --"
|
print("N: -- END PARTIAL ORDER --")
|
||||||
print "N: -- LINEARIZED ORDER --"
|
print("N: -- LINEARIZED ORDER --")
|
||||||
|
|
||||||
for cur in iter_except(check.pop, KeyError):
|
for cur in iter_except(check.pop, KeyError):
|
||||||
if order[cur]['after'] <= emitted:
|
if order[cur]['after'] <= emitted:
|
||||||
# This item is ready to be emitted right now
|
# This item is ready to be emitted right now
|
||||||
if debug_solver:
|
if debug_solver:
|
||||||
print "N: %s -- %s" % (cur, sorted(scc[cur]))
|
print("N: %s -- %s" % (cur, sorted(scc[cur])))
|
||||||
emitted.add(cur)
|
emitted.add(cur)
|
||||||
result.append([key2item[x] for x in scc[cur]])
|
result.append([key2item[x] for x in scc[cur]])
|
||||||
if order[cur]['before']:
|
if order[cur]['before']:
|
||||||
@ -254,7 +256,7 @@ class InstallabilitySolver(InstallabilityTester):
|
|||||||
check.update(order[cur]['before'] - emitted)
|
check.update(order[cur]['before'] - emitted)
|
||||||
|
|
||||||
if debug_solver:
|
if debug_solver:
|
||||||
print "N: -- END LINEARIZED ORDER --"
|
print("N: -- END LINEARIZED ORDER --")
|
||||||
|
|
||||||
return result
|
return result
|
||||||
|
|
||||||
@ -301,8 +303,8 @@ class InstallabilitySolver(InstallabilityTester):
|
|||||||
return result
|
return result
|
||||||
|
|
||||||
def _dump_groups(self, groups):
|
def _dump_groups(self, groups):
|
||||||
print "N: === Groups ==="
|
print("N: === Groups ===")
|
||||||
for (item, adds, rms) in groups:
|
for (item, adds, rms) in groups:
|
||||||
print "N: %s => A: %s, R: %s" % (str(item), str(adds), str(rms))
|
print("N: %s => A: %s, R: %s" % (str(item), str(adds), str(rms)))
|
||||||
print "N: === END Groups ==="
|
print("N: === END Groups ===")
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user