Skip to content

Commit

Permalink
Clippy fixes and moved SimpleImporter into amethyst. Inventory used f…
Browse files Browse the repository at this point in the history
…or source file importer registration
  • Loading branch information
kabergstrom committed Mar 1, 2019
1 parent 3f704a6 commit a7334f8
Show file tree
Hide file tree
Showing 25 changed files with 793 additions and 3,326 deletions.
3 changes: 2 additions & 1 deletion .gitignore
@@ -1,3 +1,4 @@
target
/assets
/.amethyst
/.amethyst
.vscode
601 changes: 463 additions & 138 deletions Cargo.lock

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion Cargo.toml
Expand Up @@ -5,7 +5,7 @@ edition = "2018"

[dependencies]
schema = { path = "schema" }
importer = { path = "importer" }
atelier_importer = { path = "importer" }
capnp = { version = "0.9.4", features = ["rpc_try"] }
capnp-rpc = "0.9.0"
notify = "4.0.0"
Expand All @@ -32,6 +32,7 @@ parity-tokio-ipc = { git = "https://github.com/NikVolf/parity-tokio-ipc", branch
uuid = "0.7.1"
smush = { version = "0.1", default-features = false, features = [ "lz4_support" ] }
slotmap = { version = "0.3.0", features = [ "unstable" ] }
amethyst = { path = "../amethyst" }

[dev-dependencies]
tempfile = "3"
Expand Down
16 changes: 12 additions & 4 deletions cli/src/main.rs
Expand Up @@ -89,7 +89,7 @@ fn print_asset_metadata(io: &mut shrust::ShellIO, asset: &data::asset_metadata::
write!(io, ", search_tags: [ {} ]", tags.join(", "));
}
}
write!(io, "}}");
writeln!(io, "}}");
}
fn register_commands(shell: &mut shrust::Shell<Context>) {
shell.new_command("show_all", "Get all asset metadata", 0, |io, ctx, _| {
Expand All @@ -114,12 +114,16 @@ fn register_commands(shell: &mut shrust::Shell<Context>) {
let mut request = ctx.snapshot.borrow().get_asset_metadata_request();
request.get().init_assets(1).get(0).set_id(id.as_bytes());
let mut io = io.clone();
let start = PreciseTime::now();
Box::new(request.send().promise.then(move |result| {
let total_time = start.to(PreciseTime::now());
let response = result.unwrap();
let response = response.get().unwrap();
for asset in response.get_assets().unwrap() {
let assets = response.get_assets().unwrap();
for asset in assets {
print_asset_metadata(&mut io, &asset);
}
writeln!(io, "got {} assets in {}", assets.len(), total_time);
Ok(())
}))
});
Expand All @@ -128,13 +132,17 @@ fn register_commands(shell: &mut shrust::Shell<Context>) {
let mut request = ctx.snapshot.borrow().get_build_artifacts_request();
request.get().init_assets(1).get(0).set_id(id.as_bytes());
let mut io = io.clone();
let start = PreciseTime::now();
Box::new(request.send().promise.then(move |result| {
let total_time = start.to(PreciseTime::now());
let response = result.unwrap();
let response = response.get().unwrap();
for artifact in response.get_artifacts().unwrap() {
let artifacts = response.get_artifacts().unwrap();
for artifact in artifacts {
let asset_uuid = uuid::Uuid::from_slice(artifact.get_asset_id()?.get_id()?).unwrap();
write!(io, "{{ id: {}, hash: {:?}, length: {} }}", asset_uuid, artifact.get_key()?, artifact.get_data()?.get_data()?.len());
writeln!(io, "{{ id: {}, hash: {:?}, length: {} }}", asset_uuid, artifact.get_key()?, artifact.get_data()?.get_data()?.len());
}
writeln!(io, "got {} artifacts in {}", artifacts.len(), total_time);
Ok(())
}))
});
Expand Down
92 changes: 46 additions & 46 deletions client/Cargo.lock

Large diffs are not rendered by default.

0 comments on commit a7334f8

Please sign in to comment.