Add consume_batch_id()
convenience method to sil.Writer
class.
This commit is contained in:
parent
a7992bc0a7
commit
0a32fe0e59
|
@ -34,6 +34,7 @@ from .._version import __version__
|
||||||
from ..core import Object
|
from ..core import Object
|
||||||
from ..gpc import GPC
|
from ..gpc import GPC
|
||||||
from rattail.files import temp_path
|
from rattail.files import temp_path
|
||||||
|
from rattail.sil import batches
|
||||||
|
|
||||||
|
|
||||||
__all__ = ['Writer']
|
__all__ = ['Writer']
|
||||||
|
@ -62,6 +63,12 @@ class Writer(Object):
|
||||||
kwargs.setdefault('suffix', '.sil')
|
kwargs.setdefault('suffix', '.sil')
|
||||||
return temp_path(**kwargs)
|
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):
|
def val(self, value):
|
||||||
"""
|
"""
|
||||||
Returns a string version of ``value``, suitable for inclusion within a
|
Returns a string version of ``value``, suitable for inclusion within a
|
||||||
|
|
Loading…
Reference in a new issue