Skip to content

Instantly share code, notes, and snippets.

View DarkFenX's full-sized avatar

Anton Vorobyov DarkFenX

  • Russia, St Petersburg
View GitHub Profile
fn _read_json(&self, addr: &PhobosAddress) -> PhobosHandlerResult<JsonValue> {
let bytes = self
._read_file(addr)
.map_err(|e| PhobosHandlerError::from_path_err(e, addr.get_full_str(&self.base_path)))?;
let data = serde_json::from_slice(&bytes)
.map_err(|e| PhobosHandlerError::from_path_err(e, addr.get_full_str(&self.base_path)))?;
Ok(data)
}
fn _read_json(&self, addr: &PhobosAddress) -> PhobosHandlerResult<JsonValue> {
let bytes = match self._read_file(addr) {
Ok(bytes) => bytes,
Err(e) => return Err(PhobosHandlerError::from_path_err(e, addr.get_full_str(&self.base_path))),
};
let data = match serde_json::from_slice(&bytes) {
Ok(data) => data,
Err(e) => return Err(PhobosHandlerError::from_path_err(e, addr.get_full_str(&self.base_path))),
};
Ok(data)
fn _read_json(&self, addr: &PhobosAddress) -> PhobosHandlerResult<JsonValue> {
let bytes = match self._read_file(addr) {
Ok(bytes) => bytes,
Err(e) => {
return Err(PhobosHandlerError::new(format!(
"{} read failed: {}",
addr.get_full_str(&self.base_path),
e
)))
}
error[E0277]: the trait bound `data_handler::json::error::Error: serde::de::Deserialize<'_>` is not satisfied
--> core/src/data_handler/json/handler.rs:35:19
|
35 | let res = serde_json::from_slice(&bytes);
| ^^^^^^^^^^^^^^^^^^^^^^ the trait `serde::de::Deserialize<'_>` is not implemented for `data_handler::json::error::Error`
|
::: /home/dfx/.cargo/registry/src/github.com-1ecc6299db9ec823/serde_json-1.0.53/src/de.rs:2355:8
|
2355 | T: de::Deserialize<'a>,
| ------------------- required by this bound in `serde_json::de::from_slice`
fn _read_json(&self, addr: JsonAddress) -> JsonResult<Value> {
let bytes = self._read_file(addr)?;
let res = serde_json::from_slice(&bytes);
let ok = match res {
Ok(v) => v,
Err(e) => return Err(JsonError::ParseError(format!("{}", e))),
};
ok
}
error[E0277]: the trait bound `data_handler::json::error::Error: serde::de::Deserialize<'_>` is not satisfied
--> core/src/data_handler/json/handler.rs:35:9
|
35 | serde_json::from_slice(&bytes)?
| ^^^^^^^^^^^^^^^^^^^^^^ the trait `serde::de::Deserialize<'_>` is not implemented for `data_handler::json::error::Error`
|
::: /home/dfx/.cargo/registry/src/github.com-1ecc6299db9ec823/serde_json-1.0.53/src/de.rs:2355:8
|
2355 | T: de::Deserialize<'a>,
| ------------------- required by this bound in `serde_json::de::from_slice`
impl JsonDataHandler {
...
fn _read_file(&self, addr: JsonFileAddress) -> io::Result<Vec<u8>> {
let full_path = self
.base_path
.join(addr.folder)
.join(format!("{}.json", addr.file));
let mut bytes: Vec<u8> = Vec::new();
File::open(full_path)?.read_to_end(&mut bytes)?;
Ok(bytes)
E:\eve\pyfa>C:\Python38_64\python.exe pyfa.py
Error in sys.excepthook:
Traceback (most recent call last):
File "\\VBOXSVR\exchange\eve\pyfa\gui\errorDialog.py", line 49, in HandleExcep
tion
cls.__frame = ErrorFrame(None)
File "\\VBOXSVR\exchange\eve\pyfa\gui\errorDialog.py", line 68, in __init__
super().__init__(parent, id=wx.ID_ANY, title="pyfa error", pos=wx.DefaultPos
ition, size=wx.Size(500, 600))
File "\\VBOXSVR\exchange\eve\pyfa\gui\auxFrame.py", line 46, in __init__
# This apes hook-matplotlib.backends.py, but REMOVES backends, all but
# the ones in the list below.
# Courtesy of https://github.com/bpteague/cytoflow/blob/70f9291/packaging/hook-matplotlib.backends.py
KEEP = ["WXAgg", "WX", "agg"]
from PyInstaller.compat import is_darwin
from PyInstaller.utils.hooks import (
eval_statement, exec_statement, logger)
? O PYZ-00.pyz
Warning: pyz is from a different Python version
Name: (ispkg, pos, len)
{'PIL': (1, 17, 793),
'PIL.BlpImagePlugin': (0, 810, 4892),
'PIL.BmpImagePlugin': (0, 5702, 3888),
'PIL.BufrStubImagePlugin': (0, 9590, 897),
'PIL.CurImagePlugin': (0, 10487, 838),
'PIL.DcxImagePlugin': (0, 11325, 1087),
'PIL.DdsImagePlugin': (0, 12412, 2500),