Skip to content

Instantly share code, notes, and snippets.

@j6k4m8
Created January 1, 2016 22:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save j6k4m8/fd34b5e0052793f2f869 to your computer and use it in GitHub Desktop.
Save j6k4m8/fd34b5e0052793f2f869 to your computer and use it in GitHub Desktop.
import ndio.remote.OCPMeta as ndlims
import ndio.remote.OCP as OCP
oo = OCP()
ndl = ndlims()
secret = ?????
species = {
'Mouse': 'M. musculus',
'Drosophila': 'D. melanogaster',
'Rat': 'R. rattus',
'Zebrafish': 'D. rerio',
'Worm': 'C. elegans'
}
tokens = oo.get_public_tokens()
for t in tokens:
info = ndl.get_metadata(t)
if 'species' in info:
target_species = species[info['species']] \
if info['species'] in species else info['species']
ndl.set_metadata(t, {
"secret": secret,
"species": target_species
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment