spacr.qt.dnd_handlers¶
Per-module drop handlers.
Each pipeline app has different expectations for what a “source”
means. This module encodes those policies as DropHandler
subclasses that the AppScreen wires up at construction time.
Handler map (also read by get_handler):
App |
Accepts |
|---|---|
mask measure external_masks annotate classify make_masks map_barcodes umap ml_analyze regression recruitment activation analyze_plaques train_cellpose cellpose_masks cellpose_all other modules |
folder w/ images (auto-parses regex + preview)
folder named |
Every handler falls back to CSV settings-import via spacr.qt.dnd
so users can also drop a settings CSV on any screen to load it.
Attributes¶
Classes¶
Use a dropped image folder (or one tile) as Align & Stitch input. |
|
Accept a plate folder with |
|
Load queue files or add dropped settings snapshots as jobs. |
|
Accept a plate folder with |
|
Prediction Profiler: the regression coefficients under |
|
Use a dropped microscopy container or folder as converter input. |
|
Data Manager: set the project, then measure it. |
|
Open a dropped measurements database in the Database Browser. |
|
Classifier Evaluation: the run folder holding the evaluation bundle. |
|
Append mixed intensity images and external label masks to the mapper. |
|
Populate Import Project from image folders, tables and mapping files. |
|
Image-folder input shared by Model Compare. |
|
Curate and Napari Bridge: one label mask, from wherever you drop. |
|
Layer Viewer: the dropped array, added as an image or as labels. |
|
Drop policy for a screen that names what it wants, not where it is. |
|
Lineage: a database path field and one load. |
|
Accept a folder with images (or image+mask pairs). |
|
Accept a FASTQ file ( |
|
Accept a folder of raw microscopy images and preview its filename |
|
Accept the |
|
Accept a database, its measurements folder, or its plate folder. |
|
Methods & Results: fill whichever of its four source fields fits. |
|
Scan checkpoints, or use image-only folders as benchmark fields. |
|
Queue plate folders that carry spaCR settings snapshots. |
|
A screen that takes a whole project, wherever inside it you drop. |
|
Project Browser: several folders at once, each becoming a root. |
|
Accept a completed spaCR run folder and scan its report inputs. |
|
Database input for Plate Viewer and Annotator Agreement. |
|
Hit List: the |
|
Run History: select the run a dropped run folder belongs to. |
|
Image Scatter: a path field, a table picker, then the read. |
|
General source-path policy for modules without a narrower contract. |
|
Distributed Jobs: a settings snapshot to submit, or the plate with one. |
|
A screen that reads one table: the explorers, the plotters, the gates. |
|
Accept a directory and asynchronously scan it for training runs. |
Functions¶
|
How many folder-scan threads |
|
Return a fresh DropHandler for |
|
Walk a dropped folder ONCE and return the folder-metadata report. |
|
True while a dropped folder is still being walked for |
|
List the top level of a dropped folder once. Worker-safe. |
|
Return the tables in a SQLite file, or |
Module Contents¶
- class spacr.qt.dnd_handlers.AlignDropHandler[source]¶
Bases:
spacr.qt.dnd.DropHandlerUse a dropped image folder (or one tile) as Align & Stitch input.
- apply(path: pathlib.Path, screen) None[source]¶
Wire
pathintoscreen(set src, populate settings, etc.).
- can_accept(path: pathlib.Path) bool[source]¶
Return True if
path(folder OR file) is usable as-is.
- error_message(path: pathlib.Path) str[source]¶
Human-friendly explanation for why
pathcan’t be used.
- class spacr.qt.dnd_handlers.AnnotateDropHandler[source]¶
Bases:
spacr.qt.dnd.DropHandlerAccept a plate folder with
measurements/measurements.dbor the .db file itself.- apply(path: pathlib.Path, screen) None[source]¶
Wire
pathintoscreen(set src, populate settings, etc.).
- can_accept(path: pathlib.Path) bool[source]¶
Return True if
path(folder OR file) is usable as-is.
- error_message(path: pathlib.Path) str[source]¶
Human-friendly explanation for why
pathcan’t be used.
- class spacr.qt.dnd_handlers.BatchDropHandler[source]¶
Bases:
spacr.qt.dnd.DropHandlerLoad queue files or add dropped settings snapshots as jobs.
- apply(path: pathlib.Path, screen) None[source]¶
Wire
pathintoscreen(set src, populate settings, etc.).
- can_accept(path: pathlib.Path) bool[source]¶
Return True if
path(folder OR file) is usable as-is.
- error_message(path: pathlib.Path) str[source]¶
Human-friendly explanation for why
pathcan’t be used.
- class spacr.qt.dnd_handlers.ClassifyDropHandler[source]¶
Bases:
spacr.qt.dnd.DropHandlerAccept a plate folder with
measurements/measurements.dbor a folder produced by the annotate step.- apply(path: pathlib.Path, screen) None[source]¶
Wire
pathintoscreen(set src, populate settings, etc.).
- can_accept(path: pathlib.Path) bool[source]¶
Return True if
path(folder OR file) is usable as-is.
- error_message(path: pathlib.Path) str[source]¶
Human-friendly explanation for why
pathcan’t be used.
- class spacr.qt.dnd_handlers.CoefficientsDropHandler(app_key: str = '')[source]¶
Bases:
LayoutDropHandlerPrediction Profiler: the regression coefficients under
results/.- deliver(screen, value: str, target) None[source]¶
Put
valueinto the screen. Runs on the GUI thread.- Parameters:
screen – the screen the drop landed on.
value – the resolved path.
target – the
spacr.chaining.DropTargetit came from, or None for a file the user dropped directly.
- class spacr.qt.dnd_handlers.ConvertDropHandler[source]¶
Bases:
spacr.qt.dnd.DropHandlerUse a dropped microscopy container or folder as converter input.
- apply(path: pathlib.Path, screen) None[source]¶
Wire
pathintoscreen(set src, populate settings, etc.).
- can_accept(path: pathlib.Path) bool[source]¶
Return True if
path(folder OR file) is usable as-is.
- error_message(path: pathlib.Path) str[source]¶
Human-friendly explanation for why
pathcan’t be used.
- class spacr.qt.dnd_handlers.DataManagerDropHandler(app_key: str = '')[source]¶
Bases:
ProjectFolderDropHandlerData Manager: set the project, then measure it.
- deliver(screen, value: str, target) None[source]¶
Put
valueinto the screen. Runs on the GUI thread.- Parameters:
screen – the screen the drop landed on.
value – the resolved path.
target – the
spacr.chaining.DropTargetit came from, or None for a file the user dropped directly.
- class spacr.qt.dnd_handlers.DatabaseDropHandler[source]¶
Bases:
spacr.qt.dnd.DropHandlerOpen a dropped measurements database in the Database Browser.
- apply(path: pathlib.Path, screen) None[source]¶
Wire
pathintoscreen(set src, populate settings, etc.).
- can_accept(path: pathlib.Path) bool[source]¶
Return True if
path(folder OR file) is usable as-is.
- error_message(path: pathlib.Path) str[source]¶
Human-friendly explanation for why
pathcan’t be used.
- class spacr.qt.dnd_handlers.EvaluationBundleDropHandler(app_key: str = '')[source]¶
Bases:
LayoutDropHandlerClassifier Evaluation: the run folder holding the evaluation bundle.
- apply(path: pathlib.Path, screen) None[source]¶
Wire
pathintoscreen(set src, populate settings, etc.).
- can_accept(path: pathlib.Path) bool[source]¶
Return True if
path(folder OR file) is usable as-is.
- deliver(screen, value: str, target) None[source]¶
Put
valueinto the screen. Runs on the GUI thread.- Parameters:
screen – the screen the drop landed on.
value – the resolved path.
target – the
spacr.chaining.DropTargetit came from, or None for a file the user dropped directly.
- class spacr.qt.dnd_handlers.ExternalMasksDropHandler[source]¶
Bases:
spacr.qt.dnd.DropHandlerAppend mixed intensity images and external label masks to the mapper.
- apply(path: pathlib.Path, screen) None[source]¶
Wire
pathintoscreen(set src, populate settings, etc.).
- can_accept(path: pathlib.Path) bool[source]¶
Return True if
path(folder OR file) is usable as-is.
- error_message(path: pathlib.Path) str[source]¶
Human-friendly explanation for why
pathcan’t be used.
- class spacr.qt.dnd_handlers.ForeignProjectDropHandler[source]¶
Bases:
spacr.qt.dnd.DropHandlerPopulate Import Project from image folders, tables and mapping files.
- apply(path: pathlib.Path, screen) None[source]¶
Wire
pathintoscreen(set src, populate settings, etc.).
- can_accept(path: pathlib.Path) bool[source]¶
Return True if
path(folder OR file) is usable as-is.
- error_message(path: pathlib.Path) str[source]¶
Human-friendly explanation for why
pathcan’t be used.
- class spacr.qt.dnd_handlers.ImageFieldsDropHandler[source]¶
Bases:
spacr.qt.dnd.DropHandlerImage-folder input shared by Model Compare.
- apply(path: pathlib.Path, screen) None[source]¶
Wire
pathintoscreen(set src, populate settings, etc.).
- can_accept(path: pathlib.Path) bool[source]¶
Return True if
path(folder OR file) is usable as-is.
- error_message(path: pathlib.Path) str[source]¶
Human-friendly explanation for why
pathcan’t be used.
- class spacr.qt.dnd_handlers.LabelMaskDropHandler(app_key: str = '')[source]¶
Bases:
LayoutDropHandlerCurate and Napari Bridge: one label mask, from wherever you drop.
Dropping the project resolves
masks/; a folder of masks is not one mask, so the file is asked for rather than guessed at.- deliver(screen, value: str, target) None[source]¶
Put
valueinto the screen. Runs on the GUI thread.- Parameters:
screen – the screen the drop landed on.
value – the resolved path.
target – the
spacr.chaining.DropTargetit came from, or None for a file the user dropped directly.
- class spacr.qt.dnd_handlers.LayerStackDropHandler(app_key: str = '')[source]¶
Bases:
LabelMaskDropHandlerLayer Viewer: the dropped array, added as an image or as labels.
A viewer stacks layers, so a multi-drop of an image and its mask lands as two layers rather than as the first one.
- deliver(screen, value: str, target) None[source]¶
Put
valueinto the screen. Runs on the GUI thread.- Parameters:
screen – the screen the drop landed on.
value – the resolved path.
target – the
spacr.chaining.DropTargetit came from, or None for a file the user dropped directly.
- class spacr.qt.dnd_handlers.LayoutDropHandler(app_key: str = '')[source]¶
Bases:
spacr.qt.dnd.DropHandlerDrop policy for a screen that names what it wants, not where it is.
A subclass says two things: the vocabulary terms it consumes (
kinds, fromspacr.ports.ALL_KINDS) and what to do with the answer (deliver()). Everything between — climbing from the dropped path to the project root, asking the registry, falling back to the declared layout, noticing that the answer is ambiguous — isspacr.chaining.resolve_drop().Ambiguity is routed through the machinery
spacr.qt.dndalready has: an ambiguous drop reportscan_accept() is Falseand returns the candidates fromsuggest_alternatives(), so the user gets the “did you mean…” chooser andapply()is called again with their answer. A drop that resolves to nothing reportsspacr.chaining.DropResolution.reason, which isspacr.ports.check_ready()’s own sentence about what is missing.- apply(path: pathlib.Path, screen) None[source]¶
Wire
pathintoscreen(set src, populate settings, etc.).
- can_accept(path: pathlib.Path) bool[source]¶
Return True if
path(folder OR file) is usable as-is.
- abstract deliver(screen, value: str, target) None[source]¶
Put
valueinto the screen. Runs on the GUI thread.- Parameters:
screen – the screen the drop landed on.
value – the resolved path.
target – the
spacr.chaining.DropTargetit came from, or None for a file the user dropped directly.
- error_message(path: pathlib.Path) str[source]¶
Human-friendly explanation for why
pathcan’t be used.
- resolve(path: pathlib.Path)[source]¶
Return the
spacr.chaining.DropResolutionforpath.
- suggest_alternatives(path: pathlib.Path) List[pathlib.Path][source]¶
When
can_acceptreturns False, return sibling/child folders that WOULD be accepted so the UI can prompt “did you mean…”.Default: no suggestions.
- class spacr.qt.dnd_handlers.LineageDropHandler(app_key: str = '')[source]¶
Bases:
TableDropHandlerLineage: a database path field and one load.
- deliver(screen, value: str, target) None[source]¶
Put
valueinto the screen. Runs on the GUI thread.- Parameters:
screen – the screen the drop landed on.
value – the resolved path.
target – the
spacr.chaining.DropTargetit came from, or None for a file the user dropped directly.
- class spacr.qt.dnd_handlers.MakeMasksDropHandler[source]¶
Bases:
spacr.qt.dnd.DropHandlerAccept a folder with images (or image+mask pairs).
- apply(path: pathlib.Path, screen) None[source]¶
Wire
pathintoscreen(set src, populate settings, etc.).
- can_accept(path: pathlib.Path) bool[source]¶
Return True if
path(folder OR file) is usable as-is.
- error_message(path: pathlib.Path) str[source]¶
Human-friendly explanation for why
pathcan’t be used.
- suggest_alternatives(path: pathlib.Path) List[pathlib.Path][source]¶
When
can_acceptreturns False, return sibling/child folders that WOULD be accepted so the UI can prompt “did you mean…”.Default: no suggestions.
- class spacr.qt.dnd_handlers.MapBarcodesDropHandler[source]¶
Bases:
spacr.qt.dnd.DropHandlerAccept a FASTQ file (
.fastq/.fastq.gz) or a folder containing one.- apply(path: pathlib.Path, screen) None[source]¶
Wire
pathintoscreen(set src, populate settings, etc.).
- can_accept(path: pathlib.Path) bool[source]¶
Return True if
path(folder OR file) is usable as-is.
- error_message(path: pathlib.Path) str[source]¶
Human-friendly explanation for why
pathcan’t be used.
- class spacr.qt.dnd_handlers.MaskDropHandler[source]¶
Bases:
spacr.qt.dnd.DropHandlerAccept a folder of raw microscopy images and preview its filename regex parse. Multi-drop is supported.
- apply(path: pathlib.Path, screen) None[source]¶
Wire
pathintoscreen(set src, populate settings, etc.).
- can_accept(path: pathlib.Path) bool[source]¶
Return True if
path(folder OR file) is usable as-is.
- error_message(path: pathlib.Path) str[source]¶
Human-friendly explanation for why
pathcan’t be used.
- suggest_alternatives(path: pathlib.Path) List[pathlib.Path][source]¶
When
can_acceptreturns False, return sibling/child folders that WOULD be accepted so the UI can prompt “did you mean…”.Default: no suggestions.
- class spacr.qt.dnd_handlers.MeasureDropHandler[source]¶
Bases:
spacr.qt.dnd.DropHandlerAccept the
mergedfolder produced by the mask module, or a parent folder that contains one.- apply(path: pathlib.Path, screen) None[source]¶
Wire
pathintoscreen(set src, populate settings, etc.).
- can_accept(path: pathlib.Path) bool[source]¶
Return True if
path(folder OR file) is usable as-is.
- error_message(path: pathlib.Path) str[source]¶
Human-friendly explanation for why
pathcan’t be used.
- suggest_alternatives(path: pathlib.Path) List[pathlib.Path][source]¶
When
can_acceptreturns False, return sibling/child folders that WOULD be accepted so the UI can prompt “did you mean…”.Default: no suggestions.
- class spacr.qt.dnd_handlers.MeasurementsDropHandler[source]¶
Bases:
spacr.qt.dnd.DropHandlerAccept a database, its measurements folder, or its plate folder.
- apply(path: pathlib.Path, screen) None[source]¶
Wire
pathintoscreen(set src, populate settings, etc.).
- can_accept(path: pathlib.Path) bool[source]¶
Return True if
path(folder OR file) is usable as-is.
- error_message(path: pathlib.Path) str[source]¶
Human-friendly explanation for why
pathcan’t be used.
- class spacr.qt.dnd_handlers.MethodsSourcesDropHandler(app_key: str = '')[source]¶
Bases:
LayoutDropHandlerMethods & Results: fill whichever of its four source fields fits.
- apply(path: pathlib.Path, screen) None[source]¶
Wire
pathintoscreen(set src, populate settings, etc.).
- can_accept(path: pathlib.Path) bool[source]¶
Return True if
path(folder OR file) is usable as-is.
- class spacr.qt.dnd_handlers.ModelZooDropHandler[source]¶
Bases:
spacr.qt.dnd.DropHandlerScan checkpoints, or use image-only folders as benchmark fields.
- apply(path: pathlib.Path, screen) None[source]¶
Wire
pathintoscreen(set src, populate settings, etc.).
- can_accept(path: pathlib.Path) bool[source]¶
Return True if
path(folder OR file) is usable as-is.
- error_message(path: pathlib.Path) str[source]¶
Human-friendly explanation for why
pathcan’t be used.
- class spacr.qt.dnd_handlers.PlateQueueDropHandler[source]¶
Bases:
spacr.qt.dnd.DropHandlerQueue plate folders that carry spaCR settings snapshots.
- apply(path: pathlib.Path, screen) None[source]¶
Wire
pathintoscreen(set src, populate settings, etc.).
- can_accept(path: pathlib.Path) bool[source]¶
Return True if
path(folder OR file) is usable as-is.
- error_message(path: pathlib.Path) str[source]¶
Human-friendly explanation for why
pathcan’t be used.
- class spacr.qt.dnd_handlers.ProjectFolderDropHandler(app_key: str = '')[source]¶
Bases:
LayoutDropHandlerA screen that takes a whole project, wherever inside it you drop.
kindsis empty on purpose: there is no port for “the project”, and inventing one would put it in the module graph. The layout walk still happens — dropping<plate>/measurements/measurements.dbon the pipeline graph opens<plate>.- can_accept(path: pathlib.Path) bool[source]¶
Return True if
path(folder OR file) is usable as-is.
- deliver(screen, value: str, target) None[source]¶
Put
valueinto the screen. Runs on the GUI thread.- Parameters:
screen – the screen the drop landed on.
value – the resolved path.
target – the
spacr.chaining.DropTargetit came from, or None for a file the user dropped directly.
- class spacr.qt.dnd_handlers.ProjectRootsDropHandler(app_key: str = '')[source]¶
Bases:
ProjectFolderDropHandlerProject Browser: several folders at once, each becoming a root.
- deliver(screen, value: str, target) None[source]¶
Put
valueinto the screen. Runs on the GUI thread.- Parameters:
screen – the screen the drop landed on.
value – the resolved path.
target – the
spacr.chaining.DropTargetit came from, or None for a file the user dropped directly.
- class spacr.qt.dnd_handlers.ReportDropHandler[source]¶
Bases:
spacr.qt.dnd.DropHandlerAccept a completed spaCR run folder and scan its report inputs.
- apply(path: pathlib.Path, screen) None[source]¶
Wire
pathintoscreen(set src, populate settings, etc.).
- can_accept(path: pathlib.Path) bool[source]¶
Return True if
path(folder OR file) is usable as-is.
- error_message(path: pathlib.Path) str[source]¶
Human-friendly explanation for why
pathcan’t be used.
- class spacr.qt.dnd_handlers.ResultsDatabaseDropHandler[source]¶
Bases:
DatabaseDropHandlerDatabase input for Plate Viewer and Annotator Agreement.
- apply(path: pathlib.Path, screen) None[source]¶
Wire
pathintoscreen(set src, populate settings, etc.).
- class spacr.qt.dnd_handlers.ResultsFolderDropHandler(app_key: str = '')[source]¶
Bases:
LayoutDropHandlerHit List: the
results/folder a regression wrote.- deliver(screen, value: str, target) None[source]¶
Put
valueinto the screen. Runs on the GUI thread.- Parameters:
screen – the screen the drop landed on.
value – the resolved path.
target – the
spacr.chaining.DropTargetit came from, or None for a file the user dropped directly.
- class spacr.qt.dnd_handlers.RunHistoryDropHandler(app_key: str = '')[source]¶
Bases:
ProjectFolderDropHandlerRun History: select the run a dropped run folder belongs to.
- apply(path: pathlib.Path, screen) None[source]¶
Wire
pathintoscreen(set src, populate settings, etc.).
- can_accept(path: pathlib.Path) bool[source]¶
Return True if
path(folder OR file) is usable as-is.
- class spacr.qt.dnd_handlers.ScatterTableDropHandler(app_key: str = '')[source]¶
Bases:
TableDropHandlerImage Scatter: a path field, a table picker, then the read.
- deliver(screen, value: str, target) None[source]¶
Put
valueinto the screen. Runs on the GUI thread.- Parameters:
screen – the screen the drop landed on.
value – the resolved path.
target – the
spacr.chaining.DropTargetit came from, or None for a file the user dropped directly.
- class spacr.qt.dnd_handlers.SourceDropHandler[source]¶
Bases:
spacr.qt.dnd.DropHandlerGeneral source-path policy for modules without a narrower contract.
Every standard
AppScreenhas asrcfield. Accepting a real directory here gives newer and less-specialised modules drag-and-drop support automatically instead of requiring a registry edit for every screen. A dropped file is only accepted for known data extensions and is normalised to its containing directory.Where the module declares ports, the value comes from
spacr.chaining.resolve_drop()— the same answer auto-chaining would fill the field with — so dropping<plate>/measurementsand letting the chain fillsrccannot produce two different strings. A module with no declaration keeps the plain normalisation below, which is all there is to go on.- apply(path: pathlib.Path, screen) None[source]¶
Wire
pathintoscreen(set src, populate settings, etc.).
- can_accept(path: pathlib.Path) bool[source]¶
Return True if
path(folder OR file) is usable as-is.
- error_message(path: pathlib.Path) str[source]¶
Human-friendly explanation for why
pathcan’t be used.
- class spacr.qt.dnd_handlers.SubmissionSettingsDropHandler(app_key: str = '')[source]¶
Bases:
LayoutDropHandlerDistributed Jobs: a settings snapshot to submit, or the plate with one.
- apply(path: pathlib.Path, screen) None[source]¶
Wire
pathintoscreen(set src, populate settings, etc.).
- can_accept(path: pathlib.Path) bool[source]¶
Return True if
path(folder OR file) is usable as-is.
- error_message(path: pathlib.Path) str[source]¶
Human-friendly explanation for why
pathcan’t be used.
- class spacr.qt.dnd_handlers.TableDropHandler(app_key: str = '')[source]¶
Bases:
LayoutDropHandlerA screen that reads one table: the explorers, the plotters, the gates.
Drop the project and it finds
measurements/measurements.db; drop the database and it uses it; drop a CSV and it reads that. When the database holds more than one table the table is asked rather than taken —load_pathpicks the first one silently, which is fine for a file dialog where the user chose the file and wrong for a drop where they chose a folder.- deliver(screen, value: str, target) None[source]¶
Put
valueinto the screen. Runs on the GUI thread.- Parameters:
screen – the screen the drop landed on.
value – the resolved path.
target – the
spacr.chaining.DropTargetit came from, or None for a file the user dropped directly.
- class spacr.qt.dnd_handlers.TrainingRunsDropHandler[source]¶
Bases:
spacr.qt.dnd.DropHandlerAccept a directory and asynchronously scan it for training runs.
- apply(path: pathlib.Path, screen) None[source]¶
Wire
pathintoscreen(set src, populate settings, etc.).
- can_accept(path: pathlib.Path) bool[source]¶
Return True if
path(folder OR file) is usable as-is.
- error_message(path: pathlib.Path) str[source]¶
Human-friendly explanation for why
pathcan’t be used.
- spacr.qt.dnd_handlers.active_scan_jobs(screen) int[source]¶
How many folder-scan threads
screenstill owns.
- spacr.qt.dnd_handlers.get_handler(app_key: str) spacr.qt.dnd.DropHandler[source]¶
Return a fresh DropHandler for
app_key.Falls back to
SourceDropHandlerso every conventional AppScreen can at least receive its source folder.
- spacr.qt.dnd_handlers.scan_folder_structure(path) Dict[str, Any][source]¶
Walk a dropped folder ONCE and return the folder-metadata report.
Worker-safe: plain data in, plain data out, nothing Qt. The single walk is the point. This replaced three walks of the same tree —
detect_folder_metadatadid one,plan_folder_extractiondid another and calleddetect_folder_metadataagain for a third — all on the GUI thread, all inside the drop event.The probe is pulled off the same lazy generator the planner then drains, so a folder whose layout is not recognisable costs 30 files, not a traversal.
- Returns:
{"labels": (...), "rows": [...], "error": ""}. Emptylabelsmeans no folder layout was recognised and there is nothing to report.
- spacr.qt.dnd_handlers.scan_is_busy(screen) bool[source]¶
True while a dropped folder is still being walked for
screen.
- spacr.qt.dnd_handlers.scan_mask_folder(path, sample: int = 20) Dict[str, Any][source]¶
List the top level of a dropped folder once. Worker-safe.
Returns the filenames the regex preview samples plus the total image count the report quotes. Both used to come from two separate listings of the same directory, taken on the GUI thread.
- spacr.qt.dnd_handlers.table_names(path: pathlib.Path) List[str][source]¶
Return the tables in a SQLite file, or
[]for anything else.One
sqlite_masterquery; the table screens make the same one when they load. Kept here so the drop can ask which table rather than letload_pathtake the first one silently.Opened read-only, and through a quoted URI: a folder with a
?or a#in its name would otherwise have everything after it read as query parameters, and the open would fail on a database that is perfectly fine.