Skip to content

Commit

Permalink
Default Executor.version to "*"
Browse files Browse the repository at this point in the history
Use lowercase language names
  • Loading branch information
Jonxslays committed Dec 9, 2021
1 parent 4fff5a0 commit 5ccac13
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions piston_rspy/piston_rspy.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ class Executor:
Args:
language: `str` = ""
The language to use for execution.
version: `str` = ""
version: `str` = "*"
The version of the language to use for execution.
files: `list[File]` = []
A list of files to send to Piston. The first file in the
Expand All @@ -224,7 +224,7 @@ class Executor:
"""

language: str = ""
version: str = ""
version: str = "*"
files: list[File] = field(default_factory=list)
stdin: str = ""
args: list[str] = field(default_factory=list)
Expand Down
8 changes: 4 additions & 4 deletions src/executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ impl ExecResponse {
#[pyclass]
#[derive(Clone)]
#[pyo3(
text_signature = "(language: str = \"\", version: str = \"\", files: list[File] = [], stdin: str = \"\", args: list[str] = [], compile_timeout: int = 10000, run_timeout: int = 3000, compile_memory_limit: int = -1, run_memory_limit: int = -1, /) -> Executor"
text_signature = "(language: str = \"\", version: str = \"*\", files: list[File] = [], stdin: str = \"\", args: list[str] = [], compile_timeout: int = 10000, run_timeout: int = 3000, compile_memory_limit: int = -1, run_memory_limit: int = -1, /) -> Executor"
)]
pub struct Executor {
inner: Executor_,
Expand Down Expand Up @@ -241,7 +241,7 @@ impl Executor {
#[new]
#[args(
language = "\"\".to_string()",
version = "\"\".to_string()",
version = "\"*\".to_string()",
files = "vec![]",
stdin = "\"\".to_string()",
args = "vec![]",
Expand Down Expand Up @@ -285,7 +285,7 @@ impl Executor {

#[setter(language)]
fn language_setter(&mut self, language: String) {
self.inner.language = language;
self.inner.language = language.to_lowercase();
}

/// `str`: The version of the language to use for execution.
Expand Down Expand Up @@ -414,7 +414,7 @@ impl Executor {
/// - `Executor`: The executor, for chained method calls.
#[pyo3(text_signature = "(self, language: str, /) -> Executor")]
fn set_language(mut slf: PyRefMut<Self>, language: String) -> PyRefMut<Self> {
slf.inner.language = language;
slf.inner.language = language.to_lowercase();
slf
}

Expand Down

0 comments on commit 5ccac13

Please sign in to comment.