From 3c1e42aa026c809a2c17e8a42abfc6f4df5e4a23 Mon Sep 17 00:00:00 2001 From: Mykyta Holubakha Date: Sun, 9 Jun 2019 02:15:49 +0300 Subject: Mark handlers as static with to make pylint happy TODO: figure out a way to make it happy without doing this explicitely --- pomu/source/base.py | 1 + pomu/source/bugz.py | 3 +++ pomu/source/file.py | 2 ++ pomu/source/portage.py | 3 +++ pomu/source/url.py | 2 ++ 5 files changed, 11 insertions(+) diff --git a/pomu/source/base.py b/pomu/source/base.py index 2cf35e4..e425420 100644 --- a/pomu/source/base.py +++ b/pomu/source/base.py @@ -88,6 +88,7 @@ class BaseSource: __cname__ = None @dispatcher.handler() + @staticmethod def parse_full(uri): """ This method shall parse a full package specification (which starts with diff --git a/pomu/source/bugz.py b/pomu/source/bugz.py index c85cee1..f6d4ef7 100644 --- a/pomu/source/bugz.py +++ b/pomu/source/bugz.py @@ -53,6 +53,7 @@ class BugzillaSource(BaseSource): __cname__ = 'bugzilla' @dispatcher.handler(priority=1) + @staticmethod def parse_bug(uri): if not uri.isdigit(): return Result.Err() @@ -83,6 +84,7 @@ class BugzillaSource(BaseSource): return Result.Ok(BzEbuild(uri, fmap, category, name, ver, slot)) @dispatcher.handler(priority=2) + @staticmethod def parse_link(uri): res = urlparse(uri) if res.netloc != 'bugs.gentoo.org': @@ -96,6 +98,7 @@ class BugzillaSource(BaseSource): @dispatcher.handler() + @staticmethod def parse_full(uri): if not uri.startswith('bug:'): return Result.Err() diff --git a/pomu/source/file.py b/pomu/source/file.py index 51f86c6..7658435 100644 --- a/pomu/source/file.py +++ b/pomu/source/file.py @@ -53,6 +53,7 @@ class LocalEbuildSource(BaseSource): __cname__ = 'fs' @dispatcher.handler(priority=5) + @staticmethod def parse_ebuild_path(uri): if not path.isfile(uri) or not uri.endswith('.ebuild'): return Result.Err() @@ -71,6 +72,7 @@ class LocalEbuildSource(BaseSource): return Result.Ok(LocalEbuild(uri, category, name, ver, slot)) @dispatcher.handler() + @staticmethod def parse_full(uri): if not uri.startswith('fs:'): return Result.Err() diff --git a/pomu/source/portage.py b/pomu/source/portage.py index 9f5ba5a..d3050ac 100644 --- a/pomu/source/portage.py +++ b/pomu/source/portage.py @@ -56,6 +56,7 @@ class PortageSource(BaseSource): __cname__ = 'portage' @dispatcher.handler(priority=5) + @staticmethod def parse_spec(uri, repo=None): # dev-libs/openssl-0.9.8z_p8-r100:0.9.8::gentoo pkg, _, repo_ = uri.partition('::') # portage repo may be specified on the rhs as well @@ -72,6 +73,7 @@ class PortageSource(BaseSource): return Result.Ok(res) @dispatcher.handler() + @staticmethod def parse_full(uri): # portage/gentoo:dev-libs/openssl-0.9.8z_p8-r100:0.9.8::gentoo if not uri.startswith('portage'): @@ -89,6 +91,7 @@ class PortageSource(BaseSource): return PortageSource.parse_spec(uri, repo) @dispatcher.handler(priority=4) + @staticmethod def parse_repo_ebuild(uri): if not path.exists(uri): return Result.Err() diff --git a/pomu/source/url.py b/pomu/source/url.py index 6aca558..bb4868c 100644 --- a/pomu/source/url.py +++ b/pomu/source/url.py @@ -67,6 +67,7 @@ class URLGrabberSource(BaseSource): __cname__ = 'url' @dispatcher.handler(priority=5) + @staticmethod def parse_link(uri): if not (uri.startswith('http://') or uri.startswith('https://')): return Result.Err() @@ -83,6 +84,7 @@ class URLGrabberSource(BaseSource): return Result.Ok(URLEbuild(uri, files[0][1], category, name, ver, slot)) @dispatcher.handler() + @staticmethod def parse_full(url): if not url.startswith('url:'): return Result.Err() -- cgit v1.2.3-65-gdbad