Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add connection naming to startup pack #352

Closed
michael-conway opened this issue Jan 8, 2020 · 2 comments
Closed

add connection naming to startup pack #352

michael-conway opened this issue Jan 8, 2020 · 2 comments
Assignees
Milestone

Comments

@michael-conway
Copy link
Collaborator

in startup pack message buffer, look for rcConnect l 1100 startupPack.option

Think about a sig that allows 'naming' of a connection

@michael-conway
Copy link
Collaborator Author

michael-conway commented Aug 28, 2020

import contextlib
import time
import os
from irods.session import iRODSSession

@contextlib.contextmanager
def session(name_):
    try:
        env_file = os.environ['IRODS_ENVIRONMENT_FILE']
    except KeyError:
        env_file = os.path.expanduser('~/.irods/irods_environment.json')
    session = iRODSSession(irods_env_file=env_file, name = name_)   # <<< specify the app name here
    try:
        yield session
    finally:
        session.cleanup()
        print "cleanup"

if __name__ == '__main__':
    with session("myApp") as s:
        s.collections.get('/tempZone/home/alissa')
        time.sleep(15.0)

@korydraughn
Copy link
Collaborator

Resolved by #423 and #430.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants