def config_tempdir(tmpdir, template_db): os.environ['OT_API_CONFIG_DIR'] = str(tmpdir) config.reload() if not os.path.exists(config.CONFIG['labware_database_file']): shutil.copyfile( template_db, config.CONFIG['labware_database_file']) yield tmpdir, template_db
def config_tempdir(tmpdir): os.environ['OT_API_CONFIG_DIR'] = str(tmpdir) config.reload() old_db_path = database.database_path shutil.copyfile(database.database_path, config.CONFIG['labware_database_file']) database.change_database(str(config.CONFIG['labware_database_file'])) yield tmpdir, old_db_path
def ot_config_tempdir(tmpdir): os.environ['OT_API_CONFIG_DIR'] = str(tmpdir) config.reload() yield tmpdir del os.environ['OT_API_CONFIG_DIR'] config.reload()
def labware_offset_tempdir(tmpdir): os.environ['OT_API_CONFIG_DIR'] = str(tmpdir) config.reload() yield config.get_opentrons_path('labware_calibration_offsets_dir_v2') del os.environ['OT_API_CONFIG_DIR'] config.reload()
def server_temp_directory(): new_dir = tempfile.mkdtemp() os.environ['OT_API_CONFIG_DIR'] = new_dir config.reload() yield new_dir shutil.rmtree(new_dir) del os.environ['OT_API_CONFIG_DIR']
def offsets_tempdir(tmpdir, template_db): config.CONFIG['labware_calibration_offsets_dir_v2'] = str(tmpdir) config.reload() yield tmpdir
def index_file_dir(tmpdir): config.CONFIG['labware_calibration_offsets_dir_v2'] = tmpdir # config.reload() yield tmpdir config.reload()