commit c18821fb9c94f5f8b1f8b6dcd662e9310e5f1581 from: Benjamin Stürz date: Mon Feb 10 18:28:39 2025 UTC rm ppa6-cuos commit - 7abaf13d2aaec6266712b3df327e72c361eca012 commit + c18821fb9c94f5f8b1f8b6dcd662e9310e5f1581 blob - 7d874e11cfd8fc76b3627afcf145a2af71e5a850 blob + d6474d46a2d7b21583540ee59081a15a83b78ec5 --- Cargo.lock +++ Cargo.lock @@ -855,13 +855,6 @@ dependencies = [ ] [[package]] -name = "ppa6-cups" -version = "0.1.0" -dependencies = [ - "ppa6", -] - -[[package]] name = "ppa6-print" version = "0.1.0" dependencies = [ blob - b7ba6dec8ec29d520df4f4806384b852fa8f6250 blob + 78a4d092c0b8fde359a90c450020e693f6ec8949 --- Cargo.toml +++ Cargo.toml @@ -2,7 +2,6 @@ resolver = "2" members = [ "ppa6", - "ppa6-cups", "ppa6-print" ] blob - 7a158edbf45196cab7b8a338f11cd4df6c22cf26 (mode 644) blob + /dev/null --- ppa6-cups/Cargo.toml +++ /dev/null @@ -1,7 +0,0 @@ -[package] -name = "ppa6-cups" -version = "0.1.0" -edition = "2021" - -[dependencies] -ppa6.workspace = true blob - 65dee1b2bb880aea6ae3a9b2dec3f350b9c23227 (mode 644) blob + /dev/null --- ppa6-cups/src/main.rs +++ /dev/null @@ -1,51 +0,0 @@ -use std::{io::Read, path::PathBuf}; -use ppa6::{usb_context, Document, Printer}; - -#[derive(Debug)] -struct Job { - id: String, - user: String, - title: String, - num: u32, - options: String, - path: Option, -} - -fn parse_cli() -> Option { - let mut args = std::env::args(); - - Some(Job { - id: args.next()?, - user: args.next()?, - title: args.next()?, - num: args.next()?.parse().ok()?, - options: args.next()?, - path: args.next().map(PathBuf::from), - }) -} - -fn main() { - let Some(job) = parse_cli() else { - eprintln!("usage: ppa6 job_id user job_name ncopies options [file]"); - std::process::exit(1) - }; - - dbg!(&job); - - let ctx = usb_context().expect("failed to load libusb"); - let mut printer = Printer::find(&ctx).expect("no PeriPage A6 found"); - - let pixels = match job.path.as_deref() { - Some(path) => std::fs::read(path).expect("failed to read file"), - None => { - let mut buf = Vec::new(); - std::io::stdin().read_to_end(&mut buf).expect("failed to read stdin"); - buf - } - }; - let doc = Document::new(pixels).expect("failed to create document"); - - for _ in 0..job.num { - printer.print(&doc, true).expect("failed to print"); - } -}