~straemer/ubuntu/quantal/update-manager/fix-for-1058070

« back to all changes in this revision

Viewing changes to tests/patchdir/patchdir_pycompile.b17cebfbf18d152702278b15710d5095.97c07a02e5951cf68cb3f86534f6f917

  • Committer: Package Import Robot
  • Author(s): Michael Terry
  • Date: 2012-06-29 10:59:30 UTC
  • mfrom: (389.1.2 precise-security)
  • Revision ID: package-import@ubuntu.com-20120629105930-0oaj9vdvykmvkjum
Tags: 1:0.165
* Implementation of "update on start" feature from spec
  https://wiki.ubuntu.com/SoftwareUpdates
* Use a single main window that changes instead of having modal dialogs
* Implement several special-purpose dialogs like "No updates" or
  "Dist upgrade needed" accordingn to the above spec
* Split out release upgrader code and DistUpgrade module into a separate
  source package
* Drop python-update-manager, as it is unused
* debian/tests:
  - Add dep8 tests

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
278a
2
 
        if process.returncode not in (None, 0):
3
 
            rv = process.returncode
4
 
    sys.exit(rv)
5
 
.
6
 
276a
7
 
    rv = 0
8
 
.
9
 
271c
10
 
            compile(files, versions,
11
 
                    options.force, options.optimize, e_patterns)
12
 
.
13
 
265c
14
 
        compile(files, versions,
15
 
                options.force, options.optimize, e_patterns)
16
 
.
17
 
258c
18
 
                compile(files, compile_versions, options.force,
19
 
                        options.optimize, e_patterns)
20
 
.
21
 
238c
22
 
    if options.vrange and options.vrange[0] == options.vrange[1] and\
23
 
       options.vrange != (None, None) and\
24
 
       exists("/usr/bin/python%d.%d" % options.vrange[0]):
25
 
        # specific version requested, use it even if it's not in SUPPORTED
26
 
        versions = set(options.vrange[:1])
27
 
    else:
28
 
        versions = get_requested_versions(options.vrange, available=True)
29
 
.
30
 
207a
31
 
    parser.add_option('-f', '--force', action='store_true', dest='force',
32
 
        default=False, help='force rebuild even if timestamps are up-to-date')
33
 
    parser.add_option('-O', action='store_true', dest='optimize',
34
 
        default=False, help="byte-compile to .pyo files")
35
 
.
36
 
194c
37
 
            try:
38
 
                pipe = STDINS[version]
39
 
            except KeyError:
40
 
                # `pycompile /usr/lib/` invoked, add missing worker
41
 
                pipe = py_compile(version, optimize, WORKERS)
42
 
                pipe.next()
43
 
                STDINS[version] = pipe
44
 
.
45
 
191,192c
46
 
        cfn = fn + 'c' if (__debug__ or not optimize) else 'o'
47
 
        if exists(cfn) and not force:
48
 
            ftime = os.stat(fn).st_mtime
49
 
            try:
50
 
                ctime = os.stat(cfn).st_mtime
51
 
            except os.error:
52
 
                ctime = 0
53
 
            if (ctime > ftime):
54
 
                continue
55
 
.
56
 
185c
57
 
            coroutine = py_compile(version, optimize, WORKERS)
58
 
.
59
 
180c
60
 
def compile(files, versions, force, optimize, e_patterns=None):
61
 
.
62
 
170c
63
 
    cmd = "python%s%s -m py_compile -" \
64
 
        % (version, '' if (__debug__ or not optimize) else ' -O')
65
 
.
66
 
167c
67
 
def py_compile(version, optimize, workers):
68
 
.
69
 
31c
70
 
from subprocess import PIPE, STDOUT, Popen
71
 
.
72
 
27a
73
 
import os
74
 
.
75
 
5a
76
 
# Copyright © 2010 Canonical Ltd
77
 
.
78
 
2c
79
 
# -*- coding: utf-8 -*-
80
 
.