forked from RustPython/RustPython
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplatform.rs
More file actions
36 lines (29 loc) · 868 Bytes
/
platform.rs
File metadata and controls
36 lines (29 loc) · 868 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
pub(crate) use decl::make_module;
#[pymodule(name = "platform")]
mod decl {
use crate::vm::{version, VirtualMachine};
#[pyfunction]
fn python_implementation(_vm: &VirtualMachine) -> String {
"RustPython".to_owned()
}
#[pyfunction]
fn python_version(_vm: &VirtualMachine) -> String {
version::get_version_number()
}
#[pyfunction]
fn python_compiler(_vm: &VirtualMachine) -> String {
version::get_compiler()
}
#[pyfunction]
fn python_build(_vm: &VirtualMachine) -> (String, String) {
(version::get_git_identifier(), version::get_git_datetime())
}
#[pyfunction]
fn python_branch(_vm: &VirtualMachine) -> String {
version::get_git_branch()
}
#[pyfunction]
fn python_revision(_vm: &VirtualMachine) -> String {
version::get_git_revision()
}
}