Add consume_batch_id() convenience method to sil.Writer class.

This commit is contained in:
Lance Edgar 2014-11-18 19:32:55 -06:00
parent a7992bc0a7
commit 0a32fe0e59

View file

@ -34,6 +34,7 @@ from .._version import __version__
from ..core import Object
from ..gpc import GPC
from rattail.files import temp_path
from rattail.sil import batches
__all__ = ['Writer']
@ -62,6 +63,12 @@ class Writer(Object):
kwargs.setdefault('suffix', '.sil')
return temp_path(**kwargs)
def consume_batch_id(self, source='RATAIL'):
"""
Consume and return a SIL-compatible batch ID.
"""
return batches.consume_batch_id(source)
def val(self, value):
"""
Returns a string version of ``value``, suitable for inclusion within a