Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
PureOS
Core Packages
python-apt
Commits
c11bb33c
Commit
c11bb33c
authored
Oct 14, 2020
by
Julian Andres Klode
Browse files
Make pycodestyle happy
parent
62b7d9dc
Changes
4
Hide whitespace changes
Inline
Side-by-side
aptsources/distro.py
View file @
c11bb33c
...
...
@@ -479,7 +479,8 @@ def _lsb_release():
out
=
Popen
([
'lsb_release'
,
'-idrc'
],
stdout
=
PIPE
).
communicate
()[
0
]
# Convert to unicode string, needed for Python 3.1
out
=
out
.
decode
(
"utf-8"
)
result
.
update
(
l
.
split
(
":
\t
"
)
for
l
in
out
.
split
(
"
\n
"
)
if
':
\t
'
in
l
)
result
.
update
(
line
.
split
(
":
\t
"
)
for
line
in
out
.
split
(
"
\n
"
)
if
':
\t
'
in
line
)
except
OSError
as
exc
:
if
exc
.
errno
!=
errno
.
ENOENT
:
logging
.
warning
(
'lsb_release failed, using defaults:'
%
exc
)
...
...
@@ -499,9 +500,9 @@ def _system_image_channel():
out
=
Popen
(
[
'system-image-cli'
,
'-i'
],
stdout
=
PIPE
,
stderr
=
DEVNULL
,
universal_newlines
=
True
).
communicate
()[
0
]
for
l
in
out
.
splitlines
():
if
l
.
startswith
(
'channel: '
):
return
l
.
split
(
': '
,
1
)[
1
]
for
l
ine
in
out
.
splitlines
():
if
l
ine
.
startswith
(
'channel: '
):
return
l
ine
.
split
(
': '
,
1
)[
1
]
except
OSError
as
exc
:
if
exc
.
errno
!=
errno
.
ENOENT
:
logging
.
warning
(
...
...
doc/examples/checkstate.py
View file @
c11bb33c
...
...
@@ -32,5 +32,5 @@ for package in packages:
uninstalled
[
package
.
name
]
=
version
for
l
in
(
uninstalled
,
updated
,
upgradable
):
print
(
list
(
l
.
items
())[
0
])
for
l
ine
in
(
uninstalled
,
updated
,
upgradable
):
print
(
list
(
l
ine
.
items
())[
0
])
doc/examples/config.py
View file @
c11bb33c
...
...
@@ -54,5 +54,5 @@ print("No help for you, try -h")
# Print the configuration space
print
(
"The Configuration space looks like:"
)
for
I
in
list
(
Cnf
.
keys
()):
print
(
"%s
\"
%s
\"
;"
%
(
I
,
Cnf
[
I
]))
for
item
in
list
(
Cnf
.
keys
()):
print
(
"%s
\"
%s
\"
;"
%
(
item
,
Cnf
[
item
]))
doc/examples/configisc.py
View file @
c11bb33c
...
...
@@ -22,21 +22,21 @@ apt_pkg.read_config_file_isc(Cnf, ConfigFile[0])
# Print the configuration space
#print "The Configuration space looks like:"
#for
I
in Cnf.keys():
# print "%s \"%s\";" % (
I
, Cnf[
I
])
#for
item
in Cnf.keys():
# print "%s \"%s\";" % (
item
, Cnf[
item
])
# bind8 config file..
if
"Zone"
in
Cnf
:
print
(
"Zones: "
,
Cnf
.
sub_tree
(
"zone"
).
list
())
for
I
in
Cnf
.
list
(
"zone"
):
SubCnf
=
Cnf
.
sub_tree
(
I
)
for
item
in
Cnf
.
list
(
"zone"
):
SubCnf
=
Cnf
.
sub_tree
(
item
)
if
SubCnf
.
find
(
"type"
)
==
"slave"
:
print
(
"Masters for %s: %s"
%
(
SubCnf
.
my_tag
(),
SubCnf
.
value_list
(
"masters"
)))
else
:
print
(
"Tree definitions:"
)
for
I
in
Cnf
.
list
(
"tree"
):
SubCnf
=
Cnf
.
sub_tree
(
I
)
for
item
in
Cnf
.
list
(
"tree"
):
SubCnf
=
Cnf
.
sub_tree
(
item
)
# This could use Find which would eliminate the possibility of
# exceptions.
print
(
"Subtree %s with sections '%s' and architectures '%s'"
%
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment