示例#1
0
def user_info(api, company, team, user_email=None, user_id=None,
                                            user_ref=None, user_name=None):
    iam = func()
    if not (user_email or user_id or user_ref or user_name):
        stderr('Missing required parameter- one of email, id, ref, name\n', iam)
        return None
    (reference, status) = find_team(api, company, team)
    if not reference:
        return None
    kwargs = {'status':'active'}
    request = ['provider__id', 'provider__reference', 'job__reference']
    engagements = team_engagements(api, team, request=request, kwargs=kwargs)
    request = []
示例#2
0
       weekly_salary_pay_amount, weekly_stipend_hours"

        For example: -r 'provider__id, reference'

        Default is to return all of the above.
"""
(pgm, ext) = path.splitext(path.basename(sys.argv[0]))
(api, argv) = app_main(pgm, sys.argv[1:], usage)
(popts, args) = parse_request(pgm, argv, usage)
if not len(args) == 1:
    stderr ("\n  ** Need a 'team name' **, quoted if needed.\n")
    api.clean_exit(usage_tail(pgm, usage, 1))
team = args[0]
if popts['request']:
    req = strip_csv(popts['request'])
    request = req.split(',')
else:
    request=None
kwargs = {'status': 'active', 'save_xml':api.debug}
engagements = team_engagements(api, team, request=request,**kwargs)
if not engagements:
    stderr('failed to fetch team engagement list\n')
    api.clean_exit(1)
hdr = '----- Engagement {0:n}  ----\n'
for n in range(len(engagements)):
    header = hdr.format(n+1)
    e = engagements[n]
    stdout(header)
    print_dict(stdout, e)
api.clean_exit(0)