mirror of
https://github.com/YGGverse/Yoda.git
synced 2025-02-10 18:34:14 +00:00
draft meta parser
This commit is contained in:
parent
1a644ee219
commit
4cdfaa2d6b
@ -10,11 +10,12 @@ use gtk::{
|
|||||||
prelude::{BoxExt, IOStreamExt, InputStreamExtManual, OutputStreamExtManual, SocketClientExt},
|
prelude::{BoxExt, IOStreamExt, InputStreamExtManual, OutputStreamExtManual, SocketClientExt},
|
||||||
Box, Orientation,
|
Box, Orientation,
|
||||||
};
|
};
|
||||||
|
use std::sync::Arc;
|
||||||
|
|
||||||
pub struct Page {
|
pub struct Page {
|
||||||
widget: Box,
|
widget: Box,
|
||||||
navigation: Navigation,
|
navigation: Navigation,
|
||||||
content: Content,
|
content: Arc<Content>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Page {
|
impl Page {
|
||||||
@ -76,23 +77,33 @@ impl Page {
|
|||||||
vec![0; 0xfffff], // 1Mb @TODO
|
vec![0; 0xfffff], // 1Mb @TODO
|
||||||
Priority::DEFAULT,
|
Priority::DEFAULT,
|
||||||
Some(&Cancellable::new()),
|
Some(&Cancellable::new()),
|
||||||
{
|
move |result| match result {
|
||||||
move |result| match result {
|
Ok(response) => {
|
||||||
Ok(response) => {
|
match GString::from_utf8_until_nul(
|
||||||
println!(
|
response.0,
|
||||||
"Result: {:?}",
|
) {
|
||||||
GString::from_utf8_until_nul(
|
Ok(data) => {
|
||||||
response.0
|
// Detect page meta
|
||||||
)
|
let meta = Regex::split_simple(
|
||||||
); // @TODO
|
r"^(\d+)?\s([\w]+\/[\w]+)?",
|
||||||
// @TODO connection.close(cancellable);
|
data,
|
||||||
}
|
RegexCompileFlags::DEFAULT,
|
||||||
Err(e) => {
|
RegexMatchFlags::DEFAULT,
|
||||||
eprintln!(
|
);
|
||||||
"Failed to read response: {:?}",
|
|
||||||
e
|
//println!("{:?}", meta);
|
||||||
);
|
//println!("Result: {}", data);
|
||||||
|
}
|
||||||
|
Err(_) => todo!(),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// @TODO connection.close(cancellable);
|
||||||
|
}
|
||||||
|
Err(e) => {
|
||||||
|
eprintln!(
|
||||||
|
"Failed to read response: {:?}",
|
||||||
|
e
|
||||||
|
);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user