Skip to content

Conversation

@boutinb
Copy link
Contributor

@boutinb boutinb commented Sep 19, 2025

This adds the possibility from the command line to run analyses with other data files and export the results in PDF or HTML.
For this the command line supports extra options: JASP <JASP file> (<data file 1> <data file 2> ...) --inputDataDir <path to folder> --outputDir <path to folder> --outputPdf --dontExportResult --keepJASPOpen

  • The JASP file is first loaded.
  • It synchronizes with 1 or more data files: either the ones directly specified in the command line, or all data files found in the inputDataDir folder (and subfolder).
  • For each data file, when all analyses are all refreshed, it exports the result in HTML format (or PDF format if --outputPdf is specified). The export file is generated in the same folder as the data file, or in the folder specified by -outputDir. This step can be discarded if -dontExportResult is specified.
  • Afterwards JASP is closed per default, except if --keepJASPOpen is specified.

To realize this, the argument parsing of the main function has been rewritten and uses now a ParsedArguments object.
Also the handling of the FileEvent has been partly refactored: it has now a status property that states whether the event is initialized, started, completed and finalized. All the File Events follow now the same process, and are also deleted at the end (they were not deleted before). By making the process clearer, event chaining is now possible without risking that one handling of the first event does mangle with the handling of the second event. This was needed to start the synchronization of the data file only when the JASP file is completely opened.

I have also added the possibility to drag and drop a data file to a JASP instance, so that it synchronizes directly the analysis with the new data.

_last_error = "Unknown error",
_message;
bool _completed = false,
bool _started = false,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

an enum (via DECLARE_ENUM) describving the state of the fileevent is better

@boutinb boutinb force-pushed the changeDataFile branch 2 times, most recently from 098ef8d to cc20558 Compare September 26, 2025 10:47
@boutinb boutinb marked this pull request as ready for review September 30, 2025 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants