mirror of
https://github.com/alexpasmantier/television.git
synced 2025-06-06 03:25:23 +00:00
chore(deps): shed off unessential dependencies (#52)
This commit is contained in:
parent
44de19a01e
commit
565283babb
246
Cargo.lock
generated
246
Cargo.lock
generated
@ -134,7 +134,7 @@ checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"syn 2.0.87",
|
"syn",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -401,9 +401,6 @@ dependencies = [
|
|||||||
"anstyle",
|
"anstyle",
|
||||||
"clap_lex",
|
"clap_lex",
|
||||||
"strsim",
|
"strsim",
|
||||||
"terminal_size",
|
|
||||||
"unicase",
|
|
||||||
"unicode-width 0.2.0",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -415,7 +412,7 @@ dependencies = [
|
|||||||
"heck",
|
"heck",
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"syn 2.0.87",
|
"syn",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -706,7 +703,7 @@ dependencies = [
|
|||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"strsim",
|
"strsim",
|
||||||
"syn 2.0.87",
|
"syn",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -717,7 +714,7 @@ checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"darling_core",
|
"darling_core",
|
||||||
"quote",
|
"quote",
|
||||||
"syn 2.0.87",
|
"syn",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -747,7 +744,7 @@ dependencies = [
|
|||||||
"darling",
|
"darling",
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"syn 2.0.87",
|
"syn",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -757,18 +754,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
checksum = "ab63b0e2bf4d5928aff72e83a7dace85d7bba5fe12dcc3c5a572d78caffd3f3c"
|
checksum = "ab63b0e2bf4d5928aff72e83a7dace85d7bba5fe12dcc3c5a572d78caffd3f3c"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"derive_builder_core",
|
"derive_builder_core",
|
||||||
"syn 2.0.87",
|
"syn",
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "derive_deref"
|
|
||||||
version = "1.1.1"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "dcdbcee2d9941369faba772587a565f4f534e42cb8d17e5295871de730163b2b"
|
|
||||||
dependencies = [
|
|
||||||
"proc-macro2",
|
|
||||||
"quote",
|
|
||||||
"syn 1.0.109",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -780,12 +766,6 @@ dependencies = [
|
|||||||
"lazy_static",
|
"lazy_static",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "diff"
|
|
||||||
version = "0.1.13"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "56254986775e3233ffa9c4d7d3faaf6d36a2c09d30b20687e9f88bc8bafc16c8"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "digest"
|
name = "digest"
|
||||||
version = "0.10.7"
|
version = "0.10.7"
|
||||||
@ -825,7 +805,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"syn 2.0.87",
|
"syn",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -971,95 +951,6 @@ dependencies = [
|
|||||||
"percent-encoding",
|
"percent-encoding",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "futures"
|
|
||||||
version = "0.3.31"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876"
|
|
||||||
dependencies = [
|
|
||||||
"futures-channel",
|
|
||||||
"futures-core",
|
|
||||||
"futures-executor",
|
|
||||||
"futures-io",
|
|
||||||
"futures-sink",
|
|
||||||
"futures-task",
|
|
||||||
"futures-util",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "futures-channel"
|
|
||||||
version = "0.3.31"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10"
|
|
||||||
dependencies = [
|
|
||||||
"futures-core",
|
|
||||||
"futures-sink",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "futures-core"
|
|
||||||
version = "0.3.31"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e"
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "futures-executor"
|
|
||||||
version = "0.3.31"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "1e28d1d997f585e54aebc3f97d39e72338912123a67330d723fdbb564d646c9f"
|
|
||||||
dependencies = [
|
|
||||||
"futures-core",
|
|
||||||
"futures-task",
|
|
||||||
"futures-util",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "futures-io"
|
|
||||||
version = "0.3.31"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6"
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "futures-macro"
|
|
||||||
version = "0.3.31"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650"
|
|
||||||
dependencies = [
|
|
||||||
"proc-macro2",
|
|
||||||
"quote",
|
|
||||||
"syn 2.0.87",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "futures-sink"
|
|
||||||
version = "0.3.31"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7"
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "futures-task"
|
|
||||||
version = "0.3.31"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988"
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "futures-util"
|
|
||||||
version = "0.3.31"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81"
|
|
||||||
dependencies = [
|
|
||||||
"futures-channel",
|
|
||||||
"futures-core",
|
|
||||||
"futures-io",
|
|
||||||
"futures-macro",
|
|
||||||
"futures-sink",
|
|
||||||
"futures-task",
|
|
||||||
"memchr",
|
|
||||||
"pin-project-lite",
|
|
||||||
"pin-utils",
|
|
||||||
"slab",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "gag"
|
name = "gag"
|
||||||
version = "1.0.0"
|
version = "1.0.0"
|
||||||
@ -1802,7 +1693,7 @@ checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"syn 2.0.87",
|
"syn",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -1886,7 +1777,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
checksum = "b23a0c8dfe501baac4adf6ebbfa6eddf8f0c07f56b058cc1288017e32397846c"
|
checksum = "b23a0c8dfe501baac4adf6ebbfa6eddf8f0c07f56b058cc1288017e32397846c"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"quote",
|
"quote",
|
||||||
"syn 2.0.87",
|
"syn",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -2349,7 +2240,7 @@ dependencies = [
|
|||||||
"pest_meta",
|
"pest_meta",
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"syn 2.0.87",
|
"syn",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -2369,12 +2260,6 @@ version = "0.2.15"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "915a1e146535de9163f3987b8944ed8cf49a18bb0056bcebcdcece385cece4ff"
|
checksum = "915a1e146535de9163f3987b8944ed8cf49a18bb0056bcebcdcece385cece4ff"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "pin-utils"
|
|
||||||
version = "0.1.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "pkg-config"
|
name = "pkg-config"
|
||||||
version = "0.3.31"
|
version = "0.3.31"
|
||||||
@ -2415,16 +2300,6 @@ version = "0.2.0"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391"
|
checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "pretty_assertions"
|
|
||||||
version = "1.4.1"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "3ae130e2f271fbc2ac3a40fb1d07180839cdbbe443c7a27e1e3c13c5cac0116d"
|
|
||||||
dependencies = [
|
|
||||||
"diff",
|
|
||||||
"yansi",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "proc-macro2"
|
name = "proc-macro2"
|
||||||
version = "1.0.89"
|
version = "1.0.89"
|
||||||
@ -2691,7 +2566,7 @@ checksum = "de523f781f095e28fa605cdce0f8307e451cc0fd14e2eb4cd2e98a355b147766"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"syn 2.0.87",
|
"syn",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -2869,15 +2744,6 @@ version = "0.2.12"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "8207e78455ffdf55661170876f88daf85356e4edd54e0a3dbc79586ca1e50cbe"
|
checksum = "8207e78455ffdf55661170876f88daf85356e4edd54e0a3dbc79586ca1e50cbe"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "strip-ansi-escapes"
|
|
||||||
version = "0.2.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "55ff8ef943b384c414f54aefa961dd2bd853add74ec75e7ac74cf91dba62bcfa"
|
|
||||||
dependencies = [
|
|
||||||
"vte",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "strsim"
|
name = "strsim"
|
||||||
version = "0.11.1"
|
version = "0.11.1"
|
||||||
@ -2903,18 +2769,7 @@ dependencies = [
|
|||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"rustversion",
|
"rustversion",
|
||||||
"syn 2.0.87",
|
"syn",
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "syn"
|
|
||||||
version = "1.0.109"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237"
|
|
||||||
dependencies = [
|
|
||||||
"proc-macro2",
|
|
||||||
"quote",
|
|
||||||
"unicode-ident",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -2936,7 +2791,7 @@ checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"syn 2.0.87",
|
"syn",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -2965,34 +2820,18 @@ dependencies = [
|
|||||||
name = "television"
|
name = "television"
|
||||||
version = "0.5.0"
|
version = "0.5.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
|
||||||
"better-panic",
|
"better-panic",
|
||||||
"clap",
|
"clap",
|
||||||
"color-eyre",
|
"color-eyre",
|
||||||
"config",
|
"config",
|
||||||
"copypasta",
|
"copypasta",
|
||||||
"crossterm",
|
"crossterm",
|
||||||
"derive_deref",
|
|
||||||
"devicons",
|
|
||||||
"directories",
|
"directories",
|
||||||
"futures",
|
|
||||||
"human-panic",
|
"human-panic",
|
||||||
"ignore",
|
|
||||||
"infer",
|
|
||||||
"json5",
|
|
||||||
"lazy_static",
|
"lazy_static",
|
||||||
"libc",
|
|
||||||
"nucleo",
|
|
||||||
"nucleo-matcher",
|
|
||||||
"parking_lot",
|
|
||||||
"pretty_assertions",
|
|
||||||
"ratatui",
|
"ratatui",
|
||||||
"regex",
|
|
||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
|
||||||
"signal-hook",
|
"signal-hook",
|
||||||
"strip-ansi-escapes",
|
|
||||||
"strum",
|
|
||||||
"syntect",
|
"syntect",
|
||||||
"television-channels",
|
"television-channels",
|
||||||
"television-derive",
|
"television-derive",
|
||||||
@ -3003,7 +2842,6 @@ dependencies = [
|
|||||||
"tokio",
|
"tokio",
|
||||||
"toml",
|
"toml",
|
||||||
"tracing",
|
"tracing",
|
||||||
"tracing-error",
|
|
||||||
"tracing-subscriber",
|
"tracing-subscriber",
|
||||||
"unicode-width 0.2.0",
|
"unicode-width 0.2.0",
|
||||||
"vergen-gix",
|
"vergen-gix",
|
||||||
@ -3034,7 +2872,7 @@ version = "0.0.4"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"syn 2.0.87",
|
"syn",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -3090,16 +2928,6 @@ dependencies = [
|
|||||||
"windows-sys 0.59.0",
|
"windows-sys 0.59.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "terminal_size"
|
|
||||||
version = "0.4.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "4f599bd7ca042cfdf8f4512b277c02ba102247820f9d9d4a9f521f496751a6ef"
|
|
||||||
dependencies = [
|
|
||||||
"rustix",
|
|
||||||
"windows-sys 0.59.0",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "termtree"
|
name = "termtree"
|
||||||
version = "0.5.1"
|
version = "0.5.1"
|
||||||
@ -3123,7 +2951,7 @@ checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"syn 2.0.87",
|
"syn",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -3229,7 +3057,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"syn 2.0.87",
|
"syn",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -3285,7 +3113,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"syn 2.0.87",
|
"syn",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -3350,12 +3178,6 @@ version = "0.1.7"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971"
|
checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "unicase"
|
|
||||||
version = "2.8.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "7e51b68083f157f853b6379db119d1c1be0e6e4dec98101079dec41f6f5cf6df"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "unicode-bom"
|
name = "unicode-bom"
|
||||||
version = "2.0.3"
|
version = "2.0.3"
|
||||||
@ -3504,26 +3326,6 @@ version = "0.9.5"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a"
|
checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "vte"
|
|
||||||
version = "0.11.1"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "f5022b5fbf9407086c180e9557be968742d839e68346af7792b8592489732197"
|
|
||||||
dependencies = [
|
|
||||||
"utf8parse",
|
|
||||||
"vte_generate_state_changes",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "vte_generate_state_changes"
|
|
||||||
version = "0.1.2"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "2e369bee1b05d510a7b4ed645f5faa90619e05437111783ea5848f28d97d3c2e"
|
|
||||||
dependencies = [
|
|
||||||
"proc-macro2",
|
|
||||||
"quote",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "walkdir"
|
name = "walkdir"
|
||||||
version = "2.5.0"
|
version = "2.5.0"
|
||||||
@ -3895,12 +3697,6 @@ dependencies = [
|
|||||||
"hashlink",
|
"hashlink",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "yansi"
|
|
||||||
version = "1.0.1"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "cfe53a6657fd280eaa890a3bc59152892ffa3e30101319d168b781ed6529b049"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "yoke"
|
name = "yoke"
|
||||||
version = "0.7.4"
|
version = "0.7.4"
|
||||||
@ -3921,7 +3717,7 @@ checksum = "28cc31741b18cb6f1d5ff12f5b7523e3d6eb0852bbbad19d73905511d9849b95"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"syn 2.0.87",
|
"syn",
|
||||||
"synstructure",
|
"synstructure",
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -3942,7 +3738,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"syn 2.0.87",
|
"syn",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -3962,7 +3758,7 @@ checksum = "0ea7b4a3637ea8669cedf0f1fd5c286a17f3de97b8dd5a70a6c167a1730e63a5"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"syn 2.0.87",
|
"syn",
|
||||||
"synstructure",
|
"synstructure",
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -3985,5 +3781,5 @@ checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"syn 2.0.87",
|
"syn",
|
||||||
]
|
]
|
||||||
|
26
Cargo.toml
26
Cargo.toml
@ -62,51 +62,27 @@ television-utils = { path = "crates/television-utils", version = "0.0.4" }
|
|||||||
|
|
||||||
# external dependencies
|
# external dependencies
|
||||||
better-panic = "0.3.0"
|
better-panic = "0.3.0"
|
||||||
clap = { version = "4.4.5", features = [
|
clap = { version = "4.4.5", features = ["derive", "cargo", "string"] }
|
||||||
"derive",
|
|
||||||
"cargo",
|
|
||||||
"wrap_help",
|
|
||||||
"unicode",
|
|
||||||
"string",
|
|
||||||
"unstable-styles",
|
|
||||||
] }
|
|
||||||
color-eyre = "0.6.3"
|
color-eyre = "0.6.3"
|
||||||
config = "0.14.0"
|
config = "0.14.0"
|
||||||
crossterm = { version = "0.28.1", features = ["serde"] }
|
crossterm = { version = "0.28.1", features = ["serde"] }
|
||||||
derive_deref = "1.1.1"
|
|
||||||
devicons = "0.6.8"
|
|
||||||
directories = "5.0.1"
|
directories = "5.0.1"
|
||||||
futures = "0.3.30"
|
|
||||||
ignore = "0.4.23"
|
|
||||||
infer = "0.16.0"
|
|
||||||
json5 = "0.4.1"
|
|
||||||
lazy_static = "1.5.0"
|
lazy_static = "1.5.0"
|
||||||
libc = "0.2.158"
|
|
||||||
nucleo = "0.5.0"
|
|
||||||
nucleo-matcher = "0.3.1"
|
|
||||||
parking_lot = "0.12.3"
|
|
||||||
ratatui = { version = "0.29.0", features = ["serde", "macros"] }
|
ratatui = { version = "0.29.0", features = ["serde", "macros"] }
|
||||||
regex = "1.10.6"
|
|
||||||
serde = { version = "1.0.208", features = ["derive"] }
|
serde = { version = "1.0.208", features = ["derive"] }
|
||||||
serde_json = "1.0.125"
|
|
||||||
signal-hook = "0.3.17"
|
signal-hook = "0.3.17"
|
||||||
strip-ansi-escapes = "0.2.0"
|
|
||||||
strum = { version = "0.26.3", features = ["derive"] }
|
|
||||||
syntect = "5.2.0"
|
syntect = "5.2.0"
|
||||||
tokio = { version = "1.39.3", features = ["full"] }
|
tokio = { version = "1.39.3", features = ["full"] }
|
||||||
toml = "0.8.19"
|
toml = "0.8.19"
|
||||||
tracing = "0.1.40"
|
tracing = "0.1.40"
|
||||||
tracing-error = "0.2.0"
|
|
||||||
tracing-subscriber = { version = "0.3.18", features = ["env-filter", "serde"] }
|
tracing-subscriber = { version = "0.3.18", features = ["env-filter", "serde"] }
|
||||||
unicode-width = "0.2.0"
|
unicode-width = "0.2.0"
|
||||||
human-panic = "2.0.2"
|
human-panic = "2.0.2"
|
||||||
pretty_assertions = "1.4.1"
|
|
||||||
termtree = "0.5.1"
|
termtree = "0.5.1"
|
||||||
copypasta = "0.10.1"
|
copypasta = "0.10.1"
|
||||||
|
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
anyhow = "1.0.86"
|
|
||||||
vergen-gix = { version = "1.0.0", features = ["build", "cargo", "rustc"] }
|
vergen-gix = { version = "1.0.0", features = ["build", "cargo", "rustc"] }
|
||||||
|
|
||||||
[target.'cfg(target_os = "macos")'.dependencies]
|
[target.'cfg(target_os = "macos")'.dependencies]
|
||||||
|
9
build.rs
9
build.rs
@ -1,13 +1,14 @@
|
|||||||
use anyhow::Result;
|
use std::error::Error;
|
||||||
|
|
||||||
use vergen_gix::{BuildBuilder, CargoBuilder, Emitter, RustcBuilder};
|
use vergen_gix::{BuildBuilder, CargoBuilder, Emitter, RustcBuilder};
|
||||||
|
|
||||||
fn main() -> Result<()> {
|
fn main() -> Result<(), Box<dyn Error>> {
|
||||||
let build = BuildBuilder::default().build_date(true).build()?;
|
let build = BuildBuilder::default().build_date(true).build()?;
|
||||||
let cargo = CargoBuilder::default().target_triple(true).build()?;
|
let cargo = CargoBuilder::default().target_triple(true).build()?;
|
||||||
let rustc = RustcBuilder::default().semver(true).build()?;
|
let rustc = RustcBuilder::default().semver(true).build()?;
|
||||||
Emitter::default()
|
Ok(Emitter::default()
|
||||||
.add_instructions(&build)?
|
.add_instructions(&build)?
|
||||||
.add_instructions(&cargo)?
|
.add_instructions(&cargo)?
|
||||||
.add_instructions(&rustc)?
|
.add_instructions(&rustc)?
|
||||||
.emit()
|
.emit()?)
|
||||||
}
|
}
|
||||||
|
@ -124,12 +124,12 @@ impl Previewer {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn preview(&mut self, entry: &Entry) -> Arc<Preview> {
|
pub fn preview(&mut self, entry: &Entry) -> Arc<Preview> {
|
||||||
match entry.preview_type {
|
match entry.preview_type {
|
||||||
PreviewType::Basic => self.basic.preview(entry),
|
PreviewType::Basic => self.basic.preview(entry),
|
||||||
PreviewType::Directory => self.directory.preview(entry).await,
|
PreviewType::Directory => self.directory.preview(entry),
|
||||||
PreviewType::EnvVar => self.env_var.preview(entry),
|
PreviewType::EnvVar => self.env_var.preview(entry),
|
||||||
PreviewType::Files => self.file.preview(entry).await,
|
PreviewType::Files => self.file.preview(entry),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@ impl DirectoryPreviewer {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn preview(&mut self, entry: &Entry) -> Arc<Preview> {
|
pub fn preview(&mut self, entry: &Entry) -> Arc<Preview> {
|
||||||
if let Some(preview) = self.cache.lock().get(&entry.name) {
|
if let Some(preview) = self.cache.lock().get(&entry.name) {
|
||||||
return preview;
|
return preview;
|
||||||
}
|
}
|
||||||
|
@ -73,7 +73,7 @@ impl FilePreviewer {
|
|||||||
///
|
///
|
||||||
/// # Panics
|
/// # Panics
|
||||||
/// Panics if seeking to the start of the file fails.
|
/// Panics if seeking to the start of the file fails.
|
||||||
pub async fn preview(&mut self, entry: &entry::Entry) -> Arc<Preview> {
|
pub fn preview(&mut self, entry: &entry::Entry) -> Arc<Preview> {
|
||||||
let path_buf = PathBuf::from(&entry.name);
|
let path_buf = PathBuf::from(&entry.name);
|
||||||
|
|
||||||
// do we have a preview in cache for that entry?
|
// do we have a preview in cache for that entry?
|
||||||
@ -87,8 +87,7 @@ impl FilePreviewer {
|
|||||||
{
|
{
|
||||||
debug!("File too large: {:?}", entry.name);
|
debug!("File too large: {:?}", entry.name);
|
||||||
let preview = meta::file_too_large(&entry.name);
|
let preview = meta::file_too_large(&entry.name);
|
||||||
self.cache_preview(entry.name.clone(), preview.clone())
|
self.cache_preview(entry.name.clone(), preview.clone());
|
||||||
.await;
|
|
||||||
return preview;
|
return preview;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -103,21 +102,18 @@ impl FilePreviewer {
|
|||||||
self.cache_preview(
|
self.cache_preview(
|
||||||
entry.name.clone(),
|
entry.name.clone(),
|
||||||
preview.clone(),
|
preview.clone(),
|
||||||
)
|
);
|
||||||
.await;
|
|
||||||
|
|
||||||
// compute the highlighted version in the background
|
// compute the highlighted version in the background
|
||||||
let mut reader = BufReader::new(file);
|
let mut reader = BufReader::new(file);
|
||||||
reader.seek(std::io::SeekFrom::Start(0)).unwrap();
|
reader.seek(std::io::SeekFrom::Start(0)).unwrap();
|
||||||
self.compute_highlighted_text_preview(entry, reader)
|
self.compute_highlighted_text_preview(entry, reader);
|
||||||
.await;
|
|
||||||
preview
|
preview
|
||||||
}
|
}
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
warn!("Error opening file: {:?}", e);
|
warn!("Error opening file: {:?}", e);
|
||||||
let p = meta::not_supported(&entry.name);
|
let p = meta::not_supported(&entry.name);
|
||||||
self.cache_preview(entry.name.clone(), p.clone())
|
self.cache_preview(entry.name.clone(), p.clone());
|
||||||
.await;
|
|
||||||
p
|
p
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -127,8 +123,7 @@ impl FilePreviewer {
|
|||||||
// insert a loading preview into the cache
|
// insert a loading preview into the cache
|
||||||
//let preview = loading(&entry.name);
|
//let preview = loading(&entry.name);
|
||||||
let preview = meta::not_supported(&entry.name);
|
let preview = meta::not_supported(&entry.name);
|
||||||
self.cache_preview(entry.name.clone(), preview.clone())
|
self.cache_preview(entry.name.clone(), preview.clone());
|
||||||
.await;
|
|
||||||
//// compute the image preview in the background
|
//// compute the image preview in the background
|
||||||
//self.compute_image_preview(entry).await;
|
//self.compute_image_preview(entry).await;
|
||||||
preview
|
preview
|
||||||
@ -136,15 +131,13 @@ impl FilePreviewer {
|
|||||||
FileType::Other => {
|
FileType::Other => {
|
||||||
debug!("Previewing other file: {:?}", entry.name);
|
debug!("Previewing other file: {:?}", entry.name);
|
||||||
let preview = meta::not_supported(&entry.name);
|
let preview = meta::not_supported(&entry.name);
|
||||||
self.cache_preview(entry.name.clone(), preview.clone())
|
self.cache_preview(entry.name.clone(), preview.clone());
|
||||||
.await;
|
|
||||||
preview
|
preview
|
||||||
}
|
}
|
||||||
FileType::Unknown => {
|
FileType::Unknown => {
|
||||||
debug!("Unknown file type: {:?}", entry.name);
|
debug!("Unknown file type: {:?}", entry.name);
|
||||||
let preview = meta::not_supported(&entry.name);
|
let preview = meta::not_supported(&entry.name);
|
||||||
self.cache_preview(entry.name.clone(), preview.clone())
|
self.cache_preview(entry.name.clone(), preview.clone());
|
||||||
.await;
|
|
||||||
preview
|
preview
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -172,7 +165,7 @@ impl FilePreviewer {
|
|||||||
// });
|
// });
|
||||||
//}
|
//}
|
||||||
|
|
||||||
async fn compute_highlighted_text_preview(
|
fn compute_highlighted_text_preview(
|
||||||
&self,
|
&self,
|
||||||
entry: &entry::Entry,
|
entry: &entry::Entry,
|
||||||
reader: BufReader<File>,
|
reader: BufReader<File>,
|
||||||
@ -267,7 +260,7 @@ impl FilePreviewer {
|
|||||||
file_type
|
file_type
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn cache_preview(&mut self, key: String, preview: Arc<Preview>) {
|
fn cache_preview(&mut self, key: String, preview: Arc<Preview>) {
|
||||||
self.cache.lock().insert(key, preview);
|
self.cache.lock().insert(key, preview);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,10 +1,7 @@
|
|||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use strum::Display;
|
|
||||||
|
|
||||||
/// The different actions that can be performed by the application.
|
/// The different actions that can be performed by the application.
|
||||||
#[derive(
|
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, Hash)]
|
||||||
Debug, Clone, PartialEq, Eq, Serialize, Deserialize, Display, Hash,
|
|
||||||
)]
|
|
||||||
pub enum Action {
|
pub enum Action {
|
||||||
// input actions
|
// input actions
|
||||||
/// Add a character to the input buffer.
|
/// Add a character to the input buffer.
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
|
use std::ops::Deref;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
use color_eyre::Result;
|
use color_eyre::Result;
|
||||||
use derive_deref::Deref;
|
|
||||||
use tokio::sync::{mpsc, Mutex};
|
use tokio::sync::{mpsc, Mutex};
|
||||||
use tracing::{debug, info};
|
use tracing::{debug, info};
|
||||||
|
|
||||||
@ -17,9 +17,16 @@ use crate::{
|
|||||||
use television_channels::channels::TelevisionChannel;
|
use television_channels::channels::TelevisionChannel;
|
||||||
use television_channels::entry::Entry;
|
use television_channels::entry::Entry;
|
||||||
|
|
||||||
#[derive(Deref, Default, Debug)]
|
#[derive(Default, Debug)]
|
||||||
pub struct Keymap(pub HashMap<Mode, HashMap<Key, Action>>);
|
pub struct Keymap(pub HashMap<Mode, HashMap<Key, Action>>);
|
||||||
|
|
||||||
|
impl Deref for Keymap {
|
||||||
|
type Target = HashMap<Mode, HashMap<Key, Action>>;
|
||||||
|
fn deref(&self) -> &Self::Target {
|
||||||
|
&self.0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl From<&KeyBindings> for Keymap {
|
impl From<&KeyBindings> for Keymap {
|
||||||
fn from(keybindings: &KeyBindings) -> Self {
|
fn from(keybindings: &KeyBindings) -> Self {
|
||||||
let mut keymap = HashMap::new();
|
let mut keymap = HashMap::new();
|
||||||
|
@ -156,7 +156,6 @@ mod tests {
|
|||||||
use crate::action::Action;
|
use crate::action::Action;
|
||||||
use crate::config::keybindings::parse_key;
|
use crate::config::keybindings::parse_key;
|
||||||
use crate::television::Mode;
|
use crate::television::Mode;
|
||||||
use pretty_assertions::assert_eq;
|
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_config() -> Result<()> {
|
fn test_config() -> Result<()> {
|
||||||
|
@ -2,13 +2,26 @@ use crate::action::Action;
|
|||||||
use crate::event::{convert_raw_event_to_key, Key};
|
use crate::event::{convert_raw_event_to_key, Key};
|
||||||
use crate::television::Mode;
|
use crate::television::Mode;
|
||||||
use crossterm::event::{KeyCode, KeyEvent, KeyModifiers};
|
use crossterm::event::{KeyCode, KeyEvent, KeyModifiers};
|
||||||
use derive_deref::{Deref, DerefMut};
|
|
||||||
use serde::{Deserialize, Deserializer};
|
use serde::{Deserialize, Deserializer};
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
|
use std::ops::{Deref, DerefMut};
|
||||||
|
|
||||||
#[derive(Clone, Debug, Default, Deref, DerefMut)]
|
#[derive(Clone, Debug, Default)]
|
||||||
pub struct KeyBindings(pub config::Map<Mode, config::Map<Action, Key>>);
|
pub struct KeyBindings(pub config::Map<Mode, config::Map<Action, Key>>);
|
||||||
|
|
||||||
|
impl Deref for KeyBindings {
|
||||||
|
type Target = config::Map<Mode, config::Map<Action, Key>>;
|
||||||
|
fn deref(&self) -> &Self::Target {
|
||||||
|
&self.0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl DerefMut for KeyBindings {
|
||||||
|
fn deref_mut(&mut self) -> &mut Self::Target {
|
||||||
|
&mut self.0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl<'de> Deserialize<'de> for KeyBindings {
|
impl<'de> Deserialize<'de> for KeyBindings {
|
||||||
fn deserialize<D>(deserializer: D) -> color_eyre::Result<Self, D::Error>
|
fn deserialize<D>(deserializer: D) -> color_eyre::Result<Self, D::Error>
|
||||||
where
|
where
|
||||||
|
@ -1,12 +1,27 @@
|
|||||||
use crate::television::Mode;
|
use crate::television::Mode;
|
||||||
use derive_deref::{Deref, DerefMut};
|
|
||||||
use ratatui::prelude::{Color, Modifier, Style};
|
use ratatui::prelude::{Color, Modifier, Style};
|
||||||
use serde::{Deserialize, Deserializer};
|
use serde::{Deserialize, Deserializer};
|
||||||
use std::collections::HashMap;
|
use std::{
|
||||||
|
collections::HashMap,
|
||||||
|
ops::{Deref, DerefMut},
|
||||||
|
};
|
||||||
|
|
||||||
#[derive(Clone, Debug, Default, Deref, DerefMut)]
|
#[derive(Clone, Debug, Default)]
|
||||||
pub struct Styles(pub HashMap<Mode, HashMap<String, Style>>);
|
pub struct Styles(pub HashMap<Mode, HashMap<String, Style>>);
|
||||||
|
|
||||||
|
impl Deref for Styles {
|
||||||
|
type Target = HashMap<Mode, HashMap<String, Style>>;
|
||||||
|
fn deref(&self) -> &Self::Target {
|
||||||
|
&self.0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl DerefMut for Styles {
|
||||||
|
fn deref_mut(&mut self) -> &mut Self::Target {
|
||||||
|
&mut self.0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl<'de> Deserialize<'de> for Styles {
|
impl<'de> Deserialize<'de> for Styles {
|
||||||
fn deserialize<D>(deserializer: D) -> color_eyre::Result<Self, D::Error>
|
fn deserialize<D>(deserializer: D) -> color_eyre::Result<Self, D::Error>
|
||||||
where
|
where
|
||||||
@ -147,33 +162,33 @@ mod tests {
|
|||||||
#[test]
|
#[test]
|
||||||
fn test_parse_style_default() {
|
fn test_parse_style_default() {
|
||||||
let style = parse_style("");
|
let style = parse_style("");
|
||||||
pretty_assertions::assert_eq!(style, Style::default());
|
assert_eq!(style, Style::default());
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_parse_style_foreground() {
|
fn test_parse_style_foreground() {
|
||||||
let style = parse_style("red");
|
let style = parse_style("red");
|
||||||
pretty_assertions::assert_eq!(style.fg, Some(Color::Indexed(1)));
|
assert_eq!(style.fg, Some(Color::Indexed(1)));
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_parse_style_background() {
|
fn test_parse_style_background() {
|
||||||
let style = parse_style("on blue");
|
let style = parse_style("on blue");
|
||||||
pretty_assertions::assert_eq!(style.bg, Some(Color::Indexed(4)));
|
assert_eq!(style.bg, Some(Color::Indexed(4)));
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_parse_style_modifiers() {
|
fn test_parse_style_modifiers() {
|
||||||
let style = parse_style("underline red on blue");
|
let style = parse_style("underline red on blue");
|
||||||
pretty_assertions::assert_eq!(style.fg, Some(Color::Indexed(1)));
|
assert_eq!(style.fg, Some(Color::Indexed(1)));
|
||||||
pretty_assertions::assert_eq!(style.bg, Some(Color::Indexed(4)));
|
assert_eq!(style.bg, Some(Color::Indexed(4)));
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_process_color_string() {
|
fn test_process_color_string() {
|
||||||
let (color, modifiers) =
|
let (color, modifiers) =
|
||||||
process_color_string("underline bold inverse gray");
|
process_color_string("underline bold inverse gray");
|
||||||
pretty_assertions::assert_eq!(color, "gray");
|
assert_eq!(color, "gray");
|
||||||
assert!(modifiers.contains(Modifier::UNDERLINED));
|
assert!(modifiers.contains(Modifier::UNDERLINED));
|
||||||
assert!(modifiers.contains(Modifier::BOLD));
|
assert!(modifiers.contains(Modifier::BOLD));
|
||||||
assert!(modifiers.contains(Modifier::REVERSED));
|
assert!(modifiers.contains(Modifier::REVERSED));
|
||||||
@ -183,12 +198,12 @@ mod tests {
|
|||||||
fn test_parse_color_rgb() {
|
fn test_parse_color_rgb() {
|
||||||
let color = parse_color("rgb123");
|
let color = parse_color("rgb123");
|
||||||
let expected = 16 + 36 + 2 * 6 + 3;
|
let expected = 16 + 36 + 2 * 6 + 3;
|
||||||
pretty_assertions::assert_eq!(color, Some(Color::Indexed(expected)));
|
assert_eq!(color, Some(Color::Indexed(expected)));
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_parse_color_unknown() {
|
fn test_parse_color_unknown() {
|
||||||
let color = parse_color("unknown");
|
let color = parse_color("unknown");
|
||||||
pretty_assertions::assert_eq!(color, None);
|
assert_eq!(color, None);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -33,7 +33,7 @@ pub fn init() -> Result<()> {
|
|||||||
eprintln!("{}", panic_hook.panic_report(panic_info)); // prints color-eyre stack trace to stderr
|
eprintln!("{}", panic_hook.panic_report(panic_info)); // prints color-eyre stack trace to stderr
|
||||||
}
|
}
|
||||||
let msg = format!("{}", panic_hook.panic_report(panic_info));
|
let msg = format!("{}", panic_hook.panic_report(panic_info));
|
||||||
error!("Error: {}", strip_ansi_escapes::strip_str(msg));
|
error!("Error: {}", msg);
|
||||||
|
|
||||||
#[cfg(debug_assertions)]
|
#[cfg(debug_assertions)]
|
||||||
{
|
{
|
||||||
@ -45,7 +45,7 @@ pub fn init() -> Result<()> {
|
|||||||
.create_panic_handler()(panic_info);
|
.create_panic_handler()(panic_info);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::process::exit(libc::EXIT_FAILURE);
|
std::process::exit(1);
|
||||||
}));
|
}));
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
use color_eyre::Result;
|
use color_eyre::Result;
|
||||||
use tracing_error::ErrorLayer;
|
|
||||||
use tracing_subscriber::{fmt, prelude::*, EnvFilter};
|
use tracing_subscriber::{fmt, prelude::*, EnvFilter};
|
||||||
|
|
||||||
use crate::config;
|
use crate::config;
|
||||||
@ -23,7 +22,6 @@ pub fn init() -> Result<()> {
|
|||||||
|
|
||||||
tracing_subscriber::registry()
|
tracing_subscriber::registry()
|
||||||
.with(file_subscriber)
|
.with(file_subscriber)
|
||||||
.with(ErrorLayer::default())
|
|
||||||
.try_init()?;
|
.try_init()?;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
@ -7,11 +7,9 @@ use crate::ui::spinner::SpinnerState;
|
|||||||
use crate::{action::Action, config::Config};
|
use crate::{action::Action, config::Config};
|
||||||
use color_eyre::Result;
|
use color_eyre::Result;
|
||||||
use copypasta::{ClipboardContext, ClipboardProvider};
|
use copypasta::{ClipboardContext, ClipboardProvider};
|
||||||
use futures::executor::block_on;
|
|
||||||
use ratatui::{layout::Rect, style::Color, widgets::Paragraph, Frame};
|
use ratatui::{layout::Rect, style::Color, widgets::Paragraph, Frame};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use strum::Display;
|
|
||||||
use television_channels::channels::{
|
use television_channels::channels::{
|
||||||
remote_control::RemoteControl, OnAir, TelevisionChannel, UnitChannel,
|
remote_control::RemoteControl, OnAir, TelevisionChannel, UnitChannel,
|
||||||
};
|
};
|
||||||
@ -21,9 +19,7 @@ use television_previewers::previewers::Previewer;
|
|||||||
use television_utils::strings::EMPTY_STRING;
|
use television_utils::strings::EMPTY_STRING;
|
||||||
use tokio::sync::mpsc::UnboundedSender;
|
use tokio::sync::mpsc::UnboundedSender;
|
||||||
|
|
||||||
#[derive(
|
#[derive(PartialEq, Copy, Clone, Hash, Eq, Debug, Serialize, Deserialize)]
|
||||||
PartialEq, Copy, Clone, Hash, Eq, Debug, Serialize, Deserialize, Display,
|
|
||||||
)]
|
|
||||||
pub enum Mode {
|
pub enum Mode {
|
||||||
Channel,
|
Channel,
|
||||||
RemoteControl,
|
RemoteControl,
|
||||||
@ -376,7 +372,7 @@ impl Television {
|
|||||||
///
|
///
|
||||||
/// # Returns
|
/// # Returns
|
||||||
/// * `Result<()>` - An Ok result or an error.
|
/// * `Result<()>` - An Ok result or an error.
|
||||||
pub fn draw(&mut self, f: &mut Frame, area: Rect) -> Result<()> {
|
pub fn draw(&mut self, f: &mut Frame<'_>, area: Rect) -> Result<()> {
|
||||||
let layout = Layout::build(
|
let layout = Layout::build(
|
||||||
&Dimensions::from(self.config.ui.ui_scale),
|
&Dimensions::from(self.config.ui.ui_scale),
|
||||||
area,
|
area,
|
||||||
@ -399,7 +395,7 @@ impl Television {
|
|||||||
let selected_entry = self
|
let selected_entry = self
|
||||||
.get_selected_entry(Some(Mode::Channel))
|
.get_selected_entry(Some(Mode::Channel))
|
||||||
.unwrap_or(ENTRY_PLACEHOLDER);
|
.unwrap_or(ENTRY_PLACEHOLDER);
|
||||||
let preview = block_on(self.previewer.preview(&selected_entry));
|
let preview = self.previewer.preview(&selected_entry);
|
||||||
|
|
||||||
// top right block: preview title
|
// top right block: preview title
|
||||||
self.current_preview_total_lines = preview.total_lines();
|
self.current_preview_total_lines = preview.total_lines();
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
use std::fmt::Display;
|
||||||
|
|
||||||
use ratatui::{
|
use ratatui::{
|
||||||
layout::Constraint,
|
layout::Constraint,
|
||||||
style::{Color, Style},
|
style::{Color, Style},
|
||||||
@ -5,12 +7,22 @@ use ratatui::{
|
|||||||
widgets::{Cell, Row, Table},
|
widgets::{Cell, Row, Table},
|
||||||
};
|
};
|
||||||
|
|
||||||
use crate::television::Television;
|
use crate::television::{Mode, Television};
|
||||||
use crate::ui::mode::mode_color;
|
use crate::ui::mode::mode_color;
|
||||||
|
|
||||||
const METADATA_FIELD_NAME_COLOR: Color = Color::DarkGray;
|
const METADATA_FIELD_NAME_COLOR: Color = Color::DarkGray;
|
||||||
const METADATA_FIELD_VALUE_COLOR: Color = Color::Gray;
|
const METADATA_FIELD_VALUE_COLOR: Color = Color::Gray;
|
||||||
|
|
||||||
|
impl Display for Mode {
|
||||||
|
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||||
|
match self {
|
||||||
|
Mode::Channel => write!(f, "Channel"),
|
||||||
|
Mode::RemoteControl => write!(f, "Remote Control"),
|
||||||
|
Mode::SendToChannel => write!(f, "Send to Channel"),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl Television {
|
impl Television {
|
||||||
pub fn build_metadata_table<'a>(&self) -> Table<'a> {
|
pub fn build_metadata_table<'a>(&self) -> Table<'a> {
|
||||||
let version_row = Row::new(vec![
|
let version_row = Row::new(vec![
|
||||||
|
Loading…
x
Reference in New Issue
Block a user