forked from RustPython/RustPython
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetting.rs
More file actions
119 lines (93 loc) · 2.69 KB
/
Copy pathsetting.rs
File metadata and controls
119 lines (93 loc) · 2.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
#[cfg(feature = "flame-it")]
use std::ffi::OsString;
/// Struct containing all kind of settings for the python vm.
#[non_exhaustive]
pub struct Settings {
/// -d command line switch
pub debug: bool,
/// -i
pub inspect: bool,
/// -i, with no script
pub interactive: bool,
/// -O optimization switch counter
pub optimize: u8,
/// Not set SIGINT handler(i.e. for embedded mode)
pub no_sig_int: bool,
/// -s
pub no_user_site: bool,
/// -S
pub no_site: bool,
/// -E
pub ignore_environment: bool,
/// verbosity level (-v switch)
pub verbose: u8,
/// -q
pub quiet: bool,
/// -B
pub dont_write_bytecode: bool,
/// -b
pub bytes_warning: u64,
/// -Xfoo[=bar]
pub xopts: Vec<(String, Option<String>)>,
/// -I
pub isolated: bool,
/// -Xdev
pub dev_mode: bool,
/// -X warn_default_encoding, PYTHONWARNDEFAULTENCODING
pub warn_default_encoding: bool,
/// -Wfoo
pub warnopts: Vec<String>,
/// Environment PYTHONPATH and RUSTPYTHONPATH:
pub path_list: Vec<String>,
/// sys.argv
pub argv: Vec<String>,
/// PYTHONHASHSEED=x
pub hash_seed: Option<u32>,
/// -u, PYTHONUNBUFFERED=x
// TODO: use this; can TextIOWrapper even work with a non-buffered?
pub stdio_unbuffered: bool,
/// --check-hash-based-pycs
pub check_hash_based_pycs: String,
/// false for wasm. Not a command-line option
pub allow_external_library: bool,
pub utf8_mode: u8,
#[cfg(feature = "flame-it")]
pub profile_output: Option<OsString>,
#[cfg(feature = "flame-it")]
pub profile_format: Option<String>,
}
/// Sensible default settings.
impl Default for Settings {
fn default() -> Self {
Settings {
debug: false,
inspect: false,
interactive: false,
optimize: 0,
no_sig_int: false,
no_user_site: false,
no_site: false,
ignore_environment: false,
verbose: 0,
quiet: false,
dont_write_bytecode: false,
bytes_warning: 0,
xopts: vec![],
isolated: false,
dev_mode: false,
warn_default_encoding: false,
warnopts: vec![],
path_list: vec![],
argv: vec![],
hash_seed: None,
stdio_unbuffered: false,
check_hash_based_pycs: "default".to_owned(),
allow_external_library: cfg!(feature = "importlib"),
utf8_mode: 1,
#[cfg(feature = "flame-it")]
profile_output: None,
#[cfg(feature = "flame-it")]
profile_format: None,
}
}
}