Sets the root save directory for saving screenshots.
    
    Screenshots will be saved in subdirectories under this directory by
    browser window size.
497009
def set_save_directory(base, source):
    
    root = os.path.join(base, source)
    if not os.path.isdir(root):
        os.makedirs(root)

    world.screenshot_root = root
701996
def _save_settings(self):
        
        if self._autosettings_path == None: return
        
        # Get the gui settings directory
        gui_settings_dir = _os.path.join(_cwd, 'egg_settings')

        # make sure the directory exists
        if not _os.path.exists(gui_settings_dir): _os.mkdir(gui_settings_dir)

        # make a path with a sub-directory
        path = _os.path.join(gui_settings_dir, self._autosettings_path)
        
        # Create a Qt settings object
        settings = _g.QtCore.QSettings(path, _g.QtCore.QSettings.IniFormat)
        settings.clear()
        
        # Save values
        if hasattr_safe(self._window, "saveState"):
            settings.setValue('State',self._window.saveState())
        settings.setValue('Geometry', self._window.saveGeometry())
644116
def set_roots(self, uproot_with=None):
        ''' 

        '''

        # Check for TREE_DIR
        self.treedir = os.environ.get('TREE_DIR', None) if not uproot_with else uproot_with
        if not self.treedir:
            treefilepath = os.path.dirname(os.path.abspath(__file__))
            if 'python/' in treefilepath:
                self.treedir = treefilepath.rsplit('/', 2)[0]
            else:
                self.treedir = treefilepath
            self.treedir = treefilepath
            os.environ['TREE_DIR'] = self.treedir

        # Check sas_base_dir
        if 'SAS_BASE_DIR' in os.environ:
            self.sasbasedir = os.environ["SAS_BASE_DIR"]
        else:
            self.sasbasedir = os.path.expanduser('~/sas')

        # make the directories
        if not os.path.isdir(self.sasbasedir):
            os.makedirs(self.sasbasedir)
1344708
public void setSiteRoot(String siteRoot) {

        // site roots must never end with a "/"
        if (siteRoot.endsWith("/")) {
            m_siteRoot = siteRoot.substring(0, siteRoot.length() - 1);
        } else {
            m_siteRoot = siteRoot;
        }
    }
347303
public Step withScreenshots(java.util.Map<String, String> screenshots) {
        setScreenshots(screenshots);
        return this;
    }
561478
def set_root_path(self, root_path):
        """"""
        if self.name is None:
            self.name = osp.basename(root_path)
        self.root_path = to_text_string(root_path)
        config_path = self.__get_project_config_path()
        if osp.exists(config_path):
            self.load()
        else:
            if not osp.isdir(self.root_path):
                os.mkdir(self.root_path)
            self.save()
171750
private void silentlySaveScreenshotTo(final File file) {
		try {
			saveScreenshotTo(file);
			LOG.info("Screenshot saved: " + file.getAbsolutePath());
		} catch (Exception e) {
			LOG.warn("Error while taking screenshot " + file.getName() + ": "
					+ e);
		}
	}
54866
def _set_up_savefolder(self):
        
        if not os.path.isdir(self.cells_path):
            os.mkdir(self.cells_path)

        if not os.path.isdir(self.figures_path):
            os.mkdir(self.figures_path)

        if not os.path.isdir(self.populations_path):
            os.mkdir(self.populations_path)
1349545
public static function setScanDir()
    {
        if (!getenv("BARTLETT_SCAN_DIR")) {
            $home = defined('PHP_WINDOWS_VERSION_BUILD') ? 'USERPROFILE' : 'HOME';
            $dirs = array(
                realpath('.'),
                getenv($home) . DIRECTORY_SEPARATOR . '.config',
                DIRECTORY_SEPARATOR . 'etc',
            );
            putenv("BARTLETT_SCAN_DIR=" . implode(PATH_SEPARATOR, $dirs));
        }
    }
1320874
public void setDirectory( File file ) {

		List<File> roots = null;
		if( file == null ) {
			// Create a list of roots with something in them.  Windows list to list non-existant devices
			roots = new ArrayList<>(Arrays.asList(File.listRoots()));
			for (int i = roots.size()-1; i >= 0; i--) {
				File[]files = roots.get(i).listFiles();
				if( files == null || files.length == 0) {
					roots.remove(i);
				}
			}

			if( roots.size() == 1 ) {
				file = roots.get(0);
				roots = null;
			}
		}

		if( roots == null ) {
			setDirectoryNormal(file);
		} else {
			// Present the user with a list of file system roots
			fileName.setText("");

			listModel.clear();
			for (File f : roots) {
				listModel.addElement(f);
			}

			directoryPath.removeActionListener(directoryListener);
			directoryPath.removeAllItems();
			directoryPath.addActionListener(directoryListener);

			listener.handleSelectedFile(null);
		}
	}
1293683
public void saveScreenshotAfterInFolder(String policy, String baseDir) throws IOException {
		screenCapture.setScreenshotBaseDir(removeAnchorTag(baseDir));
		saveScreenshotAfter(policy);
	}
1120817
def root_directory(self):
        
        if not QgsApplication.qgisSettingsDirPath() or (
                QgsApplication.qgisSettingsDirPath() == ''):
            self._root_directory = None
        else:
            # noinspection PyArgumentList
            self._root_directory = os.path.join(
                QgsApplication.qgisSettingsDirPath(),
                'inasafe')

        return self._root_directory
850664
def set_screen_saver(self, timeout, interval, prefer_blank, allow_exposures, onerror = None):
        """"""
        request.SetScreenSaver(display = self.display,
                               onerror = onerror,
                               timeout = timeout,
                               interval = interval,
                               prefer_blank = prefer_blank,
                               allow_exposures = allow_exposures)
1100089
def save_as_png(self, filename, width=300, height=250, render_time=1):
        """"""
        self.driver.set_window_size(width, height)
        self.driver.get('file://{path}/{filename}'.format(
            path=os.getcwd(), filename=filename + ".html"))
        time.sleep(render_time)
        self.driver.save_screenshot(filename + ".png")
204907
public void setSrcdir(Path srcDir) {
        if (src == null) {
            src = srcDir;
        } else {
            src.append(srcDir);
        }
    }
1208558
def init_dirs(main_dir: Path, logfilepath: Path):
    
    global MAIN_DIR, TEMP_DIR, DOWNLOAD_DIR, SAVESTAT_DIR, LOGFILE_PATH
    MAIN_DIR = main_dir
    TEMP_DIR = MAIN_DIR.joinpath(Path('temp/'))
    DOWNLOAD_DIR = MAIN_DIR.joinpath(Path('downloads/'))
    SAVESTAT_DIR = MAIN_DIR.joinpath(Path('savestates/'))
    LOGFILE_PATH = MAIN_DIR.joinpath(logfilepath)
1075308
def save_screenshot(self, name, folder=None):
        
        return page_actions.save_screenshot(self.driver, name, folder)