aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMykyta Holubakha <hilobakho@gmail.com>2019-06-09 00:35:54 +0300
committerMykyta Holubakha <hilobakho@gmail.com>2019-06-09 00:35:54 +0300
commit75b70897ff9ce7dcd6db66ee8e4d5118822a6f66 (patch)
tree86bab3286956988605a5a8633fed1fe818b8c275 /pomu/source
parentDisabled standalone mode (diff)
downloadpomu-75b70897ff9ce7dcd6db66ee8e4d5118822a6f66.tar.gz
pomu-75b70897ff9ce7dcd6db66ee8e4d5118822a6f66.tar.bz2
pomu-75b70897ff9ce7dcd6db66ee8e4d5118822a6f66.zip
cli: argument passing fixes
sources: fix custom names fixed version string generation and version search ensure import -> change -> commit workflow works
Diffstat (limited to 'pomu/source')
-rw-r--r--pomu/source/base.py4
-rw-r--r--pomu/source/bugz.py6
-rw-r--r--pomu/source/file.py4
-rw-r--r--pomu/source/manager.py2
-rw-r--r--pomu/source/portage.py6
-rw-r--r--pomu/source/url.py4
6 files changed, 18 insertions, 8 deletions
diff --git a/pomu/source/base.py b/pomu/source/base.py
index 712f2e6..2cf35e4 100644
--- a/pomu/source/base.py
+++ b/pomu/source/base.py
@@ -21,7 +21,7 @@ class PackageBase():
"""
"""The implementation shall provide a name for the package type"""
- __name__ = None
+ __cname__ = None
def __init__(self, category, name, version, slot='0'):
"""
@@ -85,6 +85,8 @@ class BaseSource:
It shall provide a method to instantiate a package of this type from the
metadata directory.
"""
+ __cname__ = None
+
@dispatcher.handler()
def parse_full(uri):
"""
diff --git a/pomu/source/bugz.py b/pomu/source/bugz.py
index bd0d887..5ecace5 100644
--- a/pomu/source/bugz.py
+++ b/pomu/source/bugz.py
@@ -15,8 +15,8 @@ from pomu.util.query import query, QueryContext
from pomu.util.result import Result
class BzEbuild(PackageBase):
- """A class to represent a local ebuild"""
- __name__ = 'fs'
+ """A class to represent an ebuild from bugzilla"""
+ __cname__ = 'bugzilla'
def __init__(self, bug_id, filemap, category, name, version, slot='0'):
super().__init__(category, name, version, slot)
@@ -50,6 +50,8 @@ CLIENT_BASE = 'https://bugs.gentoo.org/xmlrpc.cgi'
@dispatcher.source
class BugzillaSource(BaseSource):
"""The source module responsible for importing ebuilds and patches from bugzilla tickets"""
+ __cname__ = 'bugzilla'
+
@dispatcher.handler(priority=1)
def parse_bug(uri):
if not uri.isdigit():
diff --git a/pomu/source/file.py b/pomu/source/file.py
index a573cda..9f74d6c 100644
--- a/pomu/source/file.py
+++ b/pomu/source/file.py
@@ -13,7 +13,7 @@ from pomu.util.result import Result
class LocalEbuild(PackageBase):
"""A class to represent a local ebuild"""
- __name__ = 'fs'
+ __cname__ = 'fs'
def __init__(self, path, category, name, version, slot='0'):
super().__init__(category, name, version, slot)
@@ -50,6 +50,8 @@ class LocalEbuild(PackageBase):
@dispatcher.source
class LocalEbuildSource(BaseSource):
"""The source module responsible for importing local ebuilds"""
+ __cname__ = 'fs'
+
@dispatcher.handler(priority=5)
def parse_ebuild_path(uri):
if not path.isfile(uri) or not path.endswith('.ebuild'):
diff --git a/pomu/source/manager.py b/pomu/source/manager.py
index 61ed9be..c4a0077 100644
--- a/pomu/source/manager.py
+++ b/pomu/source/manager.py
@@ -48,7 +48,7 @@ class PackageDispatcher():
return cls
if cls == BaseSource:
return cls
- self.backends[cls.__name__] = cls
+ self.backends[cls.__cname__] = cls
for m, obj in inspect.getmembers(cls):
if isinstance(obj, self.handler._handler):
self.register_package_handler(cls, obj.handler, obj.priority)
diff --git a/pomu/source/portage.py b/pomu/source/portage.py
index 39336ee..a832ff1 100644
--- a/pomu/source/portage.py
+++ b/pomu/source/portage.py
@@ -16,7 +16,7 @@ from pomu.util.result import Result
class PortagePackage(PackageBase):
"""A class to represent a portage package"""
- __name__ = 'portage'
+ __cname__ = 'portage'
def __init__(self, repo, category, name, version, slot='0'):
super().__init__(category, name, version, slot)
@@ -53,6 +53,8 @@ class PortagePackage(PackageBase):
@dispatcher.source
class PortageSource(BaseSource):
"""The source module responsible for fetching portage packages"""
+ __cname__ = 'portage'
+
@dispatcher.handler(priority=5)
def parse_spec(uri, repo=None):
# dev-libs/openssl-0.9.8z_p8-r100:0.9.8::gentoo
@@ -118,7 +120,7 @@ class PortageSource(BaseSource):
@classmethod
def from_meta_dir(cls, metadir):
- return PortagePackage.from_data_dir(cls, metadir)
+ return PortagePackage.from_data_dir(metadir)
def sanity_check(repo, category, name, vernum, suff, rev, slot, ver=None):
diff --git a/pomu/source/url.py b/pomu/source/url.py
index 0759e5c..8f0366c 100644
--- a/pomu/source/url.py
+++ b/pomu/source/url.py
@@ -14,7 +14,7 @@ from pomu.util.result import Result
class URLEbuild(PackageBase):
"""A class to represent an ebuild fetched from a url"""
- __name__ = 'fs'
+ __cname__ = 'url'
def __init__(self, url, contents, category, name, version, slot):
self.url = url
@@ -64,6 +64,8 @@ class URLGrabberSource(BaseSource):
The source module responsible for grabbing modules from URLs,
including pastebins
"""
+ __cname__ = 'url'
+
@dispatcher.handler(priority=5)
def parse_link(uri):
if not (uri.startswith('http://') or uri.startswith('https://')):