def get_job_class(self, source):
    job_name = os.path.splitext(os.path.basename(source))[0]
    package = None
    job_class = None
    for l in open(source).readlines():
        p = re.search('package\\s+([^\\s\\(]+)', l)
        if p:
            package = p.groups()[0]
        p = re.search('class\\s+([^\\s\\(]+).*extends\\s+.*Job', l)
        if p:
            job_class = p.groups()[0]
            if (job_class == job_name):
                break
    if job_class:
        if package:
            job_class = ((package + '.') + job_class)
        logger.debug('Found scalding job class: %s', job_class)
        return job_class
    else:
        raise luigi.contrib.hadoop.HadoopJobError('Coudl not find scalding job class.')
def get_job_class(self, source):
    job_name = os.path.splitext(os.path.basename(source))[0]
    package = None
    job_class = None
    for l in open(source).readlines():
        p = re.search('package\\s+([^\\s\\(]+)', l)
        if p:
            package = p.groups()[0]
        p = re.search('class\\s+([^\\s\\(]+).*extends\\s+.*Job', l)
        if p:
            job_class = p.groups()[0]
            if (job_class == job_name):
                break
    if job_class:
        if package:
            job_class = ((package + '.') + job_class)
        logger.debug('Found scalding job class: %s', job_class)
        return job_class
    else:
        raise luigi.contrib.hadoop.HadoopJobError('Coudl not find scalding job class.')