aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMykyta Holubakha <hilobakho@gmail.com>2019-06-09 02:04:47 +0300
committerMykyta Holubakha <hilobakho@gmail.com>2019-06-09 02:04:47 +0300
commit11f9d095b5be2d8d63cdaf5133f21ee6f7443641 (patch)
tree5de25db13299bae7e552bcc081d32b536b3fde50
parentcli: argument passing fixes (diff)
downloadpomu-11f9d095b5be2d8d63cdaf5133f21ee6f7443641.tar.gz
pomu-11f9d095b5be2d8d63cdaf5133f21ee6f7443641.tar.bz2
pomu-11f9d095b5be2d8d63cdaf5133f21ee6f7443641.zip
Fix some pylint errors
-rw-r--r--pomu/patch/patch.py2
-rw-r--r--pomu/repo/repo.py4
-rw-r--r--pomu/source/file.py2
-rw-r--r--pomu/source/manager.py6
-rw-r--r--pomu/source/portage.py2
-rw-r--r--pomu/source/url.py4
-rw-r--r--pomu/util/iquery.py4
-rw-r--r--pomu/util/query.py2
-rw-r--r--pomu/util/remote.py2
9 files changed, 14 insertions, 14 deletions
diff --git a/pomu/patch/patch.py b/pomu/patch/patch.py
index 40a97c6..ddc205b 100644
--- a/pomu/patch/patch.py
+++ b/pomu/patch/patch.py
@@ -25,7 +25,7 @@ def process_changes(_repo, single):
pkpref = '/'.join(path.dirname(f).split('/')[0:2])
if pkpref in res:
paths[pkpref].append(f)
- res[pkpref].append(new_file_patch(f))
+ res[pkpref].append(new_file_patch(_repo, f))
for diff in chans: # changes in tracked files
pkpref = '/'.join(path.dirname(diff.a_path).split('/')[0:2])
if pkpref in res:
diff --git a/pomu/repo/repo.py b/pomu/repo/repo.py
index 98ed4ae..ef7e784 100644
--- a/pomu/repo/repo.py
+++ b/pomu/repo/repo.py
@@ -96,13 +96,13 @@ class Repository():
r = self.repo
for wd, f in package.files:
dst = path.join(self.root, wd)
- remove_file(path.join(dst, f))
+ remove_file(r, path.join(dst, f))
try:
rmdir(dst)
except OSError: pass
pf = path.join(self.pomu_dir, package.name)
if path.isfile(pf):
- remove_file(pf)
+ remove_file(r, pf)
r.commit('Removed package ' + package.name + ' successfully')
return Result.Ok('Removed package ' + package.name + ' successfully')
diff --git a/pomu/source/file.py b/pomu/source/file.py
index 9f74d6c..a3a7e91 100644
--- a/pomu/source/file.py
+++ b/pomu/source/file.py
@@ -54,7 +54,7 @@ class LocalEbuildSource(BaseSource):
@dispatcher.handler(priority=5)
def parse_ebuild_path(uri):
- if not path.isfile(uri) or not path.endswith('.ebuild'):
+ if not path.isfile(uri) or not uri.endswith('.ebuild'):
return Result.Err()
uri = path.abspath(uri)
dirn, basen = path.split(uri)
diff --git a/pomu/source/manager.py b/pomu/source/manager.py
index c4a0077..60dfe38 100644
--- a/pomu/source/manager.py
+++ b/pomu/source/manager.py
@@ -63,8 +63,8 @@ class PackageDispatcher():
class _handler():
def __init__(self, handler):
self.handler = handler
- def __call__(self, *args):
- return self.handler(*args)
+ def __call__(self, *args, **kwargs):
+ return self.handler(*args, **kwargs)
def __init__(self, priority=1000, *args, **kwargs):
self.priority = priority
@@ -72,7 +72,7 @@ class PackageDispatcher():
def __call__(self, func, *args, **kwargs):
x = self._handler(func)
x.priority = self.priority
- return x
+ return staticmethod(x)
def register_package_handler(self, source, handler, priority):
"""
diff --git a/pomu/source/portage.py b/pomu/source/portage.py
index a832ff1..9f5ba5a 100644
--- a/pomu/source/portage.py
+++ b/pomu/source/portage.py
@@ -145,4 +145,4 @@ def sanity_check(repo, category, name, vernum, suff, rev, slot, ver=None):
pkg = sorted(pkgs, key=cmp_to_key(lambda x,y:vercmp(x[3],y[3])), reverse=True)[0]
return PortagePackage(*pkg)
-__all__ = [PortagePackage, PortageSource]
+__all__ = ['PortagePackage', 'PortageSource']
diff --git a/pomu/source/url.py b/pomu/source/url.py
index 8f0366c..b0ad2be 100644
--- a/pomu/source/url.py
+++ b/pomu/source/url.py
@@ -53,7 +53,7 @@ class URLEbuild(PackageBase):
def write_meta(self, pkgdir):
super().write_meta(pkgdir)
with open(path.join(pkgdir, 'ORIG_URL'), 'w') as f:
- f.write(self.path + '\n')
+ f.write(self.url + '\n')
def __str__(self):
return super().__str__() + ' (from {})'.format(self.url)
@@ -86,7 +86,7 @@ class URLGrabberSource(BaseSource):
def parse_full(url):
if not url.startswith('url:'):
return Result.Err()
- return URLGrabberSource.parse_ebuild_path(url[4:])
+ return URLGrabberSource.parse_link(url[4:])
@classmethod
def fetch_package(self, pkg):
diff --git a/pomu/util/iquery.py b/pomu/util/iquery.py
index 8f81e57..05c923f 100644
--- a/pomu/util/iquery.py
+++ b/pomu/util/iquery.py
@@ -69,7 +69,7 @@ class Prompt:
def toggle(self):
raise NotImplementedError()
- def process_entry(x, entry):
+ def process_entry(self, entry):
raise NotImplementedError()
def process_event(self, event):
@@ -186,7 +186,7 @@ class EditSelectPrompt(Prompt):
if not gr:
del self.entries[self.idx]
self.idx = self.clamp(self.idx - 1)
- pager('Error: could not fetch '.format(entry))
+ pager('Error: could not fetch {}'.format(entry))
self.entries[self.idx:self.idx+1] = [self.process_entry((x[0], x[1].encode('utf-8'))) for x in gr]
pager(self.entries[self.idx][1])
diff --git a/pomu/util/query.py b/pomu/util/query.py
index 872e0a3..66ddf7a 100644
--- a/pomu/util/query.py
+++ b/pomu/util/query.py
@@ -56,6 +56,6 @@ class QueryContext:
def __enter__(self):
self.map_old = {x: query.set(x, self.map[x]) for x in self.map}
- def __exit__(self):
+ def __exit__(self, ex_type, ex_val, tb):
for x, y in self.map_old.items():
query.set(x, y)
diff --git a/pomu/util/remote.py b/pomu/util/remote.py
index c0c6554..b1ce78a 100644
--- a/pomu/util/remote.py
+++ b/pomu/util/remote.py
@@ -31,7 +31,7 @@ def get_full_cpv(cpvs, name, category=None, version=None):
cpvl = filter(lambda x: x[1] == name and (not category or x[0] == category), cpvs)
if not cpvl: return Result.Err()
if version:
- cpvl = cpvl.filter(lambda x: x[2] == version)[:1]
+ cpvl = list(filter(lambda x: x[2] == version, cpvl))[:1]
b = best(list('{}/{}-{}'.format(c, n, v) for c, n, v in cpvl))
if b:
cat, name, v, s, r = cpv_split(b)