Skip to content

Commit fe1892b

Browse files
committed
feat (python): 移除代码预处理操作
1 parent 38459aa commit fe1892b

3 files changed

Lines changed: 8 additions & 16 deletions

File tree

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1-
# CodeForge
1+
<div align="center">
2+
<img src="public/codeforge.svg" width=100 />
3+
4+
<h1 style="margin-top: -20px;">CodeForge</h1>
25

36
CodeForge 是一款轻量级、高性能的桌面代码执行器,专为开发者、学生和编程爱好者设计。
7+
</div>
48

59
## 特性
610

src-tauri/src/plugins/python2.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,7 @@ impl LanguagePlugin for Python2Plugin {
3232
}
3333

3434
fn pre_execute_hook(&self, code: &str) -> Result<String, String> {
35-
// 添加一些 Python 特定的预处理
36-
let processed_code = format!(
37-
"# CodeForge Python 2 Execution\n# Generated at: {}\n\n{}",
38-
chrono::Utc::now().format("%Y-%m-%d %H:%M:%S UTC"),
39-
code
40-
);
41-
Ok(processed_code)
35+
Ok(code.to_string())
4236
}
4337

4438
fn post_execute_hook(&self, result: &mut ExecutionResult) -> Result<(), String> {

src-tauri/src/plugins/python3.rs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ impl LanguagePlugin for Python3Plugin {
66
fn get_order(&self) -> i32 {
77
2
88
}
9-
9+
1010
fn get_language_name(&self) -> &'static str {
1111
"Python 3"
1212
}
@@ -32,13 +32,7 @@ impl LanguagePlugin for Python3Plugin {
3232
}
3333

3434
fn pre_execute_hook(&self, code: &str) -> Result<String, String> {
35-
// 添加一些 Python 特定的预处理
36-
let processed_code = format!(
37-
"# CodeForge Python 3 Execution\n# Generated at: {}\n\n{}",
38-
chrono::Utc::now().format("%Y-%m-%d %H:%M:%S UTC"),
39-
code
40-
);
41-
Ok(processed_code)
35+
Ok(code.to_string())
4236
}
4337

4438
fn post_execute_hook(&self, result: &mut ExecutionResult) -> Result<(), String> {

0 commit comments

Comments
 (0)