Add consume_batch_id() convenience method to sil.Writer class.
				
					
				
			This commit is contained in:
		
							parent
							
								
									a7992bc0a7
								
							
						
					
					
						commit
						0a32fe0e59
					
				
					 1 changed files with 7 additions and 0 deletions
				
			
		|  | @ -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 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Lance Edgar
						Lance Edgar