@@ -54,11 +54,11 @@ We need a dataset in ICAT that the uploaded files should be put into,
54
54
so let's create one::
55
55
56
56
>>> from icat.query import Query
57
- >>> query = Query(client, "Investigation", conditions={ "name": "= '12100409-ST'"} )
57
+ >>> query = Query(client, "Investigation", conditions=[( "name", "= '12100409-ST'")] )
58
58
>>> investigation = client.assertedSearch(query)[0]
59
59
>>> dataset = client.new("Dataset")
60
60
>>> dataset.investigation = investigation
61
- >>> query = Query(client, "DatasetType", conditions={ "name": "= 'other'"} )
61
+ >>> query = Query(client, "DatasetType", conditions=[( "name", "= 'other'")] )
62
62
>>> dataset.type = client.assertedSearch(query)[0]
63
63
>>> dataset.name = "greetings"
64
64
>>> dataset.complete = False
@@ -67,7 +67,7 @@ so let's create one::
67
67
For each of the files, we create a new datafile object and call the
68
68
:meth: `~icat.client.Client.putData ` method to upload it::
69
69
70
- >>> query = Query(client, "DatafileFormat", conditions={ "name": "= 'Text'"} )
70
+ >>> query = Query(client, "DatafileFormat", conditions=[( "name", "= 'Text'")] )
71
71
>>> df_format = client.assertedSearch(query)[0]
72
72
>>> for fname in ("greet-jdoe.txt", "greet-nbour.txt", "greet-rbeck.txt"):
73
73
... datafile = client.new("Datafile",
@@ -131,10 +131,10 @@ Download files
131
131
We can request a download of a set of data using the
132
132
:meth: `~icat.client.Client.getData ` method::
133
133
134
- >>> query = Query(client, "Datafile", conditions={
135
- ... "name": "= 'greet-jdoe.txt'",
136
- ... "dataset.name": "= 'greetings'"
137
- ... } )
134
+ >>> query = Query(client, "Datafile", conditions=[
135
+ ... ( "name", "= 'greet-jdoe.txt'") ,
136
+ ... ( "dataset.name", "= 'greetings'"),
137
+ ... ] )
138
138
>>> df = client.assertedSearch(query)[0]
139
139
>>> data = client.getData([df])
140
140
>>> type(data)
@@ -153,7 +153,7 @@ with the requested files::
153
153
154
154
>>> from io import BytesIO
155
155
>>> from zipfile import ZipFile
156
- >>> query = Query(client, "Dataset", conditions={ "name": "= 'greetings'"} )
156
+ >>> query = Query(client, "Dataset", conditions=[( "name", "= 'greetings'")] )
157
157
>>> ds = client.assertedSearch(query)[0]
158
158
>>> data = client.getData([ds])
159
159
>>> buffer = BytesIO(data.read())
0 commit comments