Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Apr 28, 2025. It is now read-only.
/yumex-dnf-oldPublic archive

Commit9be0a22

Browse files
committed
lint: cleanup flake8 issues
1 parent5c97518 commit9be0a22

File tree

10 files changed

+40
-40
lines changed

10 files changed

+40
-40
lines changed

‎.flake8‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[flake8]
2+
max-line-length = 88
3+
extend-ignore = E203

‎src/update.py‎

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,19 @@
2020

2121
# pylint: disable=broad-except, unused-import, wrong-import-position
2222

23+
importsys
24+
importtraceback
25+
importsubprocess
26+
importsignal
27+
2328
# We need this for else is Gtk 4.0 selected by default
2429
importgi# isort:skip
2530

2631
gi.require_version("Gtk","3.0")# isort:skip
2732
gi.require_version("Notify","0.7")# isort:skip
28-
fromgi.repositoryimportGtk#type: ignore isort:skip
33+
fromgi.repositoryimportGtk#noqa: F401, E402
2934

30-
fromyumex.updaterimportUpdateApplication
31-
importsys
32-
importtraceback
33-
importsubprocess
34-
importsignal
35+
fromyumex.updaterimportUpdateApplication# noqa: E402
3536

3637
here=sys.path[0]
3738
ifhere!="/usr/bin":
@@ -44,7 +45,7 @@
4445
app=UpdateApplication()
4546
exit_status=app.run(sys.argv)
4647
sys.exit(exit_status)
47-
exceptExceptionase:
48+
exceptException:
4849
print("Exception in user code:")
4950
print("-"*80)
5051
traceback.print_exc(file=sys.stdout)

‎src/yumex/__init__.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@
2121
importlogging
2222
importsys
2323

24-
importgi#isort:skip
24+
importgi#noqa: F401
2525
fromgi.repositoryimportGio,Gtk# isort:skip
2626

27-
fromyumex.commonimportconst,CONFIG,_,dbus_dnfsystem,logger_setup
27+
fromyumex.commonimportCONFIG,dbus_dnfsystem,logger_setup
2828
fromyumex.gui.windowimportWindow
2929

3030
logger=logging.getLogger("yumex")

‎src/yumex/common/__init__.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
# the Free Software Foundation, Inc.,
1818
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
1919

20-
importargparse
2120
importconfigparser
2221
importgettext
2322
importlocale
@@ -29,6 +28,9 @@
2928
importtime
3029

3130
importdnfdaemon.client
31+
importyumex.common.configasconfig
32+
importyumex.common.constasconst
33+
3234
fromgi.repositoryimportGdk,Gtk,Notify
3335

3436
LOCALE_DIR=os.path.join(sys.prefix,"share","locale")
@@ -39,8 +41,6 @@
3941
_=gettext.gettext
4042
ngettext=gettext.ngettext
4143

42-
importyumex.common.configasconfig
43-
importyumex.common.constasconst
4444

4545
logger=logging.getLogger("yumex.common")
4646

‎src/yumex/common/config.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
It is modified to work in Python 3
1919
"""
2020
# pylint: skip-file
21-
# FIXME: lot of pylint issues, so we disable it for now, the whole config option has to be redesigned
21+
# FIXME: lot of pylint issues, so we disable it for now,
22+
# the whole config option has to be redesigned
2223

2324
importcopy
2425
importglob

‎src/yumex/gui/views/queueview.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,12 @@
2020
importlogging
2121

2222
fromgi.repositoryimportGObject,Gtk
23+
2324
fromyumeximportconst
2425
fromyumex.commonimport_,ngettext
26+
fromyumex.gui.views.packagequeueimportPackageQueue
2527

2628
logger=logging.getLogger("yumex.gui.views")
27-
fromyumex.gui.views.packagequeueimportPackageQueue
2829

2930

3031
classQueueView(Gtk.TreeView):

‎src/yumex/gui/widgets/packageinfo.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ def _write_update_info(self, upd_info):
303303
self.write("{header} : ","filelist",newline=False)
304304
self.add_url(bug,url)
305305
self.write(bug_msg,"filelist")
306-
header=" "
306+
header=" "# noqa: F841
307307

308308
desc=upd_info["description"]
309309
head+=f'\n{_("Description"):14} :{format_block(desc,17)}\n'

‎src/yumex/gui/window/__init__.py‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
1919

2020
# pylint: disable=attribute-defined-outside-init
21-
importgi# isort:skip
2221
fromgi.repositoryimportGdk,Gtk# isort:skip
2322

2423
importlogging
@@ -484,7 +483,7 @@ def _check_protected(self, trans):
484483
protected= []
485484
foraction,pkgsintrans:
486485
ifaction=="remove":
487-
forpkgid,_,_inpkgs:
486+
forpkgid,_,_inpkgs:# noqa: F402
488487
(n,_,_,_,_,_)=str(pkgid).split(",")
489488
ifninCONFIG.conf.protected:
490489
protected.append(n)

‎src/yumex/gui/window/basewindow.py‎

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@
1717
# the Free Software Foundation, Inc.,
1818
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
1919

20-
importgi# pylint: disable=unused-import
21-
fromgi.repositoryimportGdk,GLib,Gtk# isort:skip
20+
fromgi.repositoryimportGdk,Gtk# isort:skip
2221

2322
importlogging
2423
importos.path
@@ -82,10 +81,7 @@ def apply_css(self, css_fn):
8281
ifcss_fn:
8382
screen=Gdk.Screen.get_default()
8483
css_provider=Gtk.CssProvider()
85-
try:
86-
css_provider.load_from_path(css_fn)
87-
exceptGLib.Errorase:
88-
logger.error(f"Error in theme:{e} ")
84+
css_provider.load_from_path(css_fn)
8985
context=Gtk.StyleContext()
9086
context.add_provider_for_screen(
9187
screen,css_provider,Gtk.STYLE_PROVIDER_PRIORITY_USER
@@ -103,9 +99,9 @@ def load_colors(self, theme_fn):
10399
]
104100
regex=re.compile(r"@define-color\s(\w*)\s*(#\w{6}|@\w*)\s*;")
105101
ifcommon.check_dark_theme():
106-
backup_color="#ffffff"
102+
color_bak="#ffffff"
107103
else:
108-
backup_color="#000000"
104+
color_bak="#000000"
109105
withopen(theme_fn,"r",encoding="UTF-8")asreader:
110106
lines=reader.readlines()
111107
forlineinlines:
@@ -117,18 +113,18 @@ def load_colors(self, theme_fn):
117113
logger.debug(f"loaded{len(color_table)} colors from{theme_fn}")
118114
forcolorincolors:
119115
ifcolorincolor_table:
120-
color_value=color_table[color]
121-
ifcolor_value.startswith("@"):# lookup macro color
122-
key=color_value[1:]# dump the @
116+
color_val=color_table[color]
117+
ifcolor_val.startswith("@"):# lookup macro color
118+
key=color_val[1:]# dump the @
123119
ifkeyincolor_table:
124-
color_value=color_table[key]
120+
color_val=color_table[key]
125121
else:
126122
logger.info(
127-
f"Unknown Color alias :{color_value} default to{backup_color}"
123+
f"Unknown Color alias :{color_val} default to{color_bak}"
128124
)
129-
color_value=backup_color
130-
setattr(CONFIG.session,color,color_value)
131-
logger.debug(f" --> updated color :{color} to:{color_value}")
125+
color_val=color_bak
126+
setattr(CONFIG.session,color,color_val)
127+
logger.debug(f" --> updated color :{color} to:{color_val}")
132128

133129
defload_theme(self):
134130
theme_fn=os.path.join(const.THEME_DIR,CONFIG.conf.theme)

‎src/yumex/updater/__init__.py‎

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,18 +31,17 @@
3131
importsys
3232
importtime
3333

34+
fromxdgimportBaseDirectory
35+
importdnfdaemon.client
36+
fromyumex.commonimport_,ngettext,CONFIG
37+
importyumex.commonascommon
38+
3439
importgi
3540

3641
gi.require_version("Gtk","3.0")
3742
gi.require_version("Notify","0.7")
38-
fromgi.repositoryimportGio,Notify,GObject,GLib
43+
fromgi.repositoryimportGio,Notify,GObject,GLib# noqa: E402
3944

40-
fromxdgimportBaseDirectory
41-
42-
importdnfdaemon.client
43-
44-
fromyumex.commonimport_,ngettext,CONFIG
45-
importyumex.commonascommon
4645

4746
LOG_ROOT="yumex.updater"
4847

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp