# 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 os
import time
import socket
import getpass
import dateutil.parser
        import hashlib
from datetime import datetime
from .baseinfo import BaseInfo
from artifactcli.util import *
        super(FileInfo, self).__init__(FileInfo.keys)
        self.host = host
        self.user = user
        self.size = size
        self.mtime = mtime
        self.md5 = md5

    def __str__(self):
        buf = [
            'File Info:',
            '  User    : %s@%s' % (self.user, self.host),
            '  Modified: %s' % self.mtime,
            '  Size    : %s (%s)' % (self.size, self.size_format()),
            '  MD5     : %s' % self.md5,
        ]
        return '\n'.join(buf)

    def to_dict(self):
        return {
            'host': self.host,
            'user': self.user,
            'size': self.size,
            'mtime': self.mtime.isoformat(),
            'hex_md5': self.md5
        }

    @staticmethod
    def from_path(path):
        host = socket.gethostname()
        user = getpass.getuser()

# 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/fileinfo.py
import os
import time
import socket
import getpass
import dateutil.parser
        import hashlib
from datetime import datetime
from .baseinfo import BaseInfo
from artifactcli.util import *

        super(FileInfo, self).__init__(FileInfo.keys)
        self.host = host
        self.user = user
        self.size = size
        self.mtime = mtime
        self.md5 = md5

    def __str__(self):
        buf = [
            'File Info:',
            '  User    : %s@%s' % (self.user, self.host),
            '  Modified: %s' % self.mtime,
            '  Size    : %s (%s)' % (self.size, self.size_format()),
            '  MD5     : %s' % self.md5,
        ]
        return '\n'.join(buf)

    def to_dict(self):
        return {
            'host': self.host,
            'user': self.user,
            'size': self.size,
            'mtime': self.mtime.isoformat(),
            'hex_md5': self.md5
        }

    @staticmethod
    def from_path(path):
        host = socket.gethostname()
        user = getpass.getuser()

        size = os.path.getsize(path)