# Path: src/artifactcli/artifact/baseinfo.py
# class BaseInfo(CaseClass):
#     def to_dict(self):
#         return dict((k, getattr(self, k)) for k in self.keys)


import time
import logging
import os
import dateutil.parser
import git
from datetime import datetime
from .baseinfo import BaseInfo
from artifactcli.util import *


class GitInfo(BaseInfo):
    keys = ['branch', 'tags', 'author_name', 'author_email', 'committed_date', 'summary', 'sha']

    def __init__(self, branch, tags, author_name, author_email, committed_date, summary, sha):
        super(GitInfo, self).__init__(GitInfo.keys)
        self.system = 'git'
        self.branch = branch
        self.tags = tags
        self.author_name = author_name
        self.author_email = author_email
        self.committed_date = committed_date
        self.summary = summary
        self.sha = sha

    def __str__(self):
        buf = [
            'Git Info:',
            '  Branch             : %s' % self.branch,
            '  Tags               : %s' % ', '.join(self.tags),
            '  Last Commit Author : %s <%s>' % (self.author_name, self.author_email),
            '  Last Commit Date   : %s' % self.committed_date,

# Path: src/artifactcli/artifact/baseinfo.py
# class BaseInfo(CaseClass):
#     def to_dict(self):
#         return dict((k, getattr(self, k)) for k in self.keys)


# Path: src/artifactcli/artifact/gitinfo.py
import time
import logging
import os
import dateutil.parser
import git
from datetime import datetime
from .baseinfo import BaseInfo
from artifactcli.util import *



class GitInfo(BaseInfo):
    keys = ['branch', 'tags', 'author_name', 'author_email', 'committed_date', 'summary', 'sha']

    def __init__(self, branch, tags, author_name, author_email, committed_date, summary, sha):
        super(GitInfo, self).__init__(GitInfo.keys)
        self.system = 'git'
        self.branch = branch
        self.tags = tags
        self.author_name = author_name
        self.author_email = author_email
        self.committed_date = committed_date
        self.summary = summary
        self.sha = sha

    def __str__(self):
        buf = [
            'Git Info:',
            '  Branch             : %s' % self.branch,
            '  Tags               : %s' % ', '.join(self.tags),
            '  Last Commit Author : %s <%s>' % (self.author_name, self.author_email),
            '  Last Commit Date   : %s' % self.committed_date,

            '  Last Commit Summary: %s' % self.summary,