Skip to content

Commit 5309fef

Browse files
committed
Formatting fixes
1 parent d68bc12 commit 5309fef

3 files changed

Lines changed: 12 additions & 15 deletions

File tree

python/pluginmanager.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,10 @@ def installed(self) -> bool:
7070
"""Boolean True if the plugin is installed, False otherwise"""
7171
return core.BNPluginIsInstalled(self.handle)
7272

73-
def install(self) -> bool:
73+
def install(self, version_id=None) -> bool:
7474
"""Attempt to install the given plugin"""
7575
self.install_dependencies()
76-
return core.BNPluginInstall(self.handle)
76+
return core.BNPluginInstall(self.handle, version_id)
7777

7878
def uninstall(self) -> bool:
7979
"""Attempt to uninstall the given plugin"""
@@ -83,7 +83,7 @@ def uninstall(self) -> bool:
8383
def installed(self, state: bool):
8484
if state:
8585
self.install_dependencies()
86-
core.BNPluginInstall(self.handle)
86+
core.BNPluginInstall(self.handle, None)
8787
else:
8888
core.BNPluginUninstall(self.handle)
8989

rust/src/repository/manager.rs

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
use crate::rc::{Array, Ref};
22
use crate::repository::Repository;
33
use crate::string::IntoCStr;
4-
use binaryninjacore_sys::{BNRepositoryGetRepositoryByPath,
5-
BNRepositoryManagerAddRepository, BNRepositoryManagerCheckForUpdates,
6-
BNRepositoryManagerGetDefaultRepository, BNRepositoryManagerGetRepositories,
4+
use binaryninjacore_sys::{
5+
BNRepositoryGetRepositoryByPath, BNRepositoryManagerAddRepository,
6+
BNRepositoryManagerCheckForUpdates, BNRepositoryManagerGetDefaultRepository,
7+
BNRepositoryManagerGetRepositories,
78
};
89
use std::fmt::Debug;
910
use std::path::Path;
@@ -22,8 +23,7 @@ impl RepositoryManager {
2223
/// List of [`Repository`] objects being managed
2324
pub fn repositories() -> Array<Repository> {
2425
let mut count = 0;
25-
let result =
26-
unsafe { BNRepositoryManagerGetRepositories(&mut count) };
26+
let result = unsafe { BNRepositoryManagerGetRepositories(&mut count) };
2727
assert!(!result.is_null());
2828
unsafe { Array::new(result, count, ()) }
2929
}
@@ -42,15 +42,12 @@ impl RepositoryManager {
4242
pub fn add_repository(url: &str, repository_path: &Path) -> bool {
4343
let url = url.to_cstr();
4444
let repo_path = repository_path.to_cstr();
45-
unsafe {
46-
BNRepositoryManagerAddRepository(url.as_ptr(), repo_path.as_ptr())
47-
}
45+
unsafe { BNRepositoryManagerAddRepository(url.as_ptr(), repo_path.as_ptr()) }
4846
}
4947

5048
pub fn repository_by_path(path: &Path) -> Option<Repository> {
5149
let path = path.to_cstr();
52-
let result =
53-
unsafe { BNRepositoryGetRepositoryByPath(path.as_ptr()) };
50+
let result = unsafe { BNRepositoryGetRepositoryByPath(path.as_ptr()) };
5451
NonNull::new(result).map(|raw| unsafe { Repository::from_raw(raw) })
5552
}
5653

@@ -68,4 +65,4 @@ impl Debug for RepositoryManager {
6865
.field("repositories", &RepositoryManager::repositories().to_vec())
6966
.finish()
7067
}
71-
}
68+
}

rust/src/repository/plugin.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ impl Extension {
3232

3333
/// String of the plugin author
3434
pub fn author(&self) -> String {
35-
let result = unsafe { BNPluginGetAuthorUrl(self.handle.as_ptr()) };
35+
let result = unsafe { BNPluginGetAuthor(self.handle.as_ptr()) };
3636
assert!(!result.is_null());
3737
unsafe { BnString::into_string(result as *mut c_char) }
3838
}

0 commit comments

Comments
 (0)