示例#1
0
def parseargs(pgm, argv):
    import getopt
    popts = {'all':False, 'company_id':None, 'team_id':None}
    try:
        (opts, args) = getopt.getopt(argv, 'ac:t:',
                ['all', 'company=', 'team='])
    except getopt.GetoptError, e:
        stderr(e)
        return (None, None)
示例#2
0
def do_teamroom(api, team_id, save_xml):
    if save_xml: save_xml='teamroom'
    stderr("write me!\n", func())
    return api.clean_exit(0)
示例#3
0
def do_company_teamrooms(api, companpany_id, save_xml):
    if save_xml: save_xml='company_teamrooms'
    stderr("write me!\n", func())
    return api.clean_exit(0)
示例#4
0
    import getopt
    popts = {'all':False, 'company_id':None, 'team_id':None}
    try:
        (opts, args) = getopt.getopt(argv, 'ac:t:',
                ['all', 'company=', 'team='])
    except getopt.GetoptError, e:
        stderr(e)
        return (None, None)

    for (key, val) in opts:
        if key == '-a' or key == '--all': popts['all'] = True
        elif key == '-c' or key == '--company': popts['company'] = to_str(val)
        elif key == '-t' or key == '--team': popts['team'] = to_str(val)
        else:
            e = "Error in parseargs code: option parsed by getopt not matched.\n"
            stderr(e)
            (popts, args) = (None, None)
    return (popts, args)

def do_get_teamrooms(api, save_xml):
    if save_xml: save_xml='get_teamrooms'
    all_rooms = get_teamrooms(api, save_xml=save_xml)
    for n in range(len(all_rooms)):
        room = all_rooms[n]
        hdr = '------ room {0:2d} ------\n'.format(n+1)
        stdout(hdr)
        print_dict(stdout, room)
        stdout('\n')
    api.clean_exit(0)

def do_company_teamrooms(api, companpany_id, save_xml):