Example #1
0
def create_job_folder(suffix):
    """Prepare output folder."""
    ensure_run_folder()
    crawl_name = "%s%s" % (strftime("%Y%m%d-%H%M%S"), suffix)
    output_dir = join(cm.BASE_JOBS_DIR, crawl_name)
    mkdir(output_dir)
    fu.add_symlink(join(cm.BASE_JOBS_DIR, 'latest'), output_dir)
    return output_dir, crawl_name
Example #2
0
def create_job_folder(suffix):
    """Prepare output folder."""
    ensure_run_folder()
    crawl_name = "%s%s" % (strftime("%Y%m%d-%H%M%S"), suffix)
    output_dir = join(cm.BASE_JOBS_DIR, crawl_name)
    mkdir(output_dir)
    fu.add_symlink(join(cm.BASE_JOBS_DIR, 'latest'), output_dir)
    return output_dir, crawl_name
 def test_add_symlink(self):
     test_link = self.new_temp_file('test_link')
     src_file = self.new_temp_file('linktest.txt')
     fu.write_to_file(src_file, "link test")
     fu.add_symlink(test_link, src_file)
     self.failUnless(os.path.lexists(test_link))