Skip to content

Commit 805737f

Browse files
committed
use pythons stdout
1 parent e8eb8ff commit 805737f

File tree

7 files changed

+549
-244
lines changed

7 files changed

+549
-244
lines changed

Diff for: src/config.rs

+9-4
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ pub struct WalletConfig {
99
}
1010

1111
impl WalletConfig {
12-
1312
pub fn new(name: Option<String>, hotkey: Option<String>, path: Option<String>) -> Self {
1413
WalletConfig {
1514
name: name.unwrap_or_else(|| BT_WALLET_NAME.to_string()),
@@ -29,8 +28,14 @@ pub struct Config {
2928
impl Config {
3029
#[new]
3130
#[pyo3(signature = (name = None, hotkey = None, path = None))]
32-
pub fn new(name: Option<String>, hotkey: Option<String>, path: Option<String>) -> PyResult<Config> {
33-
Ok(Config {wallet: WalletConfig::new(name, hotkey, path)})
31+
pub fn new(
32+
name: Option<String>,
33+
hotkey: Option<String>,
34+
path: Option<String>,
35+
) -> PyResult<Config> {
36+
Ok(Config {
37+
wallet: WalletConfig::new(name, hotkey, path),
38+
})
3439
}
3540
fn __str__(&self) -> PyResult<String> {
3641
Ok(format!(
@@ -42,4 +47,4 @@ impl Config {
4247
fn __repr__(&self) -> PyResult<String> {
4348
self.__str__()
4449
}
45-
}
50+
}

Diff for: src/errors.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
use pyo3::prelude::*;
21
use pyo3::exceptions::PyException;
3-
use std::{fmt, error};
2+
use pyo3::prelude::*;
3+
use std::{error, fmt};
44

55
#[pyclass(extends=PyException)]
66
#[derive(Debug)]
77
pub struct KeyFileError {
8-
pub message: String
8+
pub message: String,
99
}
1010

1111
/// Error thrown when the keyfile is corrupt, non-writable, non-readable or the password used to decrypt is invalid.
@@ -34,7 +34,7 @@ impl error::Error for KeyFileError {}
3434
#[pyclass(extends=PyException)]
3535
#[derive(Debug)]
3636
pub struct ConfigurationError {
37-
pub message: String
37+
pub message: String,
3838
}
3939

4040
/// ConfigurationError
@@ -58,4 +58,4 @@ impl fmt::Display for ConfigurationError {
5858
}
5959
}
6060

61-
impl error::Error for ConfigurationError {}
61+
impl error::Error for ConfigurationError {}

0 commit comments

Comments
 (0)