RSS feed

python-pskc branch master updated. 0.5-13-g6028b8e

[Date Prev][Date Next] [Thread Prev][Thread Next]

python-pskc branch master updated. 0.5-13-g6028b8e

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "python-pskc".

The branch, master has been updated
       via  6028b8e1f0bc2e5aa5486152a03a1856f226d507 (commit)
      from  eef681bfda4692ff5b232d319773482196a5a7ec (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------

commit 6028b8e1f0bc2e5aa5486152a03a1856f226d507
Author: Arthur de Jong <>
Date:   Fri Sep 22 13:17:39 2017 +0200

    Support adding custom CSV file headers
    This allows adding an optional label to the --columns option that can be
    used to output a label different from the key property name in the CSV
    file header.

diff --git a/ b/
index 7a7ed32..6830d28 100755
--- a/
+++ b/
@@ -81,8 +81,9 @@ parser.add_argument(
     '-o', '--output', metavar='FILE',
     help='write CSV to file instead of stdout')
-    '-c', '--columns', metavar='COL,COL', type=lambda x: x.split(','),
-    help='list of columns to export',
+    '-c', '--columns', metavar='COL:LABEL,COL,..',
+    type=lambda x: [column.split(':', 1) for column in x.split(',')],
+    help='list of columns with optional labels to export',
     '-p', '--password', '--passwd', metavar='PASS/FILE',
@@ -149,8 +150,8 @@ if __name__ == '__main__':
     # open output CSV file, write header and keys
     with open(args.output, 'wb') if args.output else sys.stdout as output:
         csvfile = csv.writer(output, quoting=csv.QUOTE_MINIMAL)
-        csvfile.writerow(args.columns)
+        csvfile.writerow([column[-1] for column in args.columns])
         for key in pskcfile.keys:
-                get_column(key, column, args.secret_encoding)
+                get_column(key, column[0], args.secret_encoding)
                 for column in args.columns])


Summary of changes: | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

To unsubscribe send an email to or see