added centralized versioning.

nanotube [2005-09-21 05:58]
added centralized versioning.
Filename
keylogger.pyw
make_all_dist.bat
setup.py
version.py
diff --git a/keylogger.pyw b/keylogger.pyw
index 0e98a29..ae0fe56 100644
--- a/keylogger.pyw
+++ b/keylogger.pyw
@@ -5,6 +5,7 @@ import sys
 from optparse import OptionParser
 import traceback
 from logwriter import LogWriter
+import version

 class KeyLogger:
     ''' Captures all keystrokes, calls LogWriter class to log them to disk
@@ -40,7 +41,7 @@ class KeyLogger:
         '''Read command line options
         '''

-        parser = OptionParser(version="%prog version 0.6.0")
+        parser = OptionParser(version=version.description + " version " + version.version + " (" + version.url + ").")
         parser.add_option("-f", "--file", action="store", dest="dirName", help="write log data to DIRNAME [default: %default]")
         parser.add_option("-k", "--keyboard", action="store_true", dest="hookKeyboard", help="log keyboard input [default: %default]")
         parser.add_option("-a", "--addlinefeed", action="store_true", dest="addLineFeed", help="add linefeed [\\n] character when carriage return [\\r] character is detected (for Notepad compatibility) [default: %default]")
diff --git a/make_all_dist.bat b/make_all_dist.bat
index e45806e..dbb7d18 100644
--- a/make_all_dist.bat
+++ b/make_all_dist.bat
@@ -5,7 +5,7 @@ set VERSION=0.6.0


 echo %VERSION%
-pause "You didnt forget to edit the version, did you? in source file, and in setup.py too!..."
+pause "You didnt forget to edit the version, did you? in version.py too!..."
 rem ***** get rid of all the old files in the build folder
 rd /S /Q build

diff --git a/setup.py b/setup.py
index 3c55db7..f6741f3 100644
--- a/setup.py
+++ b/setup.py
@@ -4,19 +4,22 @@
 # 'python setup.py py2exe' in a console prompt.
 #
 # If everything works well, you should find a subdirectory named 'dist'
-# containing some files, among them hello.exe and test_wx.exe.
+# containing some files, among them keylogger.exe and keylogger_debug.exe.


 from distutils.core import setup
 import py2exe
+import version

 setup(
     # The first three parameters are not required, if at least a
     # 'version' is given, then a versioninfo resource is built from
     # them and added to the executables.
-    version = "0.2.1",
-    description = "simple python keylogger",
-    name = "python keylogger",
+    name = version.name,
+    version = version.version,
+    description = version.description,
+    url = version.url,
+    license = version.license,

     # targets to build
     console = [
@@ -26,7 +29,6 @@ setup(
         }
     ],

-    #windows = ["keylogger.pyw"],
     windows = [
        {
            "script": "keylogger.pyw",
diff --git a/version.py b/version.py
new file mode 100644
index 0000000..5258da4
--- /dev/null
+++ b/version.py
@@ -0,0 +1,6 @@
+
+name = "Python Keylogger"
+version = "0.6.0"
+description = "Simple Python Keylogger for Windows"
+url = "http://pykeylogger.sourceforge.net"
+license = "GPL"
ViewGit