~ubuntu-branches/ubuntu/saucy/apturl/saucy

« back to all changes in this revision

Viewing changes to AptUrl/gtk/backend/InstallBackendSynaptic.py

  • Committer: Package Import Robot
  • Author(s): Brian Murray, Brian Murray, Colin Watson, Barry Warsaw
  • Date: 2012-06-11 10:32:52 UTC
  • Revision ID: package-import@ubuntu.com-20120611103252-sls6xzdyuxfzt3v0
Tags: 0.5.1ubuntu4
[ Brian Murray ]
* Port to Python 3:
  - Use Python 3 style print functions
* AptUrl/Parser.py:
  - ensure MAX_URL_LEN/10 returns an int

[ Colin Watson ]
* AptUrl/gtk/backend/InstallBackendSynaptic.py:
  - Keep a reference to the data tuple passed to GObject.child_watch_add
    to avoid attempts to destroy it without a thread context.
  - Open temporary synaptic selections file in text mode.

[ Barry Warsaw ]
* Additional Python 3 fixes:
  + Port setup.py to Python 3.
  + Use the new python-apt API since the legacy API is not available in
    Python 3.
  + ki18n() takes bytes.
  + Fix relative imports so the code can be run from source.
  + Fixed some additional packaging paths.
  + Change #! lines to use python3.
  + Changed debian/control and debian/rules to use python3.
  + Change debian/compat == 9
  + apturl now must require python3-aptdaemon.gtk3widgets (i.e. not |
    synaptic) due to the Python 3 port of update-manager.
* Other changes:
  + Remove the need for threads in the KDE front-end.
  + Enable running the test suite via `python3 -m unittest discover`
  + i18n updates.
  + Various and sundry pyflakes, whitespace, style, line length, and
    spelling fixes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
        cmd.extend(opt)
30
30
        flags = GObject.SPAWN_DO_NOT_REAP_CHILD
31
31
        (pid, stdin, stdout, stderr) = GObject.spawn_async(cmd, flags=flags)
32
 
        GObject.child_watch_add(pid, self._on_synaptic_exit, (action, tempf))
 
32
        # Keep a reference to the data tuple passed to
 
33
        # GObject.child_watch_add to avoid attempts to destroy it without a
 
34
        # thread context: https://bugs.launchpad.net/bugs/724687
 
35
        self.child_data = (action, tempf)
 
36
        GObject.child_watch_add(pid, self._on_synaptic_exit, self.child_data)
33
37
 
34
38
    def _on_synaptic_exit(self, pid, condition, data):
35
39
        action, tempf = data
55
59
        opt.append("%s" % _("Please wait, this can take some time."))
56
60
        opt.append("--finish-str")
57
61
        opt.append("%s" %  _("Update is complete"))
58
 
        tempf = tempfile.NamedTemporaryFile()
 
62
        tempf = tempfile.NamedTemporaryFile(mode="w+")
59
63
        for pkg_name in pkgs_install + pkgs_upgrade:
60
64
            tempf.write("%s\tinstall\n" % pkg_name)
61
65
        opt.append("--set-selections-file")