[chronojump] Adds missing files from chronojump-importer.



commit c7fb612b83e34c20d34fa4c1e50bea5efa102e09
Author: Carles Pina i Estany <carles pina cat>
Date:   Mon Oct 17 11:24:56 2016 +0200

    Adds missing files from chronojump-importer.

 src/chronojump-importer/README.txt                |    3 +++
 src/chronojump-importer/tests/edit_dump_sqlite.sh |   18 ++++++++++++++++++
 2 files changed, 21 insertions(+), 0 deletions(-)
---
diff --git a/src/chronojump-importer/README.txt b/src/chronojump-importer/README.txt
new file mode 100644
index 0000000..6f53e7b
--- /dev/null
+++ b/src/chronojump-importer/README.txt
@@ -0,0 +1,3 @@
+Python utility that will allow to import a session from another chronojump.sqlite database into the first 
one.
+
+This is designed to be used from Chronojump (Session - Import session from another Chronojump) and it could 
also be used to be imported using the command line.
diff --git a/src/chronojump-importer/tests/edit_dump_sqlite.sh 
b/src/chronojump-importer/tests/edit_dump_sqlite.sh
new file mode 100755
index 0000000..317513b
--- /dev/null
+++ b/src/chronojump-importer/tests/edit_dump_sqlite.sh
@@ -0,0 +1,18 @@
+#!/bin/bash
+
+# Dev tool - to be used only by developers changing unit tests
+# for the chronojump-importer.
+
+# Small utility script to help modifying binary .sqlite databases.
+# It dumps a dump of the .sqlite file into a temporary SQL statements
+# file, opens vim on this file, and then it deletes the original file
+# and creates it with the just modified SQL statements.
+
+TEMPORARY_FILE=$(mktemp)
+
+echo .dump | sqlite3 "$1" > "$TEMPORARY_FILE"
+vim "$TEMPORARY_FILE"
+cp "$1" "$1.bck"
+rm "$1"
+cat "$TEMPORARY_FILE" | sqlite3 "$1"
+echo "Done!"


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]