Merge branch 'RustImplementation' of https://git.racooncity.org/brotoskyj/Airlocktools into RustImplementation
This commit is contained in:
@@ -2,7 +2,7 @@ name: Build Library
|
||||
run-name: ${{ gitea.actor }}
|
||||
on:
|
||||
push:
|
||||
braches:
|
||||
branches:
|
||||
- RustImplementation
|
||||
paths:
|
||||
- airlock_libs/**
|
||||
|
||||
Generated
+1
-1
@@ -17,7 +17,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "airlock_libs"
|
||||
version = "1.0.3"
|
||||
version = "2.0.0"
|
||||
dependencies = [
|
||||
"chrono",
|
||||
"indicatif",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "airlock_libs"
|
||||
version = "1.0.3"
|
||||
version = "2.0.0"
|
||||
edition = "2024"
|
||||
|
||||
[lib]
|
||||
|
||||
@@ -4,7 +4,7 @@ build-backend = "maturin"
|
||||
|
||||
[project]
|
||||
name = "airlock_libs"
|
||||
version = "1.0.3"
|
||||
version = "2.0.0"
|
||||
description = "Airlock Digital API Wrapper"
|
||||
readme = "README.md"
|
||||
license = { text = "AGPL-3.0-only" }
|
||||
|
||||
@@ -13,7 +13,7 @@ use std::{
|
||||
env,
|
||||
fmt::Write,
|
||||
fs::{self, File},
|
||||
io::Read,
|
||||
io::{Read, Seek, SeekFrom},
|
||||
path::PathBuf,
|
||||
str::FromStr,
|
||||
};
|
||||
@@ -96,7 +96,9 @@ pub fn pull_policy_exec_histories(
|
||||
let client = build_client(py, &py_self);
|
||||
let api: Py<PyAny> = py_self;
|
||||
let cutoff = Local::now().naive_local() - Duration::days(days);
|
||||
let mut f = File::open(&writeable_filepath).unwrap();
|
||||
loop {
|
||||
f.seek(SeekFrom::Start(0)).unwrap();
|
||||
let execution_histories = history_logging(
|
||||
py,
|
||||
&api,
|
||||
@@ -110,7 +112,6 @@ pub fn pull_policy_exec_histories(
|
||||
break;
|
||||
}
|
||||
let mut seen: HashMap<(String, String, String), Group> = if writeable_filepath.exists() {
|
||||
let mut f = File::open(&writeable_filepath).unwrap();
|
||||
let mut contents = String::new();
|
||||
f.read_to_string(&mut contents).unwrap();
|
||||
let existing_data: ApiResponse =
|
||||
@@ -177,8 +178,7 @@ pub fn pull_policy_exec_histories(
|
||||
)
|
||||
{
|
||||
let date_diff = Local::now().naive_local().date() - last_date;
|
||||
let percentage_diff =
|
||||
((days + 10) - date_diff.num_days()) as f64 / (days + 10) as f64 * 100.0;
|
||||
let percentage_diff = (days - date_diff.num_days()) as f64 / days as f64 * 100.0;
|
||||
progress_bar.set_position(percentage_diff.round() as u64);
|
||||
progress_bar.set_message("Total Percent Complete");
|
||||
}
|
||||
|
||||
+1
-1
@@ -10,4 +10,4 @@ tqdm==4.67.1
|
||||
urllib3==2.5.0
|
||||
|
||||
--extra-index-url https://git.racooncity.org/api/packages/brotoskyj/pypi/simple/
|
||||
airlock_libs==1.0.3
|
||||
airlock_libs==2.0.0
|
||||
Reference in New Issue
Block a user