Add GlyphData.date_added.
This commit is contained in:
parent
a3e930b879
commit
f31a74df60
1 changed files with 4 additions and 1 deletions
|
|
@ -16,6 +16,7 @@
|
||||||
|
|
||||||
import pickle
|
import pickle
|
||||||
from collections import OrderedDict
|
from collections import OrderedDict
|
||||||
|
from datetime import datetime
|
||||||
from os import path
|
from os import path
|
||||||
|
|
||||||
from .utils import cached_property
|
from .utils import cached_property
|
||||||
|
|
@ -23,12 +24,13 @@ from .image import Image
|
||||||
|
|
||||||
|
|
||||||
class GlyphData(object):
|
class GlyphData(object):
|
||||||
def __init__(self, image_data, elevation, text, bold=False, italic=False):
|
def __init__(self, image_data, elevation, text, bold=False, italic=False, date_added=None):
|
||||||
self.image_data = image_data
|
self.image_data = image_data
|
||||||
self.elevation = elevation
|
self.elevation = elevation
|
||||||
self.text = text
|
self.text = text
|
||||||
self.bold = bold
|
self.bold = bold
|
||||||
self.italic = italic
|
self.italic = italic
|
||||||
|
self.date_added = datetime.now() if date_added is None else date_added
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def from_glyph(cls, glyph, *args, **kwargs):
|
def from_glyph(cls, glyph, *args, **kwargs):
|
||||||
|
|
@ -49,6 +51,7 @@ class GlyphData(object):
|
||||||
self.text,
|
self.text,
|
||||||
self.bold,
|
self.bold,
|
||||||
self.italic,
|
self.italic,
|
||||||
|
self.date_added,
|
||||||
)
|
)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue