Did I find the right examples for you? yes no

All Samples(4)  |  Call(0)  |  Derive(0)  |  Import(4)
Request authentication information from the user,
make the authentication request, and
write the credentials to the specified configuration file.

        def login(base_url="https://winkapi.quirky.com", config_file="config.cfg"):
    """
    Request authentication information from the user,
    make the authentication request, and
    write the credentials to the specified configuration file.
    """

    auth_info = dict(
        base_url=base_url,
    )

    # request information from the user
    for k in [
        "client_id",
        "client_secret",
        "username",
        "password",
    ]:
        auth_info[k] = raw_input("%s? " % k)

    try:
        auth_result = auth(**auth_info)
    except RuntimeError as e:
        print "Authentication failed. :("
        print e
    else:
        print "Authentication success! ;-)"

        cf = ConfigFile(config_file)
        cf.save(auth_result)
        


src/t/k/tk-core-HEAD/python/tank/context.py   tk-core(Download)
from tank_vendor import yaml
 
from .util import login
from .util import shotgun_entity
from .util import shotgun

src/t/k/tk-core-HEAD/python/tank/folder/folder_types.py   tk-core(Download)
 
from ..util import shotgun_entity
from ..util import login
from ..errors import TankError
 

src/t/k/tk-core-HEAD/python/tank/pipelineconfig.py   tk-core(Download)
from .platform.environment import Environment
from .util import shotgun
from .util import login
from . import hook
from . import template_includes