#[cfg(feature = "flame-it")]
use std::ffi::OsString;
#[non_exhaustive]
pub struct Settings {
pub isolated: bool,
pub dev_mode: bool,
pub install_signal_handlers: bool,
pub hash_seed: Option<u32>,
pub argv: Vec<String>,
pub xoptions: Vec<(String, Option<String>)>,
pub warnoptions: Vec<String>,
pub import_site: bool,
pub bytes_warning: u64,
pub warn_default_encoding: bool,
pub inspect: bool,
pub interactive: bool,
pub write_bytecode: bool,
pub verbose: u8,
pub quiet: bool,
pub user_site_directory: bool,
pub buffered_stdio: bool,
pub utf8_mode: u8,
pub check_hash_pycs_mode: String,
pub safe_path: bool,
pub int_max_str_digits: i64,
pub path_list: Vec<String>,
pub debug: bool,
pub optimize: u8,
pub ignore_environment: bool,
pub allow_external_library: bool,
#[cfg(feature = "flame-it")]
pub profile_output: Option<OsString>,
#[cfg(feature = "flame-it")]
pub profile_format: Option<String>,
}
impl Settings {
pub fn with_path(mut self, path: String) -> Self {
self.path_list.push(path);
self
}
}
impl Default for Settings {
fn default() -> Self {
Settings {
debug: false,
inspect: false,
interactive: false,
optimize: 0,
install_signal_handlers: true,
user_site_directory: true,
import_site: true,
ignore_environment: false,
verbose: 0,
quiet: false,
write_bytecode: true,
safe_path: false,
bytes_warning: 0,
xoptions: vec![],
isolated: false,
dev_mode: false,
warn_default_encoding: false,
warnoptions: vec![],
path_list: vec![],
argv: vec![],
hash_seed: None,
buffered_stdio: true,
check_hash_pycs_mode: "default".to_owned(),
allow_external_library: cfg!(feature = "importlib"),
utf8_mode: 1,
int_max_str_digits: 4300,
#[cfg(feature = "flame-it")]
profile_output: None,
#[cfg(feature = "flame-it")]
profile_format: None,
}
}
}