Esempio n. 1
0
def parse_request(pgm, argv, usage):
    import getopt
    popts = {'request':None}
    try:
        (opts, args) = getopt.getopt(argv, 'r:',['request='])
    except getopt.GetoptError, e:
        stderr(e) 
        usage_tail(pgm, usage, 1)
        return (None, None)
Esempio n. 2
0
 def parseargs(pgm, argv, usage):
     try:
         (opts, args) = getopt.getopt(argv, 's:j:f:o:xt',
         ['since=', 'job-category=', 'filters=', 'out=', 'xml', 'text'])
     except getopt.GetoptError, e:
         stderr(e)
         return usage_tail(pgm, usage, None)
Esempio n. 3
0
         company_name, created_by, created_by_name, created_time, description,
         duration, end_date, filled_date, id, job_type, name,
         num_active_candidates, num_candidates, num_new_candidates,
         owner_user_id, parent_team__id, parent_team__name,
         parent_team__reference, public_url, reference, start_date, status,
         subcategory, title, visibility"

         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 popts is None: api.clean_exit(1)
if not args or not len(args) == 2:
    stderr ("\n  **Need 'company name' 'team name' **, quoted if needed.\n")
    api.clean_exit(usage_tail(pgm, usage, 1))
company = args[0]
team = args[1]
if popts['request']:
    req = strip_csv(popts['request'])
    request =  req.split(',')
else:
    request = None
(total, joblist) = jobs_managed(api, company, team, request=request,
                                                            save_xml=api.debug)
if total == 0:
    stderr("No jobs currently managed by {0:s}\n".format(company))
    api.clean_exit(0)
hdr = '----- Job {0:2d} of {1:d} ----\n'
for n in range(total):
    header = hdr.format(n+1, total)