[chronojump/chronojump-importer] Adds Python3 in Chronojump and implements the code to execute the importer on Windows.



commit 901e67cd2b957b595a988b4b62d6919f9e959e8a
Author: Carles Pina i Estany <carles pina cat>
Date:   Sun Sep 25 22:30:16 2016 +0200

    Adds Python3 in Chronojump and implements the code to execute the importer on Windows.

 src/gui/chronojump.cs                   |    9 +++++----
 src/utilEncoder.cs                      |   11 +++++------
 win32/deps/python3/_bz2.pyd             |  Bin 0 -> 75928 bytes
 win32/deps/python3/_ctypes.pyd          |  Bin 0 -> 101528 bytes
 win32/deps/python3/_decimal.pyd         |  Bin 0 -> 213144 bytes
 win32/deps/python3/_elementtree.pyd     |  Bin 0 -> 155288 bytes
 win32/deps/python3/_hashlib.pyd         |  Bin 0 -> 1038488 bytes
 win32/deps/python3/_lzma.pyd            |  Bin 0 -> 152216 bytes
 win32/deps/python3/_msi.pyd             |  Bin 0 -> 31896 bytes
 win32/deps/python3/_multiprocessing.pyd |  Bin 0 -> 24728 bytes
 win32/deps/python3/_overlapped.pyd      |  Bin 0 -> 33432 bytes
 win32/deps/python3/_socket.pyd          |  Bin 0 -> 61080 bytes
 win32/deps/python3/_sqlite3.pyd         |  Bin 0 -> 63640 bytes
 win32/deps/python3/_ssl.pyd             |  Bin 0 -> 1448088 bytes
 win32/deps/python3/pyexpat.pyd          |  Bin 0 -> 157336 bytes
 win32/deps/python3/python.exe           |  Bin 0 -> 39576 bytes
 win32/deps/python3/python3.dll          |  Bin 0 -> 51864 bytes
 win32/deps/python3/python35.dll         |  Bin 0 -> 3127960 bytes
 win32/deps/python3/python35.zip         |  Bin 0 -> 2257581 bytes
 win32/deps/python3/pythonw.exe          |  Bin 0 -> 39576 bytes
 win32/deps/python3/pyvenv.cfg           |    1 +
 win32/deps/python3/select.pyd           |  Bin 0 -> 22680 bytes
 win32/deps/python3/sqlite3.dll          |  Bin 0 -> 605336 bytes
 win32/deps/python3/unicodedata.pyd      |  Bin 0 -> 864920 bytes
 win32/deps/python3/vcruntime140.dll     |  Bin 0 -> 85840 bytes
 win32/deps/python3/winsound.pyd         |  Bin 0 -> 23192 bytes
 26 files changed, 11 insertions(+), 10 deletions(-)
---
diff --git a/src/gui/chronojump.cs b/src/gui/chronojump.cs
index f53726e..c3fcf68 100644
--- a/src/gui/chronojump.cs
+++ b/src/gui/chronojump.cs
@@ -2405,18 +2405,19 @@ public partial class ChronoJumpWindow
 
        private void ImportSessionFromDatabase(string databasePath, int sessionNumber)
        {
-               string importerPath = UtilEncoder.GetChronojumpImporter ();
+               string pythonExecutable = UtilEncoder.GetPythonExecutable ();
                string source_filename = databasePath;
                string destination_filename = Sqlite.DatabaseFilePath;
-               string session = Convert.ToString (sessionNumber);;
+               string session = Convert.ToString (sessionNumber);
+               string importer_executable = System.IO.Path.Combine (Util.GetPrefixDir (), "bin" + 
Path.DirectorySeparatorChar + "chronojump_importer.py");
 
                Process process = new Process();
                ProcessStartInfo processStartInfo;
 
                processStartInfo = new ProcessStartInfo();
 
-               processStartInfo.Arguments = " --source " + source_filename + " --destination " + 
destination_filename + " --source_session " + session;
-               processStartInfo.FileName = importerPath;
+               processStartInfo.Arguments = importer_executable + " --source " + source_filename + " 
--destination " + destination_filename + " --source_session " + session;
+               processStartInfo.FileName = pythonExecutable;
 
                LogB.Debug ("chronojump-importer fileName:" + processStartInfo.FileName);
                LogB.Debug ("chronojump-importer Arguments:" + processStartInfo.Arguments);
diff --git a/src/utilEncoder.cs b/src/utilEncoder.cs
index 185363c..df161bb 100644
--- a/src/utilEncoder.cs
+++ b/src/utilEncoder.cs
@@ -178,15 +178,14 @@ public class UtilEncoder
                return false;
        }
        
-       public static string GetChronojumpImporter() {
+       public static string GetPythonExecutable() {
                if (UtilAll.IsWindows ()) {
-                       // TODO
-                       return "";
+                       //on Windows we need the \"str\" to call without problems in path with spaces
+                       return  "\"" + System.IO.Path.Combine(Util.GetPrefixDir(), "python3" + 
Path.DirectorySeparatorChar + "python.exe") + "\"";
                } else {
-                       // It's installed in the PATH.
-                       return "chronojump_importer.py";
+                       // We assume that it's installed in the PATH and that we don't care if it's Python2 
or Python3
+                       return "python";
                }
-               // What about OSX?
        }
 
        /*      
diff --git a/win32/deps/python3/_bz2.pyd b/win32/deps/python3/_bz2.pyd
new file mode 100644
index 0000000..80bad78
Binary files /dev/null and b/win32/deps/python3/_bz2.pyd differ
diff --git a/win32/deps/python3/_ctypes.pyd b/win32/deps/python3/_ctypes.pyd
new file mode 100644
index 0000000..ecfaab6
Binary files /dev/null and b/win32/deps/python3/_ctypes.pyd differ
diff --git a/win32/deps/python3/_decimal.pyd b/win32/deps/python3/_decimal.pyd
new file mode 100644
index 0000000..901072a
Binary files /dev/null and b/win32/deps/python3/_decimal.pyd differ
diff --git a/win32/deps/python3/_elementtree.pyd b/win32/deps/python3/_elementtree.pyd
new file mode 100644
index 0000000..09118dd
Binary files /dev/null and b/win32/deps/python3/_elementtree.pyd differ
diff --git a/win32/deps/python3/_hashlib.pyd b/win32/deps/python3/_hashlib.pyd
new file mode 100644
index 0000000..cee4273
Binary files /dev/null and b/win32/deps/python3/_hashlib.pyd differ
diff --git a/win32/deps/python3/_lzma.pyd b/win32/deps/python3/_lzma.pyd
new file mode 100644
index 0000000..cdef243
Binary files /dev/null and b/win32/deps/python3/_lzma.pyd differ
diff --git a/win32/deps/python3/_msi.pyd b/win32/deps/python3/_msi.pyd
new file mode 100644
index 0000000..360b341
Binary files /dev/null and b/win32/deps/python3/_msi.pyd differ
diff --git a/win32/deps/python3/_multiprocessing.pyd b/win32/deps/python3/_multiprocessing.pyd
new file mode 100644
index 0000000..0768c74
Binary files /dev/null and b/win32/deps/python3/_multiprocessing.pyd differ
diff --git a/win32/deps/python3/_overlapped.pyd b/win32/deps/python3/_overlapped.pyd
new file mode 100644
index 0000000..6877585
Binary files /dev/null and b/win32/deps/python3/_overlapped.pyd differ
diff --git a/win32/deps/python3/_socket.pyd b/win32/deps/python3/_socket.pyd
new file mode 100644
index 0000000..fe8d321
Binary files /dev/null and b/win32/deps/python3/_socket.pyd differ
diff --git a/win32/deps/python3/_sqlite3.pyd b/win32/deps/python3/_sqlite3.pyd
new file mode 100644
index 0000000..6f65066
Binary files /dev/null and b/win32/deps/python3/_sqlite3.pyd differ
diff --git a/win32/deps/python3/_ssl.pyd b/win32/deps/python3/_ssl.pyd
new file mode 100644
index 0000000..5567a11
Binary files /dev/null and b/win32/deps/python3/_ssl.pyd differ
diff --git a/win32/deps/python3/pyexpat.pyd b/win32/deps/python3/pyexpat.pyd
new file mode 100644
index 0000000..b4b2da6
Binary files /dev/null and b/win32/deps/python3/pyexpat.pyd differ
diff --git a/win32/deps/python3/python.exe b/win32/deps/python3/python.exe
new file mode 100644
index 0000000..f8b9a5b
Binary files /dev/null and b/win32/deps/python3/python.exe differ
diff --git a/win32/deps/python3/python3.dll b/win32/deps/python3/python3.dll
new file mode 100644
index 0000000..9eb1a1c
Binary files /dev/null and b/win32/deps/python3/python3.dll differ
diff --git a/win32/deps/python3/python35.dll b/win32/deps/python3/python35.dll
new file mode 100644
index 0000000..e3e1604
Binary files /dev/null and b/win32/deps/python3/python35.dll differ
diff --git a/win32/deps/python3/python35.zip b/win32/deps/python3/python35.zip
new file mode 100644
index 0000000..ea035d2
Binary files /dev/null and b/win32/deps/python3/python35.zip differ
diff --git a/win32/deps/python3/pythonw.exe b/win32/deps/python3/pythonw.exe
new file mode 100644
index 0000000..0dfa6b8
Binary files /dev/null and b/win32/deps/python3/pythonw.exe differ
diff --git a/win32/deps/python3/pyvenv.cfg b/win32/deps/python3/pyvenv.cfg
new file mode 100644
index 0000000..d70b999
--- /dev/null
+++ b/win32/deps/python3/pyvenv.cfg
@@ -0,0 +1 @@
+applocal = true
diff --git a/win32/deps/python3/select.pyd b/win32/deps/python3/select.pyd
new file mode 100644
index 0000000..68b41f7
Binary files /dev/null and b/win32/deps/python3/select.pyd differ
diff --git a/win32/deps/python3/sqlite3.dll b/win32/deps/python3/sqlite3.dll
new file mode 100644
index 0000000..f37b247
Binary files /dev/null and b/win32/deps/python3/sqlite3.dll differ
diff --git a/win32/deps/python3/unicodedata.pyd b/win32/deps/python3/unicodedata.pyd
new file mode 100644
index 0000000..a898580
Binary files /dev/null and b/win32/deps/python3/unicodedata.pyd differ
diff --git a/win32/deps/python3/vcruntime140.dll b/win32/deps/python3/vcruntime140.dll
new file mode 100644
index 0000000..f68ee0d
Binary files /dev/null and b/win32/deps/python3/vcruntime140.dll differ
diff --git a/win32/deps/python3/winsound.pyd b/win32/deps/python3/winsound.pyd
new file mode 100644
index 0000000..46beb01
Binary files /dev/null and b/win32/deps/python3/winsound.pyd differ


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