Changeset - a13891e4f56c
[Not reviewed]
0 1 0
Lance Edgar (lance) - 12 years ago 2012-08-09 16:58:02
lance@edbob.org
tweak sil.write_batch_header()
1 file changed with 2 insertions and 2 deletions:
0 comments (0 inline, 0 general)
rattail/sil.py
Show inline comments
 
@@ -83,13 +83,13 @@ def consume_batch_id():
 
    config_file = open(config_path, 'w')
 
    config.write(config_file)
 
    config_file.close()
 
    return '%08u' % batch_id
 

	
 

	
 
def write_batch_header(fileobj, H01='HM', H03='RATAIL', **kwargs):
 
def write_batch_header(fileobj, H03='RATAIL', **kwargs):
 
    """
 
    Writes a SIL batch header string to ``fileobj``.  All keyword arguments
 
    correspond to the SIL specification for the Batch Header Dictionary.
 

	
 
    If you do not override ``H03`` (Source Identifier), then Rattail will
 
    provide defaults for ``H02`` (Batch Identifier) and ``H20`` (Software
 
@@ -135,13 +135,13 @@ def write_batch_header(fileobj, H01='HM', H03='RATAIL', **kwargs):
 
            H02 = consume_batch_id()
 
        if not H20:
 
            H20 = rattail.__version__[:4]
 

	
 
    kw = kwargs
 
    fileobj.write('INSERT INTO HEADER_DCT VALUES\n(' + ','.join((
 
                val(H01),
 
                val(kw.get('H01')),
 
                val(H02),
 
                val(H03),
 
                val(kw.get('H04')),
 
                val(kw.get('H05')),
 
                val(kw.get('H06')),
 
                val(kw.get('H07')),
0 comments (0 inline, 0 general)