Permalink
Browse files

RF(first wave): .distribution -> .distributions, .provenance -> .formats

  • Loading branch information...
yarikoptic committed May 18, 2017
1 parent af7c18f commit d20c5ee98091ba906f55414a85aea14796ca5ad4
View
@@ -67,7 +67,7 @@ def _mk_title(self, prog):
def _make_name(self, parser):
"""
this method is in consitent with others ... it relies on
distribution
distributions
"""
return '.SH NAME\n%s \\- %s\n' % (parser.prog,
parser.description)
@@ -13,4 +13,4 @@
__docformat__ = 'restructuredtext'
# Allow base Distribution class to be available directly from the package.
from niceman.distribution.base import Distribution
from niceman.distributions.base import Distribution
@@ -12,7 +12,7 @@
import abc
import logging
lgr = logging.getLogger('niceman.distribution')
lgr = logging.getLogger('niceman.distributions')
class Distribution(object):
"""
@@ -52,7 +52,7 @@ def factory(distribution_type, provenance):
Instance of a Distribution sub-class
"""
class_name = distribution_type.capitalize() + 'Distribution'
module = import_module('niceman.distribution.' + distribution_type)
module = import_module('niceman.distributions.' + distribution_type)
return getattr(module, class_name)(provenance)
@abc.abstractmethod
@@ -8,10 +8,10 @@
# ## ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
"""Orchestrator sub-class to provide management of the localhost environment."""
from niceman.distribution import Distribution
from niceman.distributions import Distribution
import logging
lgr = logging.getLogger('niceman.distribution.conda')
lgr = logging.getLogger('niceman.distributions.conda')
class CondaDistribution(Distribution):
"""
@@ -8,10 +8,10 @@
# ## ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
"""Orchestrator sub-class to provide management of the localhost environment."""
from niceman.distribution import Distribution
from niceman.distributions import Distribution
import logging
lgr = logging.getLogger('niceman.distribution.debian')
lgr = logging.getLogger('niceman.distributions.debian')
class DebianDistribution(Distribution):
"""
@@ -8,10 +8,10 @@
# ## ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
"""Orchestrator sub-class to provide management of the localhost environment."""
from niceman.distribution.debian import DebianDistribution
from niceman.distributions.debian import DebianDistribution
import logging
lgr = logging.getLogger('niceman.distribution.neurodebian')
lgr = logging.getLogger('niceman.distributions.neurodebian')
class NeurodebianDistribution(DebianDistribution):
"""
@@ -8,10 +8,10 @@
# ## ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
"""Orchestrator sub-class to provide management of the localhost environment."""
from niceman.distribution import Distribution
from niceman.distributions import Distribution
import logging
lgr = logging.getLogger('niceman.distribution.pypi')
lgr = logging.getLogger('niceman.distributions.pypi')
class PypiDistribution(Distribution):
"""
@@ -7,7 +7,7 @@
#
# ## ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
from ...provenance import Provenance
from ...formats import Provenance
import logging
from mock import MagicMock, call
@@ -3,7 +3,7 @@
The provenance files in the niceman/examples directory are used for this example.
"""
from niceman.provenance import Provenance
from niceman.formats import Provenance
# from debian_package_manager import DebianPackageManager
# from niceman import Orchestrator
@@ -13,4 +13,4 @@
__docformat__ = 'restructuredtext'
# Allow the base Provenance class to be available directly from the package.
from niceman.provenance.base import Provenance
from niceman.formats.base import Provenance
@@ -50,7 +50,7 @@ def factory(source, format='nicemanspec'):
Provenance sub-class instance
"""
class_name = format.capitalize() + 'Provenance'
module = import_module('niceman.provenance.' + format)
module = import_module('niceman.formats.' + format)
return getattr(module, class_name)(source)
@staticmethod
@@ -16,15 +16,15 @@
from ..dochelpers import exc_str
from .base import Provenance
from ..distribution import Distribution
from ..distributions import Distribution
import logging
lgr = logging.getLogger('niceman.provenance.nicemanspec')
lgr = logging.getLogger('niceman.formats.nicemanspec')
class NicemanspecProvenance(Provenance):
"""
Parser for NICEMAN Spec provenance (YAML specification)
Parser for NICEMAN Spec (YAML specification)
"""
def __init__(self, source):
@@ -34,7 +34,7 @@ def __init__(self, source):
Parameters
----------
source : string
Path or URL of provenance file.
File path or URL
"""
self._yaml = None
self._load(source)
@@ -46,7 +46,7 @@ def _load(self, source):
Parameters
----------
source : string
Filename or URL endpoint of the spec file.
File path or URL
"""
with open(source, 'r') as stream:
try:
@@ -70,7 +70,7 @@ def get_operating_system(self):
def get_distributions(self):
"""
Retrieve the information for all the distributions recorded in the
provenance file.
file.
Returns
-------
@@ -96,7 +96,7 @@ def get_distributions(self):
distributions = [{'name': package['distribution']}]
else:
raise ValueError(
"Provide a single distribution or even multiple distributions")
"Provide a single or multiple distributions")
if isinstance(distributions, str):
# we were provided a single distribution so there were no list
@@ -18,11 +18,11 @@
from .base import Provenance
import logging
lgr = logging.getLogger('niceman.provenance.reprozip')
lgr = logging.getLogger('niceman.formats.reprozip')
class ReprozipProvenance(Provenance):
"""Parser for ReproZip provenance (YAML specification) """
"""Parser for ReproZip file format (YAML specification) """
def __init__(self, source):
self._yaml = None
@@ -10,7 +10,7 @@
import logging
from niceman.utils import swallow_logs
from niceman.provenance import Provenance
from niceman.formats import Provenance
import niceman.tests.fixtures
@@ -12,7 +12,7 @@
See: https://en.wikipedia.org/wiki/TriG_(syntax)
"""
from niceman.provenance.base import Provenance
from niceman.formats.base import Provenance
from rdflib import ConjunctiveGraph
class TrigProvenance(Provenance):
@@ -13,7 +13,7 @@
from .base import Interface, get_resource_info
import niceman.interface.base # Needed for test patching
# from ..provenance import Provenance
# from ..formats import Provenance
from ..support.param import Parameter
from ..support.constraints import EnsureStr
from ..resource import Resource
@@ -14,7 +14,7 @@
from .base import Interface, get_resource_info
from ..support.param import Parameter
from ..support.constraints import EnsureStr
from ..provenance import Provenance
from ..formats import Provenance
from ..resource import Resource
from logging import getLogger
@@ -6,7 +6,7 @@
# copyright and license terms.
#
# ## ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
"""Determine package and distribution information for files
"""Determine package and distributions information for files
"""

0 comments on commit d20c5ee

Please sign in to comment.