juxt 1.3.0__tar.gz → 1.4.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {juxt-1.3.0 → juxt-1.4.0}/PKG-INFO +27 -3
- {juxt-1.3.0 → juxt-1.4.0}/README.md +26 -2
- {juxt-1.3.0 → juxt-1.4.0}/juxt/__main__.py +113 -11
- {juxt-1.3.0 → juxt-1.4.0}/juxt/_version.py +2 -2
- {juxt-1.3.0 → juxt-1.4.0}/juxt/complete.py +4 -0
- juxt-1.4.0/juxt/detect.py +768 -0
- juxt-1.4.0/juxt/fuzzy.py +86 -0
- {juxt-1.3.0 → juxt-1.4.0}/juxt/loader.py +5 -1
- {juxt-1.3.0 → juxt-1.4.0}/juxt/settings.py +115 -4
- {juxt-1.3.0 → juxt-1.4.0}/juxt/viewer.py +899 -62
- juxt-1.3.0/juxt/detect.py +0 -470
- {juxt-1.3.0 → juxt-1.4.0}/.gitignore +0 -0
- {juxt-1.3.0 → juxt-1.4.0}/examples/sample_config.yaml +0 -0
- {juxt-1.3.0 → juxt-1.4.0}/juxt/__init__.py +0 -0
- {juxt-1.3.0 → juxt-1.4.0}/juxt/completion.bash +0 -0
- {juxt-1.3.0 → juxt-1.4.0}/juxt/config.py +0 -0
- {juxt-1.3.0 → juxt-1.4.0}/juxt/dialogs.py +0 -0
- {juxt-1.3.0 → juxt-1.4.0}/juxt/startup.py +0 -0
- {juxt-1.3.0 → juxt-1.4.0}/pyproject.toml +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: juxt
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.4.0
|
|
4
4
|
Summary: Fast desktop tool for navigating N-dimensional hypercubes of plots
|
|
5
5
|
Project-URL: Homepage, https://github.com/ColinMoldenhauer/juxt
|
|
6
6
|
Project-URL: Documentation, https://juxt.readthedocs.io
|
|
@@ -66,11 +66,26 @@ pip install juxt[ssh]
|
|
|
66
66
|
```bash
|
|
67
67
|
juxt /path/to/plots/ # auto-detect axes from a directory of images
|
|
68
68
|
juxt "plots/{sensor}_{date}.png" # explicit local template
|
|
69
|
+
juxt "plots/*.png" # wildcard match, recursing into subdirs
|
|
69
70
|
juxt myhost:/path/to/plots/ # remote directory over SSH
|
|
70
71
|
juxt "myhost:/path/{sensor}_{date}.png" # remote template over SSH
|
|
71
72
|
juxt config.yaml # explicit config file
|
|
72
73
|
```
|
|
73
74
|
|
|
75
|
+
A `*` in the path is matched recursively (unlike a shell glob, it reaches into nested subdirectories), and the matched files are split into axes the same way directory auto-detection is. Combine it with `--NAME VALUE ...` to pin a `{placeholder}` to a fixed set of directories and aggregate congruent files found under each:
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
juxt "{root}/*.png" --root run1 run2 # pool plots/*.png-style files found under run1/ and run2/
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
If you'd rather have one *named* axis for an arbitrarily deep (and possibly differently-shaped) subtree, instead of it being auto-split into several anonymous axes, write `{**name}` in place of a regular placeholder. It captures across `/`, and any leading path segments shared by every match are pruned out of the axis value and folded into the template as fixed text, so `dir/AM/plot.png` and `dir/PM/plot.png` become axis values `AM/plot` and `PM/plot` rather than the full `dir/AM/plot`:
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
juxt "{root}/{**plot}.png" --root run1 run2 # one 'plot' axis per run, however deep it's nested
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
`{**name}` is limited to one per template (two independent `/`-crossing captures in one path would be ambiguous), and pass `--full-path` to see the whole matched path instead of the pruned suffix.
|
|
88
|
+
|
|
74
89
|
For directory and remote-directory modes, filenames are split on separators (`_` and `/` by default) and any position with more than one distinct value becomes an axis. You'll be prompted to name the axes on first run; use `-a` to skip.
|
|
75
90
|
|
|
76
91
|
Run `juxt` with no argument and it opens a dialog instead: a **Browse** tab for picking a directory (auto-discover), and a **Build path** tab for typing a `{placeholder}` template by hand, with `Tab` completing real directories and files along the way.
|
|
@@ -144,6 +159,7 @@ Default mode is **tap**. Each axis is assigned one letter key — tap it to step
|
|
|
144
159
|
| lowercase letter | navigate +1 on that axis |
|
|
145
160
|
| uppercase letter | navigate −1 on that axis |
|
|
146
161
|
| `Ctrl`+letter | open value picker for that axis |
|
|
162
|
+
| | (`modifiers.swap: true` exchanges the `Ctrl` and `Shift` roles) |
|
|
147
163
|
| `Space` | toggle between current and previous position |
|
|
148
164
|
| `Home` / `End` | jump to first / last value |
|
|
149
165
|
| `1`–`9` | jump to the Nth value |
|
|
@@ -154,6 +170,8 @@ Use `:mode tap|seek|pin` in the command bar to switch navigation modes.
|
|
|
154
170
|
|
|
155
171
|
Press `:` to open the command bar (vim-style). Tab-completion narrows candidates as you type.
|
|
156
172
|
|
|
173
|
+
Matching is fuzzy: the characters you type only have to appear in order, so `:fh` reaches `fit-height` and `smp` finds `SMAP` in the value picker. Candidates are ranked best-first, prefix matches ahead of looser ones. Set `seek.fuzzy: false` in `~/.juxt/settings.yaml` for strict prefix matching.
|
|
174
|
+
|
|
157
175
|
Path arguments complete with `{placeholders}` in place: `:pattern plots/{sensor}/2⇥` lists what every sensor directory holds, so a template is built top-down instead of completing a concrete path and deleting the parts that should vary. `{` + `Tab` completes an existing axis name, and anonymous `{}` placeholders are numbered automatically.
|
|
158
176
|
|
|
159
177
|
## Shell completion
|
|
@@ -186,11 +204,13 @@ Placeholders standing for a known kind of value complete only as far as that val
|
|
|
186
204
|
| `:q` | quit |
|
|
187
205
|
| `:fit` | fit image to window |
|
|
188
206
|
| `:fit height` / `:fit width` | fit to height or width |
|
|
207
|
+
| `:fit-off` | stop fitting, keep the current zoom |
|
|
189
208
|
| `:zoom N` | set zoom to N% |
|
|
190
209
|
| `:fullscreen` | toggle fullscreen |
|
|
191
210
|
| `:mode tap\|seek\|pin` | switch navigation mode |
|
|
192
211
|
| `:grid [AXIS]` | tile an axis into a grid of viewports |
|
|
193
212
|
| `:grid AXIS VAL …` | grid with a value subset |
|
|
213
|
+
| `:keys` | toggle the shortcut sidebar (`Ctrl+Shift+K`) |
|
|
194
214
|
| `:grid-dialog` | open the grid builder dialogue (`Ctrl+Shift+G`) |
|
|
195
215
|
| `:grid-layout NxM` | change grid layout without exiting |
|
|
196
216
|
| `:ungrid` | return to single-image view |
|
|
@@ -212,6 +232,10 @@ Placeholders standing for a known kind of value complete only as far as that val
|
|
|
212
232
|
| Key | Action |
|
|
213
233
|
|---|---|
|
|
214
234
|
| `Enter` | toggle fullscreen |
|
|
215
|
-
| `Ctrl+Shift+
|
|
216
|
-
|
|
|
235
|
+
| `Ctrl+Shift+C` | copy the current image path to the clipboard |
|
|
236
|
+
| right-click | menu: copy image path / copy image |
|
|
237
|
+
| `Ctrl+Shift+H` | toggle status bar (start hidden with `--no-status-bar`) |
|
|
238
|
+
| `Ctrl+Shift+I` | toggle info sidebar (start open with `--info`) |
|
|
239
|
+
| `Ctrl+Shift+K` | toggle shortcut sidebar (start open with `--keys`) |
|
|
240
|
+
| `Ctrl+C` | copy the text selected in a sidebar (otherwise cancels a command / value picker) |
|
|
217
241
|
| `Ctrl+Shift+G` | open the grid builder dialogue |
|
|
@@ -33,11 +33,26 @@ pip install juxt[ssh]
|
|
|
33
33
|
```bash
|
|
34
34
|
juxt /path/to/plots/ # auto-detect axes from a directory of images
|
|
35
35
|
juxt "plots/{sensor}_{date}.png" # explicit local template
|
|
36
|
+
juxt "plots/*.png" # wildcard match, recursing into subdirs
|
|
36
37
|
juxt myhost:/path/to/plots/ # remote directory over SSH
|
|
37
38
|
juxt "myhost:/path/{sensor}_{date}.png" # remote template over SSH
|
|
38
39
|
juxt config.yaml # explicit config file
|
|
39
40
|
```
|
|
40
41
|
|
|
42
|
+
A `*` in the path is matched recursively (unlike a shell glob, it reaches into nested subdirectories), and the matched files are split into axes the same way directory auto-detection is. Combine it with `--NAME VALUE ...` to pin a `{placeholder}` to a fixed set of directories and aggregate congruent files found under each:
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
juxt "{root}/*.png" --root run1 run2 # pool plots/*.png-style files found under run1/ and run2/
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
If you'd rather have one *named* axis for an arbitrarily deep (and possibly differently-shaped) subtree, instead of it being auto-split into several anonymous axes, write `{**name}` in place of a regular placeholder. It captures across `/`, and any leading path segments shared by every match are pruned out of the axis value and folded into the template as fixed text, so `dir/AM/plot.png` and `dir/PM/plot.png` become axis values `AM/plot` and `PM/plot` rather than the full `dir/AM/plot`:
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
juxt "{root}/{**plot}.png" --root run1 run2 # one 'plot' axis per run, however deep it's nested
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
`{**name}` is limited to one per template (two independent `/`-crossing captures in one path would be ambiguous), and pass `--full-path` to see the whole matched path instead of the pruned suffix.
|
|
55
|
+
|
|
41
56
|
For directory and remote-directory modes, filenames are split on separators (`_` and `/` by default) and any position with more than one distinct value becomes an axis. You'll be prompted to name the axes on first run; use `-a` to skip.
|
|
42
57
|
|
|
43
58
|
Run `juxt` with no argument and it opens a dialog instead: a **Browse** tab for picking a directory (auto-discover), and a **Build path** tab for typing a `{placeholder}` template by hand, with `Tab` completing real directories and files along the way.
|
|
@@ -111,6 +126,7 @@ Default mode is **tap**. Each axis is assigned one letter key — tap it to step
|
|
|
111
126
|
| lowercase letter | navigate +1 on that axis |
|
|
112
127
|
| uppercase letter | navigate −1 on that axis |
|
|
113
128
|
| `Ctrl`+letter | open value picker for that axis |
|
|
129
|
+
| | (`modifiers.swap: true` exchanges the `Ctrl` and `Shift` roles) |
|
|
114
130
|
| `Space` | toggle between current and previous position |
|
|
115
131
|
| `Home` / `End` | jump to first / last value |
|
|
116
132
|
| `1`–`9` | jump to the Nth value |
|
|
@@ -121,6 +137,8 @@ Use `:mode tap|seek|pin` in the command bar to switch navigation modes.
|
|
|
121
137
|
|
|
122
138
|
Press `:` to open the command bar (vim-style). Tab-completion narrows candidates as you type.
|
|
123
139
|
|
|
140
|
+
Matching is fuzzy: the characters you type only have to appear in order, so `:fh` reaches `fit-height` and `smp` finds `SMAP` in the value picker. Candidates are ranked best-first, prefix matches ahead of looser ones. Set `seek.fuzzy: false` in `~/.juxt/settings.yaml` for strict prefix matching.
|
|
141
|
+
|
|
124
142
|
Path arguments complete with `{placeholders}` in place: `:pattern plots/{sensor}/2⇥` lists what every sensor directory holds, so a template is built top-down instead of completing a concrete path and deleting the parts that should vary. `{` + `Tab` completes an existing axis name, and anonymous `{}` placeholders are numbered automatically.
|
|
125
143
|
|
|
126
144
|
## Shell completion
|
|
@@ -153,11 +171,13 @@ Placeholders standing for a known kind of value complete only as far as that val
|
|
|
153
171
|
| `:q` | quit |
|
|
154
172
|
| `:fit` | fit image to window |
|
|
155
173
|
| `:fit height` / `:fit width` | fit to height or width |
|
|
174
|
+
| `:fit-off` | stop fitting, keep the current zoom |
|
|
156
175
|
| `:zoom N` | set zoom to N% |
|
|
157
176
|
| `:fullscreen` | toggle fullscreen |
|
|
158
177
|
| `:mode tap\|seek\|pin` | switch navigation mode |
|
|
159
178
|
| `:grid [AXIS]` | tile an axis into a grid of viewports |
|
|
160
179
|
| `:grid AXIS VAL …` | grid with a value subset |
|
|
180
|
+
| `:keys` | toggle the shortcut sidebar (`Ctrl+Shift+K`) |
|
|
161
181
|
| `:grid-dialog` | open the grid builder dialogue (`Ctrl+Shift+G`) |
|
|
162
182
|
| `:grid-layout NxM` | change grid layout without exiting |
|
|
163
183
|
| `:ungrid` | return to single-image view |
|
|
@@ -179,6 +199,10 @@ Placeholders standing for a known kind of value complete only as far as that val
|
|
|
179
199
|
| Key | Action |
|
|
180
200
|
|---|---|
|
|
181
201
|
| `Enter` | toggle fullscreen |
|
|
182
|
-
| `Ctrl+Shift+
|
|
183
|
-
|
|
|
202
|
+
| `Ctrl+Shift+C` | copy the current image path to the clipboard |
|
|
203
|
+
| right-click | menu: copy image path / copy image |
|
|
204
|
+
| `Ctrl+Shift+H` | toggle status bar (start hidden with `--no-status-bar`) |
|
|
205
|
+
| `Ctrl+Shift+I` | toggle info sidebar (start open with `--info`) |
|
|
206
|
+
| `Ctrl+Shift+K` | toggle shortcut sidebar (start open with `--keys`) |
|
|
207
|
+
| `Ctrl+C` | copy the text selected in a sidebar (otherwise cancels a command / value picker) |
|
|
184
208
|
| `Ctrl+Shift+G` | open the grid builder dialogue |
|
|
@@ -33,7 +33,9 @@ from .detect import (
|
|
|
33
33
|
_parse_remote_pattern,
|
|
34
34
|
detect_config,
|
|
35
35
|
detect_config_remote,
|
|
36
|
+
has_bare_wildcard,
|
|
36
37
|
prompt_rename,
|
|
38
|
+
resolve_wildcard_template,
|
|
37
39
|
)
|
|
38
40
|
from .loader import preload, preload_remote
|
|
39
41
|
from .settings import load_settings
|
|
@@ -118,16 +120,19 @@ def _print_help() -> None:
|
|
|
118
120
|
"Enter toggle fullscreen",
|
|
119
121
|
"Escape exit fullscreen / cancel",
|
|
120
122
|
": command mode (:fit :zoom N :q)",
|
|
121
|
-
"Ctrl+C cancel command /
|
|
123
|
+
"Ctrl+C copy sidebar selection, else cancel command / picker",
|
|
122
124
|
"Ctrl+Shift+H toggle status bar",
|
|
123
125
|
"Ctrl+Shift+I toggle info sidebar",
|
|
124
126
|
"Ctrl+Shift+G open the grid builder",
|
|
127
|
+
"Ctrl+Shift+C copy current image path",
|
|
128
|
+
"Ctrl+Shift+K toggle shortcut sidebar",
|
|
125
129
|
"",
|
|
126
130
|
"view controls",
|
|
127
131
|
None, # horizontal rule
|
|
128
132
|
"0 reset zoom to 100%",
|
|
129
133
|
"double-click fit image to window",
|
|
130
134
|
"drag pan the image",
|
|
135
|
+
"right-click copy path / image menu",
|
|
131
136
|
"wheel step the ←/→ axis",
|
|
132
137
|
"Shift+wheel step the ↑/↓ axis",
|
|
133
138
|
"Ctrl+wheel zoom under the cursor",
|
|
@@ -141,7 +146,9 @@ def _print_help() -> None:
|
|
|
141
146
|
" Ctrl+letter open value picker",
|
|
142
147
|
"",
|
|
143
148
|
"Key bindings are configurable in",
|
|
144
|
-
"~/.juxt/settings.yaml (also via :settings)
|
|
149
|
+
"~/.juxt/settings.yaml (also via :settings);",
|
|
150
|
+
"modifiers.swap there exchanges the Ctrl",
|
|
151
|
+
"and Shift roles on axis letter keys.",
|
|
145
152
|
"",
|
|
146
153
|
]
|
|
147
154
|
pad = 2
|
|
@@ -164,6 +171,10 @@ def _print_help() -> None:
|
|
|
164
171
|
/path/to/dir scan directory, detect axes from filenames
|
|
165
172
|
plots/{sensor}_{date}.png local template with explicit placeholders
|
|
166
173
|
plots/{}/{}.png anonymous placeholders, named axis_1, axis_2, …
|
|
174
|
+
plots/*.png wildcard match, recursing into subdirs
|
|
175
|
+
{root}/*.png --root A B pin {root} then wildcard-match within each
|
|
176
|
+
{root}/{**plot}.png {**name} captures across '/', for one axis
|
|
177
|
+
spanning an arbitrarily deep subtree
|
|
167
178
|
host:/path/to/dir remote directory over SSH (requires juxt[ssh])
|
|
168
179
|
host:/path/{sensor}.png remote template over SSH (requires juxt[ssh])
|
|
169
180
|
config.yaml explicit YAML config file
|
|
@@ -173,12 +184,29 @@ def _print_help() -> None:
|
|
|
173
184
|
-a, --auto skip axis naming prompt
|
|
174
185
|
--max-depth N max subdirectory search depth
|
|
175
186
|
--save PATH save resolved config to PATH after detection
|
|
187
|
+
--NAME VALUE [...] pin a {placeholder}'s values instead of
|
|
188
|
+
globbing for them (template/wildcard PATH
|
|
189
|
+
only, must come after PATH); repeatable per
|
|
190
|
+
placeholder; required for every {placeholder}
|
|
191
|
+
before a '*' wildcard
|
|
192
|
+
--full-path show a {**name} axis as the full path matched
|
|
193
|
+
instead of pruning the part shared by every
|
|
194
|
+
match (see {root}/{**plot}.png above)
|
|
176
195
|
--no-watch disable automatic file watching (local only)
|
|
177
196
|
--watch-interval SEC poll remote for changes every SEC seconds (default: 5, 0 to disable)
|
|
178
197
|
--axis-h NAME lock ←/→ to this axis on startup
|
|
179
198
|
--axis-v NAME lock ↑/↓ to this axis on startup
|
|
180
199
|
--squeeze drop axes with only one value
|
|
181
|
-
--name NAME session name shown in window title (default: template
|
|
200
|
+
--name NAME session name shown in window title (default: the template path
|
|
201
|
+
and any pinned values)
|
|
202
|
+
|
|
203
|
+
panels (toggled at runtime with Ctrl+Shift+I / Ctrl+Shift+H / Ctrl+Shift+K)
|
|
204
|
+
--info start with the info sidebar open (default: closed)
|
|
205
|
+
--no-info start with the info sidebar closed
|
|
206
|
+
--status-bar start with the status bar shown (default: shown)
|
|
207
|
+
--no-status-bar start with the status bar hidden
|
|
208
|
+
--keys start with the shortcut sidebar open (default: closed)
|
|
209
|
+
--no-keys start with the shortcut sidebar closed
|
|
182
210
|
|
|
183
211
|
grid view
|
|
184
212
|
--grid AXIS enter grid view for AXIS on startup
|
|
@@ -193,17 +221,49 @@ def _print_help() -> None:
|
|
|
193
221
|
eval "$(juxt --bash-completion)" complete options and {placeholder} paths
|
|
194
222
|
|
|
195
223
|
commands (press : in the viewer, Tab completes)
|
|
196
|
-
:fit :fit-width :fit-height :zoom N :fullscreen
|
|
224
|
+
:fit :fit-width :fit-height :fit-off :zoom N :fullscreen
|
|
197
225
|
:grid AXIS [VALUES|NxM] :grid-dialog :grid-layout NxM :ungrid
|
|
198
226
|
:grid-sharex on|off :grid-sharey on|off
|
|
199
227
|
:axis-h NAME :axis-v NAME :axis-auto :swap-axes
|
|
200
|
-
:mode tap|seek|pin :switch-last :info
|
|
228
|
+
:mode tap|seek|pin :switch-last :info :keys
|
|
201
229
|
:pattern PATH :reload :watch true|false
|
|
202
230
|
:remove-axis NAME :remove-value AXIS VALUE
|
|
203
231
|
:change-key AXIS LETTER :settings
|
|
204
232
|
:copy-image :copy-path :write [PATH] :quit""")
|
|
205
233
|
|
|
206
234
|
|
|
235
|
+
def _parse_axis_pins(unknown: list[str]) -> dict[str, list[str]]:
|
|
236
|
+
"""Turn leftover argv (`['--sensor', 'A', 'B', '--date', 'X']`) into
|
|
237
|
+
`{'sensor': ['A', 'B'], 'date': ['X']}`.
|
|
238
|
+
|
|
239
|
+
Axis names are taken verbatim, unlike a generic flag-to-kwarg grabber,
|
|
240
|
+
since a {placeholder} name may itself contain hyphens (e.g. {yyyy-mm-dd}).
|
|
241
|
+
Must appear after PATH on the command line — argparse would otherwise
|
|
242
|
+
swallow a pinned value as PATH before it ever sees the real one.
|
|
243
|
+
"""
|
|
244
|
+
pins: dict[str, list[str]] = {}
|
|
245
|
+
current: str | None = None
|
|
246
|
+
for arg in unknown:
|
|
247
|
+
if arg.startswith("--"):
|
|
248
|
+
current = arg[2:]
|
|
249
|
+
if not current:
|
|
250
|
+
raise SystemExit(f"Unexpected argument {arg!r}")
|
|
251
|
+
if current in pins:
|
|
252
|
+
raise SystemExit(f"Duplicate axis flag: --{current}")
|
|
253
|
+
pins[current] = []
|
|
254
|
+
else:
|
|
255
|
+
if current is None:
|
|
256
|
+
raise SystemExit(
|
|
257
|
+
f"Unrecognized argument {arg!r}. To pin a {{placeholder}}'s "
|
|
258
|
+
f"values, use '--NAME VALUE ...' after PATH."
|
|
259
|
+
)
|
|
260
|
+
pins[current].append(arg)
|
|
261
|
+
for name, values in pins.items():
|
|
262
|
+
if not values:
|
|
263
|
+
raise SystemExit(f"--{name} was given no values to pin.")
|
|
264
|
+
return pins
|
|
265
|
+
|
|
266
|
+
|
|
207
267
|
class _HelpAction(argparse.Action):
|
|
208
268
|
def __init__(self, option_strings, dest=argparse.SUPPRESS,
|
|
209
269
|
default=argparse.SUPPRESS, help=None):
|
|
@@ -215,7 +275,7 @@ class _HelpAction(argparse.Action):
|
|
|
215
275
|
parser.exit()
|
|
216
276
|
|
|
217
277
|
|
|
218
|
-
def _parse_args() -> argparse.Namespace:
|
|
278
|
+
def _parse_args() -> tuple[argparse.Namespace, dict[str, list[str]]]:
|
|
219
279
|
p = argparse.ArgumentParser(prog="juxt", add_help=False)
|
|
220
280
|
p.add_argument("path", nargs="?", default=None, metavar="PATH")
|
|
221
281
|
p.add_argument("-s", "--separator", metavar="SEP", nargs="+")
|
|
@@ -228,6 +288,16 @@ def _parse_args() -> argparse.Namespace:
|
|
|
228
288
|
p.add_argument("--axis-v", metavar="NAME", default=None)
|
|
229
289
|
p.add_argument("--squeeze", action="store_true", default=False)
|
|
230
290
|
p.add_argument("--name", metavar="NAME", default=None)
|
|
291
|
+
p.add_argument("--full-path", action="store_true", default=False)
|
|
292
|
+
# Initial panel visibility; both are still toggleable at runtime.
|
|
293
|
+
# These are declared here so parse_known_args recognises them; an
|
|
294
|
+
# unrecognised --flag after PATH is read as an axis pin instead.
|
|
295
|
+
p.add_argument("--info", dest="info", action="store_true", default=False)
|
|
296
|
+
p.add_argument("--no-info", dest="info", action="store_false")
|
|
297
|
+
p.add_argument("--status-bar", dest="status_bar", action="store_true", default=True)
|
|
298
|
+
p.add_argument("--no-status-bar", dest="status_bar", action="store_false")
|
|
299
|
+
p.add_argument("--keys", dest="keys", action="store_true", default=False)
|
|
300
|
+
p.add_argument("--no-keys", dest="keys", action="store_false")
|
|
231
301
|
|
|
232
302
|
g = p.add_argument_group("grid view")
|
|
233
303
|
g.add_argument("--grid", metavar="AXIS", default=None)
|
|
@@ -237,11 +307,16 @@ def _parse_args() -> argparse.Namespace:
|
|
|
237
307
|
g.add_argument("--no-sharey", action="store_true", default=False)
|
|
238
308
|
|
|
239
309
|
p.add_argument("-h", "--help", action=_HelpAction)
|
|
240
|
-
|
|
310
|
+
|
|
311
|
+
# Any flag not recognized above and appearing after PATH is treated as
|
|
312
|
+
# '--{placeholder} VALUE ...', pinning that template placeholder to an
|
|
313
|
+
# explicit value list instead of discovering it by globbing.
|
|
314
|
+
args, unknown = p.parse_known_args()
|
|
315
|
+
return args, _parse_axis_pins(unknown)
|
|
241
316
|
|
|
242
317
|
|
|
243
318
|
def main():
|
|
244
|
-
args = _parse_args()
|
|
319
|
+
args, pins = _parse_args()
|
|
245
320
|
import os
|
|
246
321
|
_setup_logging(
|
|
247
322
|
os.environ.get("JUXT_LOG_LEVEL", "WARNING").upper(),
|
|
@@ -308,25 +383,41 @@ def main():
|
|
|
308
383
|
if _is_remote_pattern(raw):
|
|
309
384
|
remote_cfg, remote_tmpl = _parse_remote_pattern(raw)
|
|
310
385
|
if '{' in remote_tmpl:
|
|
311
|
-
axes = _axes_from_remote_template(remote_tmpl, remote_cfg, _ask_password)
|
|
386
|
+
axes = _axes_from_remote_template(remote_tmpl, remote_cfg, _ask_password, pinned=pins)
|
|
312
387
|
config = Config(template=remote_tmpl, axes=axes,
|
|
313
388
|
keys=_auto_keys(axes), remote=remote_cfg)
|
|
314
389
|
else:
|
|
390
|
+
if pins:
|
|
391
|
+
raise ValueError(
|
|
392
|
+
"--<axis> VALUE pinning requires a {placeholder} template, "
|
|
393
|
+
"not a plain remote directory"
|
|
394
|
+
)
|
|
315
395
|
config, sep, n_remote = detect_config_remote(
|
|
316
396
|
remote_tmpl, remote_cfg, args.separator, _ask_password)
|
|
317
397
|
if not args.auto:
|
|
318
398
|
config = prompt_rename(config, n_remote, sep)
|
|
319
399
|
elif Path(raw).is_dir():
|
|
400
|
+
if pins:
|
|
401
|
+
raise ValueError(
|
|
402
|
+
"--<axis> VALUE pinning requires a {placeholder} template, not a directory"
|
|
403
|
+
)
|
|
320
404
|
p = Path(raw)
|
|
321
405
|
files = _iter_images(p, args.max_depth)
|
|
322
406
|
config, sep = detect_config(p, args.separator, args.max_depth)
|
|
323
407
|
if not args.auto:
|
|
324
408
|
config = prompt_rename(config, len(files), sep, p, args.max_depth)
|
|
325
409
|
elif raw.lower().endswith((".yaml", ".yml")):
|
|
410
|
+
if pins:
|
|
411
|
+
raise ValueError(
|
|
412
|
+
"--<axis> VALUE pinning requires a {placeholder} template, not a YAML config"
|
|
413
|
+
)
|
|
326
414
|
config = load_config(raw)
|
|
415
|
+
elif has_bare_wildcard(raw):
|
|
416
|
+
template, axes = resolve_wildcard_template(raw, pinned=pins)
|
|
417
|
+
config = Config(template=template, axes=axes, keys=_auto_keys(axes))
|
|
327
418
|
elif '{' in raw:
|
|
328
|
-
axes = _axes_from_local_template(raw)
|
|
329
|
-
config = Config(template=
|
|
419
|
+
template, axes = _axes_from_local_template(raw, pinned=pins, full_path=args.full_path)
|
|
420
|
+
config = Config(template=template, axes=axes, keys=_auto_keys(axes))
|
|
330
421
|
else:
|
|
331
422
|
print(
|
|
332
423
|
f"Error: {raw!r} is not a directory, YAML config, "
|
|
@@ -467,15 +558,26 @@ def main():
|
|
|
467
558
|
axis_h=args.axis_h,
|
|
468
559
|
axis_v=args.axis_v,
|
|
469
560
|
session_name=args.name,
|
|
561
|
+
pinned_axes=list(pins),
|
|
470
562
|
seek_greedy=settings.seek_greedy,
|
|
563
|
+
seek_fuzzy=settings.seek_fuzzy,
|
|
564
|
+
swap_modifiers=settings.swap_modifiers,
|
|
565
|
+
skip_missing=settings.skip_missing,
|
|
566
|
+
dim_missing=settings.dim_missing,
|
|
567
|
+
sidebar_copy=settings.sidebar_copy,
|
|
471
568
|
keybindings=settings.keybindings,
|
|
472
569
|
highlight=settings.highlight,
|
|
473
570
|
highlight_candidates=settings.highlight_candidates,
|
|
571
|
+
sidebar_separator=settings.sidebar_separator,
|
|
572
|
+
sidebar_list_larger_than=settings.sidebar_list_larger_than,
|
|
474
573
|
grid=args.grid,
|
|
475
574
|
grid_values=args.grid_values,
|
|
476
575
|
grid_layout=grid_layout,
|
|
477
576
|
grid_sharex=not args.no_sharex,
|
|
478
577
|
grid_sharey=not args.no_sharey,
|
|
578
|
+
show_info=args.info,
|
|
579
|
+
show_status_bar=args.status_bar,
|
|
580
|
+
show_keys=args.keys,
|
|
479
581
|
)
|
|
480
582
|
window.move(_startup_screen.geometry().topLeft())
|
|
481
583
|
window.showMaximized()
|
|
@@ -18,7 +18,7 @@ version_tuple: tuple[int | str, ...]
|
|
|
18
18
|
commit_id: str | None
|
|
19
19
|
__commit_id__: str | None
|
|
20
20
|
|
|
21
|
-
__version__ = version = '1.
|
|
22
|
-
__version_tuple__ = version_tuple = (1,
|
|
21
|
+
__version__ = version = '1.4.0'
|
|
22
|
+
__version_tuple__ = version_tuple = (1, 4, 0)
|
|
23
23
|
|
|
24
24
|
__commit_id__ = commit_id = None
|
|
@@ -476,12 +476,16 @@ CLI_OPTIONS = [
|
|
|
476
476
|
"-h", "--help",
|
|
477
477
|
"-s", "--separator",
|
|
478
478
|
"--axis-h", "--axis-v",
|
|
479
|
+
"--full-path",
|
|
479
480
|
"--grid", "--grid-layout", "--grid-values",
|
|
481
|
+
"--info", "--no-info",
|
|
482
|
+
"--keys", "--no-keys",
|
|
480
483
|
"--max-depth",
|
|
481
484
|
"--name",
|
|
482
485
|
"--no-sharex", "--no-sharey", "--no-watch",
|
|
483
486
|
"--save",
|
|
484
487
|
"--squeeze",
|
|
488
|
+
"--status-bar", "--no-status-bar",
|
|
485
489
|
"--watch-interval",
|
|
486
490
|
]
|
|
487
491
|
|