diff options
author | Niklas Lindström <lindstream@gmail.com> | 2013-10-22 13:03:56 +0200 |
---|---|---|
committer | Niklas Lindström <lindstream@gmail.com> | 2013-10-22 13:03:56 +0200 |
commit | c884b85df2aec1a5f8e15f96c7f71b1c5750cd1a (patch) | |
tree | 69d3eca0a01139f249b9a506e8defb2de5501001 /rdflib/tools | |
parent | 616f37e4b1b4ae977c3c870e0fe1a2964d92b0d5 (diff) | |
download | rdflib-c884b85df2aec1a5f8e15f96c7f71b1c5750cd1a.tar.gz |
Allow colon in rdfpipe format kwargs and base as kw
Diffstat (limited to 'rdflib/tools')
-rw-r--r-- | rdflib/tools/rdfpipe.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/rdflib/tools/rdfpipe.py b/rdflib/tools/rdfpipe.py index 8e7dbb06..df15d13e 100644 --- a/rdflib/tools/rdfpipe.py +++ b/rdflib/tools/rdfpipe.py @@ -49,8 +49,8 @@ def parse_and_serialize(input_files, input_format, guess, if outfile: output_format, kws = _format_and_kws(output_format) - graph.serialize( - destination=outfile, format=output_format, base=None, **kws) + kws.setdefault('base', None) + graph.serialize(destination=outfile, format=output_format, **kws) if store: store.rollback() @@ -68,10 +68,12 @@ def _format_and_kws(fmt): ('fmt', {'a': True, 'b': False}) >>> _format_and_kws("fmt:c=d") ('fmt', {'c': 'd'}) + >>> _format_and_kws("fmt:a=b:c") + ('fmt', {'a': 'b:c'}) """ fmt, kws = fmt, {} if fmt and ':' in fmt: - fmt, kwrepr = fmt.split(':') + fmt, kwrepr = fmt.split(':', 1) for kw in kwrepr.split(','): if '=' in kw: k, v = kw.split('=') |