[ome-devel] Python import API

Niko Ehrenfeuchter nikolaus.ehrenfeuchter at unibas.ch
Tue Mar 1 14:01:43 GMT 2016


Hi Colin,

On 29.02.2016 18:56, Colin Blackburn (Staff) wrote:

[...]

>> Does 5.2.2 expose the ID via its Python API already?
>
> Have you looked at some of our Python integrations tests, for example:
>
> <https://github.com/openmicroscopy/openmicroscopy/blob/develop/components/tools/OmeroPy/test/integration/clitest/test_import.py#L674>

indeed, I already looked at this code some weeks ago...

> Here we capture the stdout and stderr. The Pixels IDs are in stdout
> (just the IDs each on a new line), for example:
>
>> 9
> 10
> 11
> 12
> "
>
> And the Image IDs can be parsed from stderr, which is, for example:
>
>> Imported pixels:
> Other imported objects:
> Fileset:6
> Image:9
> Image:10
> Image:11
> Image:12
>>
> Is this the sort of thing you are after or are you looking at getting
> these IDs at some other point in your workflow?

This is kind of the thing I am after, yes. I was just wondering if it 
didn't make sense to have this "officially" supported / exposed via the 
API, instead of everyone having to write their own code to carve out the 
desired information from stdout/stderr - which feels quite a bit wiggly, 
especially as I don't necessarily consider "console output" as being an 
"API stable" format, right?

Plus, the referenced code is using the "capfd" fixture for the tests, 
which probably isn't a good idea in a non-testing environment. Meaning 
again custom code which has to be written "client side" to capture the 
outputs, not unlikely resulting in bugs, from time to time.

Basically, I'm wondering if there is no proper (TM) way using all the 
Ice'ish magic to "cleanly" retrieve this information ;-)

Thanks,
Niko


More information about the ome-devel mailing list