Skip to content

Commit

Permalink
Remove pub from python bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
AngheloAlf committed Aug 9, 2024
1 parent f21c540 commit 030cc73
Show file tree
Hide file tree
Showing 8 changed files with 57 additions and 57 deletions.
16 changes: 8 additions & 8 deletions src/rs/file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ pub(crate) mod python_bindings {
#[pymethods]
impl super::File {
#[new]
pub fn py_new(
fn py_new(
filepath: PathBuf,
vram: u64,
size: u64,
Expand Down Expand Up @@ -370,7 +370,7 @@ pub(crate) mod python_bindings {
*/

#[getter]
pub fn isNoloadSection(&self) -> bool {
fn isNoloadSection(&self) -> bool {
self.is_noload_section()
}

Expand All @@ -385,11 +385,11 @@ pub(crate) mod python_bindings {
.collect()
}

pub fn findSymbolByName(&self, sym_name: &str) -> Option<symbol::Symbol> {
fn findSymbolByName(&self, sym_name: &str) -> Option<symbol::Symbol> {
self.find_symbol_by_name(sym_name).cloned()
}

pub fn findSymbolByVramOrVrom(&self, address: u64) -> Option<(symbol::Symbol, i64)> {
fn findSymbolByVramOrVrom(&self, address: u64) -> Option<(symbol::Symbol, i64)> {
if let Some((sym, offset)) = self.find_symbol_by_vram_or_vrom(address) {
Some((sym.clone(), offset))
} else {
Expand All @@ -399,23 +399,23 @@ pub(crate) mod python_bindings {

#[staticmethod]
#[pyo3(signature=(print_vram=true))]
pub fn toCsvHeader(print_vram: bool) -> String {
fn toCsvHeader(print_vram: bool) -> String {
Self::to_csv_header(print_vram)
}

#[pyo3(signature=(print_vram=true))]
pub fn toCsv(&self, print_vram: bool) -> String {
fn toCsv(&self, print_vram: bool) -> String {
self.to_csv(print_vram)
}

#[staticmethod]
#[pyo3(signature=(print_vram=true))]
pub fn printCsvHeader(print_vram: bool) {
fn printCsvHeader(print_vram: bool) {
Self::print_csv_header(print_vram)
}

#[pyo3(signature=(print_vram=true))]
pub fn printAsCsv(&self, print_vram: bool) {
fn printAsCsv(&self, print_vram: bool) {
self.print_as_csv(print_vram)
}

Expand Down
6 changes: 3 additions & 3 deletions src/rs/found_symbol_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ pub(crate) mod python_bindings {
impl super::FoundSymbolInfo {
#[new]
#[pyo3(signature=(file, symbol, offset=0))]
pub fn py_new(file: file::File, symbol: symbol::Symbol, offset: i64) -> Self {
fn py_new(file: file::File, symbol: symbol::Symbol, offset: i64) -> Self {
Self::new(file, symbol, offset)
}

Expand Down Expand Up @@ -116,12 +116,12 @@ pub(crate) mod python_bindings {
/* Methods */

#[pyo3(name = "getAsStr")]
pub fn getAsStr(&self) -> String {
fn getAsStr(&self) -> String {
self.get_as_str()
}

#[pyo3(name = "getAsStrPlusOffset")]
pub fn getAsStrPlusOffset(&self, sym_name: Option<String>) -> String {
fn getAsStrPlusOffset(&self, sym_name: Option<String>) -> String {
self.get_as_str_plus_offset(sym_name)
}
}
Expand Down
36 changes: 18 additions & 18 deletions src/rs/mapfile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -802,24 +802,24 @@ pub(crate) mod python_bindings {
#[pymethods]
impl super::MapFile {
#[new]
pub fn py_new() -> Self {
fn py_new() -> Self {
Self::new()
}

#[staticmethod]
pub fn newFromMapFile(map_path: PathBuf) -> Self {
fn newFromMapFile(map_path: PathBuf) -> Self {
Self::new_from_map_file(&map_path)
}

pub fn readMapFile(&mut self, map_path: PathBuf) {
fn readMapFile(&mut self, map_path: PathBuf) {
self.read_map_file(&map_path)
}

pub fn parseMapContents(&mut self, map_contents: &str) {
fn parseMapContents(&mut self, map_contents: &str) {
self.parse_map_contents(map_contents)
}

pub fn parseMapContentsGNU(&mut self, map_contents: &str) {
fn parseMapContentsGNU(&mut self, map_contents: &str) {
self.parse_map_contents_gnu(map_contents)
}

Expand All @@ -829,33 +829,33 @@ pub(crate) mod python_bindings {
The `mapContents` argument must contain the contents of a clang ld.lld mapfile.
*/
#[pyo3(name = "parseMapContentsLLD")]
pub fn parseMapContentsLLD(&mut self, map_contents: &str) {
fn parseMapContentsLLD(&mut self, map_contents: &str) {
self.parse_map_contents_lld(map_contents)
}

pub fn filterBySectionType(&self, section_type: &str) -> Self {
fn filterBySectionType(&self, section_type: &str) -> Self {
self.filter_by_section_type(section_type)
}

pub fn getEveryFileExceptSectionType(&self, section_type: &str) -> Self {
fn getEveryFileExceptSectionType(&self, section_type: &str) -> Self {
self.get_every_file_except_section_type(section_type)
}

pub fn findSymbolByName(
fn findSymbolByName(
&self,
sym_name: &str,
) -> Option<found_symbol_info::FoundSymbolInfo> {
self.find_symbol_by_name(sym_name)
}

pub fn findSymbolByVramOrVrom(
fn findSymbolByVramOrVrom(
&self,
address: u64,
) -> Option<found_symbol_info::FoundSymbolInfo> {
self.find_symbol_by_vram_or_vrom(address)
}

pub fn findLowestDifferingSymbol(
fn findLowestDifferingSymbol(
&self,
other_map_file: &Self,
) -> Option<(symbol::Symbol, file::File, Option<symbol::Symbol>)> {
Expand All @@ -866,12 +866,12 @@ pub(crate) mod python_bindings {
}
}

pub fn mixFolders(&self) -> Self {
fn mixFolders(&self) -> Self {
self.mix_folders()
}

#[pyo3(signature = (asm_path, nonmatchings, aliases=HashMap::new(), path_index=2))]
pub fn getProgress(
fn getProgress(
&self,
asm_path: PathBuf,
nonmatchings: PathBuf,
Expand All @@ -885,7 +885,7 @@ pub(crate) mod python_bindings {
}

#[pyo3(signature=(other_map_file, *, check_other_on_self=true))]
pub fn compareFilesAndSymbols(
fn compareFilesAndSymbols(
&self,
other_map_file: &Self,
check_other_on_self: bool,
Expand All @@ -894,20 +894,20 @@ pub(crate) mod python_bindings {
}

#[pyo3(signature=(print_vram=true, skip_without_symbols=true))]
pub fn toCsv(&self, print_vram: bool, skip_without_symbols: bool) -> String {
fn toCsv(&self, print_vram: bool, skip_without_symbols: bool) -> String {
self.to_csv(print_vram, skip_without_symbols)
}

pub fn toCsvSymbols(&self) -> String {
fn toCsvSymbols(&self) -> String {
self.to_csv_symbols()
}

#[pyo3(signature=(print_vram=true, skip_without_symbols=true))]
pub fn printAsCsv(&self, print_vram: bool, skip_without_symbols: bool) {
fn printAsCsv(&self, print_vram: bool, skip_without_symbols: bool) {
self.print_as_csv(print_vram, skip_without_symbols)
}

pub fn printSymbolsCsv(&self) {
fn printSymbolsCsv(&self) {
self.print_symbols_csv()
}

Expand Down
2 changes: 1 addition & 1 deletion src/rs/maps_comparison_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ pub(crate) mod python_bindings {
#[pymethods]
impl super::MapsComparisonInfo {
#[new]
pub fn py_new() -> Self {
fn py_new() -> Self {
Self::new()
}

Expand Down
14 changes: 7 additions & 7 deletions src/rs/progress_stats.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ pub(crate) mod python_bindings {
#[pymethods]
impl super::ProgressStats {
#[new]
pub fn py_new() -> Self {
fn py_new() -> Self {
Self::new()
}

Expand Down Expand Up @@ -139,7 +139,7 @@ pub(crate) mod python_bindings {

#[getter]
#[pyo3(name = "total")]
pub fn py_total(&self) -> usize {
fn py_total(&self) -> usize {
self.total()
}

Expand All @@ -161,24 +161,24 @@ pub(crate) mod python_bindings {
self.decomped_percentage_total(total_stats)
}

pub fn getAsFrogressEntry(&self, name: &str) -> HashMap<String, usize> {
fn getAsFrogressEntry(&self, name: &str) -> HashMap<String, usize> {
self.get_as_frogress_entry(name)
}

#[staticmethod]
#[pyo3(signature=(category_column_size=28))]
pub fn getHeaderAsStr(category_column_size: usize) -> String {
fn getHeaderAsStr(category_column_size: usize) -> String {
Self::get_header_as_str(category_column_size)
}

#[staticmethod]
#[pyo3(signature=(category_column_size=28))]
pub fn printHeader(category_column_size: usize) {
fn printHeader(category_column_size: usize) {
Self::print_header(category_column_size)
}

#[pyo3(signature=(category, total_stats, category_column_size=28))]
pub fn getEntryAsStr(
fn getEntryAsStr(
&self,
category: &str,
total_stats: &Self,
Expand All @@ -189,7 +189,7 @@ pub(crate) mod python_bindings {

#[pyo3(name = "print")]
#[pyo3(signature=(category, total_stats, category_column_size=28))]
pub fn py_print(&self, category: &str, total_stats: &Self, category_column_size: usize) {
fn py_print(&self, category: &str, total_stats: &Self, category_column_size: usize) {
self.print(category, total_stats, category_column_size)
}
}
Expand Down
20 changes: 10 additions & 10 deletions src/rs/segment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ pub(crate) mod python_bindings {
#[pymethods]
impl super::Segment {
#[new]
pub fn py_new(name: String, vram: u64, size: u64, vrom: u64, align: Option<u64>) -> Self {
fn py_new(name: String, vram: u64, size: u64, vrom: u64, align: Option<u64>) -> Self {
Self::new(name, vram, size, vrom, align)
}

Expand Down Expand Up @@ -362,47 +362,47 @@ pub(crate) mod python_bindings {

/* Methods */

pub fn filterBySectionType(&self, section_type: &str) -> Self {
fn filterBySectionType(&self, section_type: &str) -> Self {
self.filter_by_section_type(section_type)
}

pub fn getEveryFileExceptSectionType(&self, section_type: &str) -> Self {
fn getEveryFileExceptSectionType(&self, section_type: &str) -> Self {
self.get_every_file_except_section_type(section_type)
}

pub fn findSymbolByName(
fn findSymbolByName(
&self,
sym_name: &str,
) -> Option<found_symbol_info::FoundSymbolInfo> {
self.find_symbol_by_name(sym_name)
}

pub fn findSymbolByVramOrVrom(
fn findSymbolByVramOrVrom(
&self,
address: u64,
) -> Option<found_symbol_info::FoundSymbolInfo> {
self.find_symbol_by_vram_or_vrom(address)
}

pub fn mixFolders(&self) -> Self {
fn mixFolders(&self) -> Self {
self.mix_folders()
}

#[pyo3(signature=(print_vram=true, skip_without_symbols=true))]
pub fn toCsv(&self, print_vram: bool, skip_without_symbols: bool) -> String {
fn toCsv(&self, print_vram: bool, skip_without_symbols: bool) -> String {
self.to_csv(print_vram, skip_without_symbols)
}

pub fn toCsvSymbols(&self) -> String {
fn toCsvSymbols(&self) -> String {
self.to_csv_symbols()
}

#[pyo3(signature=(print_vram=true, skip_without_symbols=true))]
pub fn printAsCsv(&self, print_vram: bool, skip_without_symbols: bool) {
fn printAsCsv(&self, print_vram: bool, skip_without_symbols: bool) {
self.print_as_csv(print_vram, skip_without_symbols)
}

pub fn printSymbolsCsv(&self) {
fn printSymbolsCsv(&self) {
self.print_symbols_csv()
}

Expand Down
18 changes: 9 additions & 9 deletions src/rs/symbol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ pub(crate) mod python_bindings {
impl super::Symbol {
#[new]
#[pyo3(signature=(name,vram,size=None,vrom=None,align=None))]
pub fn py_new(
fn py_new(
name: String,
vram: u64,
size: Option<u64>,
Expand Down Expand Up @@ -283,37 +283,37 @@ pub(crate) mod python_bindings {

/* Methods */

pub fn getVramStr(&self) -> String {
fn getVramStr(&self) -> String {
self.get_vram_str()
}

pub fn getSizeStr(&self) -> String {
fn getSizeStr(&self) -> String {
self.get_size_str()
}

pub fn getVromStr(&self) -> String {
fn getVromStr(&self) -> String {
self.get_vrom_str()
}

pub fn getAlignStr(&self) -> String {
fn getAlignStr(&self) -> String {
self.get_align_str()
}

#[staticmethod]
pub fn toCsvHeader() -> String {
fn toCsvHeader() -> String {
Self::to_csv_header()
}

pub fn toCsv(&self) -> String {
fn toCsv(&self) -> String {
self.to_csv()
}

#[staticmethod]
pub fn printCsvHeader() {
fn printCsvHeader() {
Self::print_csv_header()
}

pub fn printAsCsv(&self) {
fn printAsCsv(&self) {
self.print_as_csv()
}

Expand Down
2 changes: 1 addition & 1 deletion src/rs/symbol_comparison_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ pub(crate) mod python_bindings {
impl super::SymbolComparisonInfo {
#[new]
#[pyo3(signature = (symbol, build_address, build_file, expected_address, expected_file))]
pub fn py_new(
fn py_new(
symbol: symbol::Symbol,
build_address: u64,
build_file: Option<file::File>,
Expand Down

0 comments on commit 030cc73

Please sign in to comment.