Split gkofoto's start, start.py and start.pyw into five files:
authorJoel Rosdahl <joel@rosdahl.net>
Sat, 7 Aug 2004 11:49:37 +0000 (11:49 +0000)
committerJoel Rosdahl <joel@rosdahl.net>
Sat, 7 Aug 2004 11:49:37 +0000 (11:49 +0000)
 * start-on-unix.py (use system libraries)
 * start-on-windows.py (use system libraries + GTK+ library magic)
 * start-in-unix-source.py (use source tree libraries)
 * start-in-windows-source.py (use source tree libraries + GTK+ library magic)
 * start-in-windows-source.pyw (pythonw wrapper for start-in-windows-source.py)

setup.py
src/gkofoto/start [deleted file]
src/gkofoto/start-in-unix-source.py [new file with mode: 0755]
src/gkofoto/start-in-windows-source.py [new file with mode: 0644]
src/gkofoto/start-in-windows-source.pyw [new file with mode: 0644]
src/gkofoto/start-on-unix.py [new file with mode: 0755]
src/gkofoto/start-on-windows.py [new file with mode: 0644]
src/gkofoto/start.py [deleted file]
src/gkofoto/start.pyw [deleted file]

index 3c73b57..033f3fb 100755 (executable)
--- a/setup.py
+++ b/setup.py
@@ -27,14 +27,14 @@ data_files = [
     ]
 
 if windows_mode:
-    shutil.copy("src/gkofoto/start", "src/gkofoto/gkofoto-start.pyw")
+    shutil.copy("src/gkofoto/start-on-windows.py", "src/gkofoto/gkofoto-start.pyw")
     scripts = [
         "src/cmdline/kofoto",
         "src/gkofoto/gkofoto-start.pyw",
         "src/gkofoto/scripts/gkofoto-windows-postinstall.py",
         ]
 else:
-    shutil.copy("src/gkofoto/start", "src/gkofoto/gkofoto")
+    shutil.copy("src/gkofoto/start-on-unix.py", "src/gkofoto/gkofoto")
     scripts = [
         "src/cmdline/kofoto",
         "src/gkofoto/gkofoto",
diff --git a/src/gkofoto/start b/src/gkofoto/start
deleted file mode 100755 (executable)
index 8408fe2..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-#!/usr/bin/env python
-
-import sys
-import os
-
-if sys.platform.startswith("win"):
-    import _winreg
-    import msvcrt
-    try:
-        k = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, "Software\\GTK\\2.0")
-    except EnvironmentError:
-        print "You must install the GTK+ 2.2 Runtime Environment to run this program."
-        while not msvcrt.kbhit():
-            pass
-        sys.exit(1)
-    else:
-        gtkdir = _winreg.QueryValueEx(k, "Path")
-        import os
-        os.environ["PATH"] += ";%s/lib;%s/bin" % (gtkdir[0], gtkdir[0])
-
-# Find libraries if installed in ../lib (like in the source tree).
-if os.path.islink(sys.argv[0]):
-    link = os.readlink(sys.argv[0])
-    absloc = os.path.normpath(
-        os.path.join(os.path.dirname(sys.argv[0]), link))
-    bindir = os.path.dirname(absloc)
-else:
-    bindir = os.path.dirname(sys.argv[0])
-sys.path.insert(0, os.path.join(bindir, "..", "lib"))
-sys.path.insert(0, os.path.join(bindir, ".."))
-
-from gkofoto.main import main
-main(bindir, sys.argv)
diff --git a/src/gkofoto/start-in-unix-source.py b/src/gkofoto/start-in-unix-source.py
new file mode 100755 (executable)
index 0000000..ef0ef10
--- /dev/null
@@ -0,0 +1,21 @@
+#! /usr/bin/env python
+
+import os
+import sys
+
+# Find bindir when started via a symlink.
+if os.path.islink(sys.argv[0]):
+    link = os.readlink(sys.argv[0])
+    absloc = os.path.normpath(
+        os.path.join(os.path.dirname(sys.argv[0]), link))
+    bindir = os.path.dirname(absloc)
+else:
+    bindir = os.path.dirname(sys.argv[0])
+
+# Find kofoto libraries (../lib) and gkofoto libraries (..) in the
+# source tree.
+sys.path.insert(0, os.path.join(bindir, "..", "lib"))
+sys.path.insert(0, os.path.join(bindir, ".."))
+
+from gkofoto.main import main
+main(bindir, sys.argv)
diff --git a/src/gkofoto/start-in-windows-source.py b/src/gkofoto/start-in-windows-source.py
new file mode 100644 (file)
index 0000000..671f474
--- /dev/null
@@ -0,0 +1,22 @@
+# This file makes it possible to run GKofoto in Windows directly from
+# the source directory by double-clicking on it. A console window is
+# also created.
+
+import os
+import sys
+
+if sys.platform.startswith("win"):
+    import _winreg
+    import msvcrt
+    try:
+        k = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, "Software\\GTK\\2.0")
+    except EnvironmentError:
+        print "You must install the GTK+ 2.2 Runtime Environment to run this program."
+        while not msvcrt.kbhit():
+            pass
+        sys.exit(1)
+    else:
+        gtkdir = _winreg.QueryValueEx(k, "Path")
+        os.environ["PATH"] += ";%s/lib;%s/bin" % (gtkdir[0], gtkdir[0])
+
+execfile("start-in-unix-source.py")
diff --git a/src/gkofoto/start-in-windows-source.pyw b/src/gkofoto/start-in-windows-source.pyw
new file mode 100644 (file)
index 0000000..84be09b
--- /dev/null
@@ -0,0 +1,5 @@
+# This file makes it possible to run GKofoto in Windows directly from
+# the source directory by double-clicking on it. No console window is
+# created.
+
+execfile("start-in-windows-source.py")
diff --git a/src/gkofoto/start-on-unix.py b/src/gkofoto/start-on-unix.py
new file mode 100755 (executable)
index 0000000..8527580
--- /dev/null
@@ -0,0 +1,16 @@
+#! /usr/bin/env python
+
+import os
+import sys
+
+# Find bindir when started via a symlink.
+if os.path.islink(sys.argv[0]):
+    link = os.readlink(sys.argv[0])
+    absloc = os.path.normpath(
+        os.path.join(os.path.dirname(sys.argv[0]), link))
+    bindir = os.path.dirname(absloc)
+else:
+    bindir = os.path.dirname(sys.argv[0])
+
+from gkofoto.main import main
+main(bindir, sys.argv)
diff --git a/src/gkofoto/start-on-windows.py b/src/gkofoto/start-on-windows.py
new file mode 100644 (file)
index 0000000..a6e5227
--- /dev/null
@@ -0,0 +1,21 @@
+import os
+import sys
+
+if sys.platform.startswith("win"):
+    import _winreg
+    import msvcrt
+    try:
+        k = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, "Software\\GTK\\2.0")
+    except EnvironmentError:
+        print "You must install the GTK+ 2.2 Runtime Environment to run this program."
+        while not msvcrt.kbhit():
+            pass
+        sys.exit(1)
+    else:
+        gtkdir = _winreg.QueryValueEx(k, "Path")
+        os.environ["PATH"] += ";%s/lib;%s/bin" % (gtkdir[0], gtkdir[0])
+
+bindir = os.path.dirname(sys.argv[0])
+
+from gkofoto.main import main
+main(bindir, sys.argv)
diff --git a/src/gkofoto/start.py b/src/gkofoto/start.py
deleted file mode 100644 (file)
index 5d5f1fb..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-# This file makes it possible to run GKofoto in Windows directly from\r
-# the source directory by double-clicking on it. A console window is\r
-# also created.\r
-\r
-execfile("start")\r
diff --git a/src/gkofoto/start.pyw b/src/gkofoto/start.pyw
deleted file mode 100644 (file)
index d1218e8..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-# This file makes it possible to run GKofoto in Windows directly from
-# the source directory by double-clicking on it. No console window is
-# created.
-
-execfile("start")