~ubuntu-core-dev/update-manager/main

« back to all changes in this revision

Viewing changes to UpdateManager/Core/utils.py

  • Committer: Benjamin Drung
  • Date: 2023-02-13 13:07:34 UTC
  • Revision ID: benjamin.drung@canonical.com-20230213130734-w3qjkzl851rmv1am
Sort imports in UpdateManager/Core/utils.py with isort

```
isort -l 79 --profile=black UpdateManager/Core/utils.py
```

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
22
22
#  USA
23
23
 
24
 
from gettext import gettext as _
25
 
from gettext import ngettext
26
 
from stat import S_IMODE, ST_MODE, S_IXUSR
27
 
from math import ceil
28
 
 
29
 
import apt
30
 
import apt_pkg
31
 
 
32
 
apt_pkg.init_config()
33
 
 
34
24
import locale
35
25
import logging
 
26
import os
36
27
import re
37
 
import os
38
28
import subprocess
39
29
import sys
40
30
import time
41
 
 
 
31
from copy import copy
 
32
from gettext import gettext as _
 
33
from gettext import ngettext
 
34
from math import ceil
 
35
from stat import S_IMODE, S_IXUSR, ST_MODE
 
36
from urllib.parse import urlsplit
42
37
from urllib.request import (
43
38
    ProxyHandler,
44
39
    Request,
46
41
    install_opener,
47
42
    urlopen,
48
43
)
49
 
from urllib.parse import urlsplit
50
 
 
51
 
from copy import copy
 
44
 
 
45
import apt
 
46
import apt_pkg
 
47
 
 
48
apt_pkg.init_config()
52
49
 
53
50
 
54
51
class ExecutionTime(object):
200
197
        )
201
198
        return dist
202
199
    # then check the real one
203
 
    from subprocess import Popen, PIPE
 
200
    from subprocess import PIPE, Popen
204
201
 
205
202
    p = Popen(
206
203
        ["lsb_release", "-c", "-s"], stdout=PIPE, universal_newlines=True
225
222
        )
226
223
        return desc
227
224
    # then check the real one
228
 
    from subprocess import Popen, PIPE
 
225
    from subprocess import PIPE, Popen
229
226
 
230
227
    p = Popen(
231
228
        ["lsb_release", "-r", "-s"], stdout=PIPE, universal_newlines=True
479
476
    import gi
480
477
 
481
478
    gi.require_version("Gtk", "3.0")
482
 
    from gi.repository import Gtk, Gdk
 
479
    from gi.repository import Gdk, Gtk
483
480
 
484
481
    d = Gtk.MessageDialog(
485
482
        parent=parent,