Closed alexander-haller closed 4 months ago
In GitLab by @mhxion on Oct 6, 2023, 16:23
requested review from @alexander-haller
In GitLab by @mhxion on Oct 6, 2023, 16:36
Note from no. 2: In an upcoming merge (branch path-validation), a new path validator is added that makes sure all the essential paths are validated before any tasks are run. I.e., elAPI only runs or continues any task like bill-teams if paths like log path, export path are validated first, so we wouldn't waste our time by waiting for 15 minutes for bill-teams
to finish only to find out that the data can't export because of an invalid path!
In GitLab by @mhxion on Nov 5, 2023, 13:38
Many of the changes are now obsolete since they have been improved upon again in the future branch new-export-behavior. A new PR/MR will be made soon.
In GitLab by @mhxion on Nov 5, 2023, 13:38
removed review request for @alexander-haller
In GitLab by @mhxion on Oct 6, 2023, 16:23
Merges fix-export -> dev
Fixes #2
Exporting data now is stable. A new
ExportToDirectory
class has been added (cli/_export.py
) that handles all sorts of exports. Export now works the following way:An
--export-dir
(alias-e
) option for the following commands:bill-teams
,get
. E.g.,Note: The name
--export-dir
explicitly implies it only supports directory paths not file paths!Passing
--export-dir
will mean elAPI will look forexport_dir
field (previously nameddownload-dir
) in configuration files. If noexport-dir
is defined, then--export-dir
will assignXDG_DOWNLOAD_DIR
as its export path. IfXDG_DOWNLOAD_DIR
isn't defined either, then$HOME/Downloads
. If neither is defined, elAPI will simply quite throwing an error message before even running any task. See comments for more about this behavior.This PR also makes passing an arbitrary directory to
--export-dir
possible.If the passing path isn't valid (no write permission) then elAPI will fallback to no. 2 above.
--export-dir
understands output format option-o
. The exporting format will be that of-o
. If-o yaml
is passed then--export-dir
will save the data as aYAML
file. If no-o
is passed the default output formatJSON
assumed.