Best Python code snippet using autotest_python
sphinx.py
Source:sphinx.py
...31 tasks = []32 if target == 'html' and not conf.runstate.fast:33 t = Task(job=html_tarball,34 args=(sconf.name, sconf.build_output, conf),35 target=[get_tarball_name('html', conf),36 get_tarball_name('link-html', conf)],37 dependency=None,38 description="creating tarball for html archive")39 tasks.append(t)40 elif target == 'dirhtml' and not conf.runstate.fast:41 # We're experiencing some cases were giza seemingly randomly doesn't migrate.42 # Log this to help us figure out what's going on.43 logger.info('Going to migrate {} to {}'.format(44 sconf.fq_build_output,45 os.path.join(conf.paths.projectroot, conf.paths.public_site_output)))46 for job in (finalize_dirhtml_build, error_pages):47 t = Task(job=job,48 args=(sconf, conf),49 target=os.path.join(conf.paths.projectroot, conf.paths.public_site_output),50 dependency=None)51 tasks.append(t)52 elif target == 'epub':53 t = Task(job=finalize_epub_build,54 args=(target, conf),55 description='finalizing epub build',56 dependency=None,57 target=True)58 tasks.append(t)59 elif target == 'man':60 t = Task(job=man_tarball,61 args=(sconf.name, sconf.build_output, conf),62 target=[get_tarball_name('man', conf),63 get_tarball_name('link-man', conf)],64 dependency=None,65 description="creating tarball for manpages")66 tasks.extend(manpage_url_tasks(target, conf))67 tasks.append(('final', t))68 elif target == 'slides' and not conf.runstate.fast:69 tasks.extend(slide_tasks(sconf, conf))70 elif target == 'json':71 json_tasks, transfer_op = json_output_tasks(conf)72 tasks.extend(json_tasks)73 tasks.append(('final', transfer_op)) # this is less than ideal74 elif target == 'singlehtml':75 tasks.extend(finalize_single_html_tasks(target, conf))76 elif target == 'latex':77 tasks.extend(pdf_tasks(sconf, conf))...
archives.py
Source:archives.py
...18import os19import logging20from giza.tools.files import create_link, tarball21logger = logging.getLogger('giza.content.post.archives')22def get_tarball_name(builder, conf):23 if builder == 'link-html':24 fn = conf.project.name + '.tar.gz'25 elif builder == 'link-man':26 fn = "manpages.tar.gz"27 elif builder == 'link-slides':28 fn = ''.join((conf.project.name, '-', 'slides', '.tar.gz'))29 elif builder.startswith('man'):30 fn = ''.join(('manpages', '-', conf.git.branches.current, '.tar.gz'))31 elif builder.startswith('html'):32 fn = ''.join((conf.project.name, '-', conf.git.branches.current, '.tar.gz'))33 else:34 fn = ''.join((conf.project.name, '-', conf.git.branches.current, builder, '.tar.gz'))35 if conf.project.edition != conf.project.name:36 fn = fn.replace(conf.project.name, '-'.join((conf.project.name, conf.project.edition)))37 return os.path.join(conf.paths.projectroot,38 conf.paths.public_site_output,39 fn)40def html_tarball(builder, artifact_loc, conf):41 tarball_name = get_tarball_name('html', conf)42 tarball(name=tarball_name,43 path=artifact_loc,44 cdir=os.path.join(conf.paths.projectroot,45 conf.paths.branch_output),46 newp=os.path.splitext(os.path.basename(tarball_name))[0])47 link_name = get_tarball_name('link-html', conf)48 if os.path.exists(link_name):49 os.remove(link_name)50 create_link(input_fn=os.path.basename(tarball_name),51 output_fn=link_name)52def slides_tarball(builder, artifact_loc, conf):53 tarball_name = get_tarball_name('slides', conf)54 tarball(name=tarball_name,55 path=artifact_loc,56 cdir=os.path.join(conf.paths.projectroot,57 conf.paths.branch_output),58 newp=os.path.splitext(os.path.basename(tarball_name))[0])59 link_name = get_tarball_name('link-slides', conf)60 if os.path.exists(link_name):61 os.remove(link_name)62 create_link(input_fn=os.path.basename(tarball_name),63 output_fn=link_name)64def man_tarball(builder, artifact_loc, conf):65 tarball_name = get_tarball_name('man', conf)66 tarball(name=tarball_name,67 path=artifact_loc,68 cdir=os.path.join(conf.paths.projectroot, conf.paths.branch_output),69 newp=conf.project.name + '-manpages')70 link_name = get_tarball_name('link-man', conf)71 if os.path.exists(link_name):72 os.remove(link_name)73 create_link(input_fn=os.path.basename(tarball_name),...
slides.py
Source:slides.py
...42 except subprocess.CalledProcessError:43 logger.error('issue deploying slides to local staging')44def slide_tasks(sconf, conf):45 return [giza.libgiza.task.Task(job=slides_tarball,46 target=[get_tarball_name('slides', conf),47 get_tarball_name('link-slides', conf)],48 args=(sconf.name, sconf.build_output, conf),49 description="creating tarball for slides"),50 giza.libgiza.task.Task(job=slides_output,51 args=[conf],...
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!