Project

General

Profile

« Previous | Next » 

Revision 1692

digir_client: Made chunk_size a configurable env var. Removed schema env var because schema is always the same for DiGIR (can be different for TAPIR). Make sure output ends in a newline so that consecutive XML documents are on different lines.

View differences:

digir_client
19 19

  
20 20
# Config
21 21
timeout = 20 # sec
22
chunk_size = 10000 # records
23
default_schema = 'http://digir.net/schema/conceptual/darwin/full/2003/1.0/darwin2full.xsd'
22
default_chunk_size = 10000 # records
24 23

  
24
schema = 'http://digir.net/schema/conceptual/darwin/full/2003/1.0/darwin2full.xsd'
25 25
request_xml_template = '''\
26 26
<?xml version="1.0" encoding="UTF-8"?>
27 27
<request
......
71 71
    # Get config from env vars
72 72
    url = opts.get_env_var('url', None, env_names)
73 73
    resource = opts.get_env_var('resource', None, env_names)
74
    schema = opts.get_env_var('schema', default_schema, env_names)
75 74
    start = util.cast(int, opts.get_env_var('start', 0, env_names))
76 75
    count = util.cast(int, opts.get_env_var('n', None, env_names))
76
    chunk_size = util.cast(int, opts.get_env_var('chunk_size',
77
        default_chunk_size, env_names))
77 78
    debug = opts.env_flag('debug', False, env_names)
78 79
    if url == None or resource == None: usage_err()
79 80
    
......
124 125
        
125 126
        # Retrieve response
126 127
        streams.copy(stream, sys.stdout)
128
        # Make sure output ends in a newline so that consecutive XML documents
129
        # are on different lines
130
        sys.stdout.write('\n')
127 131
        stream.close()
128 132
        
129 133
        # Parse diagnostics

Also available in: Unified diff