# Path: dxfgrabber/juliandate.py
# def calendar_date(juliandate):
#     return CalendarDate(juliandate).result


from datetime import datetime
from .juliandate import calendar_date

__author__ = "mozman <mozman@gmx.at>"


class DXFObject(object):
    def __init__(self):
        self.dxftype = 'ENTITY'
        self.handle = None
        self.owner = None

    def setup_attributes(self, tags):
        self.dxftype = tags.get_type()
        for code, value in tags.plain_tags():
            if code == 5:   # special case 105 handled by STYLE TABLE
                self.handle = value
            elif code == 330:
                self.owner = value
            else:
                yield code, value  # chain of generators

def unpack_seconds(seconds):
    seconds = int(seconds / 1000)  # remove 1/1000 part
    hours   = int(seconds / 3600)
    seconds = int(seconds % 3600)
    minutes = int(seconds / 60)
    seconds = int(seconds % 60)
    return hours, minutes, seconds

class Sun(DXFObject):
    def __init__(self):
        super(Sun, self).__init__()

# Path: dxfgrabber/juliandate.py
# def calendar_date(juliandate):
#     return CalendarDate(juliandate).result


# Path: dxfgrabber/dxfobjects.py
from datetime import datetime
from .juliandate import calendar_date

__author__ = "mozman <mozman@gmx.at>"


class DXFObject(object):
    def __init__(self):
        self.dxftype = 'ENTITY'
        self.handle = None
        self.owner = None

    def setup_attributes(self, tags):
        self.dxftype = tags.get_type()
        for code, value in tags.plain_tags():
            if code == 5:   # special case 105 handled by STYLE TABLE
                self.handle = value
            elif code == 330:
                self.owner = value
            else:
                yield code, value  # chain of generators

def unpack_seconds(seconds):
    seconds = int(seconds / 1000)  # remove 1/1000 part
    hours   = int(seconds / 3600)
    seconds = int(seconds % 3600)
    minutes = int(seconds / 60)
    seconds = int(seconds % 60)
    return hours, minutes, seconds

class Sun(DXFObject):
    def __init__(self):
        super(Sun, self).__init__()

        self.version = 1
