Univention Bugzilla – Bug 48189
add pre-read-hook that modifies the header of a CSV file to ucs-school-import
Last modified: 2019-04-09 14:23:39 CEST
Create a hook that modifies the header of a CSV file. A mapping is read from the configuration object. Add the hook to the UCS@school product in /usr/share/ucs-school-import/pyhooks-available/ so that customers can activate it, if required.
WIP in dtroeder/48188_pre-read-hook
PyHook is in /usr/share/ucs-school-import/pyhooks-available/pre_read_modify_csv_header.py. Users can copy it to /usr/share/ucs-school-import/pyhooks/ to active it. """ A pre-read hooks that changes the header of a input CSV file. A mapping is read from the configuration file (csv:header_swap), the original CSV file is backuped and the header is changed. If a mapping key is not found in the input file, it is ignored. Example:: { "csv": { "header_swap": { "Schulen Ost": "Schulen", "Schulname": "Schulen", "Familienname": "Nachname" } } } header 1 before: "ID","Vorname","Nachname","Email","Schulen Ost" header 1 after : "ID","Vorname","Nachname","Email","Schulen" header 2 before: "ID","Familienname,"Vorname","Schulname" header 2 after : "ID","Nachname,"Vorname","Schulen" """ [dtroeder/48188_pre-read-hook] 73abaedbd Bug #48189: WIP: pre-read hook that modifies the header of a CSV file [dtroeder/48188_pre-read-hook] 1652ce831 Bug #48189: modify CSV header Please reopen, when starting QA (missing merge, changelog and package build).
Merged to 4.4 as part of work on Bug #48958.
Package installs: OK Test passes: OK Hook function working: OK Please merge and create changelog and advisory
Merge to 4.3: [4.3] 4c4ead2d2 Bug #48189: WIP: pre-read hook that modifies the header of a CSV file [4.3] 0356ef28d Bug #48189: modify CSV header [4.3] 34d23f52f Bug #48189: add test for pre-read hook [4.3] 22efeef6f Bug #48189: changelog [4.3] 1d42a6f85 Bug #48188, Bug #48189: advisory ucs-school-import (16.0.3-6) Merge to 4.4: [4.4] ea4b83060 Bug #48189: WIP: pre-read hook that modifies the header of a CSV file [4.4] d58db2bf9 Bug #48189: modify CSV header [4.4] 85f2305c8 Bug #48189: add test for pre-read hook [4.4] 244b3568a Bug #48189: adapt to UCS@school 4.4 [4.4] 7cb9efbe7 Bug #48189: adapt tests to check_for_non_empty_pyhooks
4.4: Changelog: Bug not mentioned Advisories: missing hook present and works: OK 4.3: Changelog&Advisory: OK hook present and works: OK
(In reply to Ole Schwiegert from comment #6) > 4.4: > Changelog: Bug not mentioned 4.4 has been released. The 4.3→4.4-changelog won't be changed now. But a new changelog will (almost) automatically be created from the advisory for the next errata-release. > Advisories: missing [4.4 43f5e910a] Bug #48189: advisory
OK.
UCS@school 4.3 v8 has been released. https://docs.software-univention.de/changelog-ucsschool-4.3v8-de.html If this error occurs again, please clone this bug.