# Path: punch/version_part.py
# def _strftime(fmt):
# def strftime(fmt):
#     def from_dict(cls, dic):
#     def __init__(self, name, value=None, start_value=None):
#     def inc(self):
#     def set(self, value):
#     def reset(self):
#     def copy(self):
#     def __init__(self, name, value, allowed_values):
#     def set(self, value):
#     def inc(self):
#     def reset(self):
#     def copy(self):
#     def __init__(self, name, value, fmt):
#     def reset(self):
#     def inc(self):
#     def copy(self):
# class VersionPart(object):
# class IntegerVersionPart(VersionPart):
# class ValueListVersionPart(VersionPart):
# class DateVersionPart(VersionPart):
# 
# Path: punch/helpers.py
# def import_file(filepath):
#     if sys.version_info < (3, 0):  # pragma: nocover
#         import imp
# 
#         module = imp.load_source("punch_config", filepath)
# 
#     elif sys.version_info < (3, 5):  # pragma: nocover
#         from importlib.machinery import SourceFileLoader
# 
#         try:
#             module = SourceFileLoader("punch_config", filepath).load_module()
#         except FileNotFoundError:
#             raise ValueError(
#                 "The module file {} cannot be found.".format(filepath))
#         except ImportError:
#             raise ValueError(
#                 "The module file {} cannot imported due to an error.".format(
#                     filepath))
# 
#     else:
#         import importlib.util
# 
#         spec = importlib.util.spec_from_file_location("punch_config", filepath)
#         module = importlib.util.module_from_spec(spec)
#         spec.loader.exec_module(module)
# 
#     return module


from collections import abc, OrderedDict
from punch import version_part as vpart
from punch.helpers import import_file
from __future__ import print_function, absolute_import, division



class Version():

    def __init__(self):
        self.parts = OrderedDict()

    @property
    def keys(self):
        return list(self.parts.keys())

    @property
    def values(self):
        return list(self.parts.values())

    def __eq__(self, other):
        return self.as_dict() == other.as_dict()

    def add_part(self, part):
        self.keys.append(part.name)
        self.parts[part.name] = part

    def create_part(self, name, value,
                    cls=vpart.IntegerVersionPart, *args, **kwds):
        self.keys.append(name)
        self.parts[name] = cls(name, value, *args, **kwds)

    def add_part_from_dict(self, dic):

# Path: punch/version_part.py
# def _strftime(fmt):
# def strftime(fmt):
#     def from_dict(cls, dic):
#     def __init__(self, name, value=None, start_value=None):
#     def inc(self):
#     def set(self, value):
#     def reset(self):
#     def copy(self):
#     def __init__(self, name, value, allowed_values):
#     def set(self, value):
#     def inc(self):
#     def reset(self):
#     def copy(self):
#     def __init__(self, name, value, fmt):
#     def reset(self):
#     def inc(self):
#     def copy(self):
# class VersionPart(object):
# class IntegerVersionPart(VersionPart):
# class ValueListVersionPart(VersionPart):
# class DateVersionPart(VersionPart):
# 
# Path: punch/helpers.py
# def import_file(filepath):
#     if sys.version_info < (3, 0):  # pragma: nocover
#         import imp
# 
#         module = imp.load_source("punch_config", filepath)
# 
#     elif sys.version_info < (3, 5):  # pragma: nocover
#         from importlib.machinery import SourceFileLoader
# 
#         try:
#             module = SourceFileLoader("punch_config", filepath).load_module()
#         except FileNotFoundError:
#             raise ValueError(
#                 "The module file {} cannot be found.".format(filepath))
#         except ImportError:
#             raise ValueError(
#                 "The module file {} cannot imported due to an error.".format(
#                     filepath))
# 
#     else:
#         import importlib.util
# 
#         spec = importlib.util.spec_from_file_location("punch_config", filepath)
#         module = importlib.util.module_from_spec(spec)
#         spec.loader.exec_module(module)
# 
#     return module


# Path: punch/version.py
from collections import abc, OrderedDict
from punch import version_part as vpart
from punch.helpers import import_file

from __future__ import print_function, absolute_import, division



class Version():

    def __init__(self):
        self.parts = OrderedDict()

    @property
    def keys(self):
        return list(self.parts.keys())

    @property
    def values(self):
        return list(self.parts.values())

    def __eq__(self, other):
        return self.as_dict() == other.as_dict()

    def add_part(self, part):
        self.keys.append(part.name)
        self.parts[part.name] = part

    def create_part(self, name, value,
                    cls=vpart.IntegerVersionPart, *args, **kwds):
        self.keys.append(name)
        self.parts[name] = cls(name, value, *args, **kwds)

    def add_part_from_dict(self, dic):

        vp = vpart.VersionPart.from_dict(dic)