forked from ome/omero-scripts
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request ome#1 from moisbo/master
Run scripts with environment variables
- Loading branch information
Showing
6 changed files
with
182 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
omero/annotation_scripts/cli_scripts/Parse_OMERO_Properties.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#!/usr/bin/env python2 | ||
# -*- coding: utf-8 -*- | ||
""" | ||
Created on Mon Nov 20 14:16:53 2017 | ||
@author: evenhuis | ||
FOR TRAINING PURPOSES ONLY! | ||
Change this file to Parse_OMERO_Properties.py and enter your ID/username | ||
""" | ||
|
||
import omero | ||
import os | ||
import sys | ||
|
||
try: | ||
omero_app_url = os.environ["OMERO_APP_URL"] | ||
omero_username = os.environ["OMERO_USERNAME"] | ||
omero_user_password = os.environ["OMERO_USER_PASSWORD"] | ||
except KeyError: | ||
print "Please set the environment variable OMERO_USERNAME, OMERO_USER_PASSWORD and OMERO_APP_URL" | ||
sys.exit(1) | ||
|
||
client = omero.client(omero_app_url) | ||
|
||
omeroProperties = client.getProperties().getPropertiesForPrefix('omero') | ||
|
||
# Configuration | ||
# ================================================================= | ||
# These values will be imported by all the other training scripts. | ||
HOST = omeroProperties.get('omero.host', omero_app_url) | ||
PORT = omeroProperties.get('omero.port', 4064) | ||
USERNAME = omeroProperties.get('omero.user', omero_username) | ||
PASSWORD = omeroProperties.get('omero.pass', omero_user_password) | ||
OMERO_WEB_HOST = omeroProperties.get('omero.webhost') | ||
SERVER_NAME = omeroProperties.get(omero_app_url) | ||
# projectId = omeroProperties.get('omero.projectid') | ||
# datasetId = omeroProperties.get('omero.datasetid') | ||
# imageId = omeroProperties.get('omero.imageid') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.