forked from devlive-community/codeforge
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpython3.rs
More file actions
42 lines (34 loc) · 1023 Bytes
/
python3.rs
File metadata and controls
42 lines (34 loc) · 1023 Bytes
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
use super::{LanguagePlugin, PluginConfig};
pub struct Python3Plugin;
impl LanguagePlugin for Python3Plugin {
fn get_order(&self) -> i32 {
2
}
fn get_language_name(&self) -> &'static str {
"Python 3"
}
fn get_language_key(&self) -> &'static str {
"python3"
}
fn get_version_args(&self) -> Vec<&'static str> {
vec!["--version"]
}
fn get_path_command(&self) -> String {
"import sys; print(sys.executable)".to_string()
}
fn get_default_config(&self) -> PluginConfig {
PluginConfig {
enabled: true,
language: String::from("python3"),
before_compile: None,
extension: String::from("py"),
execute_home: None,
run_command: Option::from(String::from("python3 $filename")),
after_compile: None,
template: None,
}
}
fn get_default_command(&self) -> String {
self.get_config().unwrap().run_command.unwrap()
}
}