Skip to content

Commit

Permalink
Refactor folder structure, fixed gitignores and added some tests
Browse files Browse the repository at this point in the history
  • Loading branch information
0xCAB0 committed Jan 12, 2024
1 parent b3033d1 commit f52b02b
Show file tree
Hide file tree
Showing 12 changed files with 496 additions and 426 deletions.
31 changes: 24 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,28 @@
dist
.env
useful_info+scripts+TODO.md
multiplepdf

# javaScript
dist

# python
tests.ipynb
gulagcleaner.egg-info
gulagcleaner/__pycache__
target
useful_info+scripts+TODO.md
.env
__pycache__
.venv
python/gulagcleaner/__pycache__
*.pyd
*.pyd

#rust

debug/
target/

# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
Cargo.lock

# These are backup files generated by rustfmt
**/*.rs.bk

# MSVC Windows builds of rustc generate these, which store debugging information
*.pdb
7 changes: 3 additions & 4 deletions gulagcleaner_python/rust/lib.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
use pyo3::prelude::*;

#[pyfunction]
pub fn clean_pdf(data: Vec<u8>,force_naive: u8) -> PyResult<(Vec<u8>,u8)> {
let (clean_pdf,method_code) = gulagcleaner_rs::clean_pdf(data, force_naive);
Ok((clean_pdf,method_code))
pub fn clean_pdf(data: Vec<u8>, force_naive: bool) -> PyResult<(Vec<u8>, u8)> {
let (clean_pdf, method_code) = gulagcleaner_rs::clean_pdf(data, force_naive);
Ok((clean_pdf, method_code))
}

#[pymodule]
fn _lib(_py: Python, m: &PyModule) -> PyResult<()> {
m.add_function(wrap_pyfunction!(clean_pdf, m)?)?;
Ok(())
}

2 changes: 2 additions & 0 deletions gulagcleaner_rs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Cargo.lock
example_docs/out
Binary file added gulagcleaner_rs/example_docs/studocu-example.pdf
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit f52b02b

Please sign in to comment.