hawq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject [15/28] incubator-hawq git commit: HAWQ-837. Add python modules into HAWQ code
Date Tue, 21 Jun 2016 02:41:31 GMT
http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/80e25b46/tools/bin/pythonSrc/lockfile-0.9.1/doc/lockfile.rst
----------------------------------------------------------------------
diff --git a/tools/bin/pythonSrc/lockfile-0.9.1/doc/lockfile.rst b/tools/bin/pythonSrc/lockfile-0.9.1/doc/lockfile.rst
new file mode 100644
index 0000000..4bc0a3e
--- /dev/null
+++ b/tools/bin/pythonSrc/lockfile-0.9.1/doc/lockfile.rst
@@ -0,0 +1,257 @@
+
+:mod:`lockfile` --- Platform-independent file locking
+=====================================================
+
+.. module:: lockfile
+   :synopsis: Platform-independent file locking
+.. moduleauthor:: Skip Montanaro <skip@pobox.com>
+.. sectionauthor:: Skip Montanaro <skip@pobox.com>
+
+
+.. note::
+
+   This package is pre-release software.  Between versions 0.8 and 0.9 it
+   was changed from a module to a package.  It is quite possible that the
+   API and implementation will change again in important ways as people test
+   it and provide feedback and bug fixes.  In particular, if the mkdir-based
+   locking scheme is sufficient for both Windows and Unix platforms, the
+   link-based scheme may be deleted so that only a single locking scheme is
+   used, providing cross-platform lockfile cooperation.
+
+.. note::
+
+   The implementation uses the :keyword:`with` statement, both in the
+   tests and in the main code, so will only work out-of-the-box with Python
+   2.5 or later.  However, the use of the :keyword:`with` statement is
+   minimal, so if you apply the patch in the included 2.4.diff file you can
+   use it with Python 2.4.  It's possible that it will work in Python 2.3
+   with that patch applied as well, though the doctest code relies on APIs
+   new in 2.4, so will have to be rewritten somewhat to allow testing on
+   2.3.  As they say, patches welcome. ``;-)``
+
+The :mod:`lockfile` package exports a :class:`LockFile` class which provides
+a simple API for locking files.  Unlike the Windows :func:`msvcrt.locking`
+function, the Unix :func:`fcntl.flock`, :func:`fcntl.lockf` and the
+deprecated :mod:`posixfile` module, the API is identical across both Unix
+(including Linux and Mac) and Windows platforms.  The lock mechanism relies
+on the atomic nature of the :func:`link` (on Unix) and :func:`mkdir` (On
+Windows) system calls.  It also contains several lock-method-specific
+modules: :mod:`lockfile.linklockfile`, :mod:`lockfile.mkdirlockfile`, and
+:mod:`lockfile.sqlitelockfile`, each one exporting a single class.  For
+backwards compatibility with versions before 0.9 the :class:`LinkFileLock`,
+:class:`MkdirFileLock` and :class:`SQLiteFileLock` objects are exposed as
+attributes of the top-level lockfile package, though this use was deprecated
+starting with version 0.9 and will be removed in version 1.0.
+
+.. note::
+
+   The current implementation uses :func:`os.link` on Unix, but since that
+   function is unavailable on Windows it uses :func:`os.mkdir` there.  At
+   this point it's not clear that using the :func:`os.mkdir` method would be
+   insufficient on Unix systems.  If it proves to be adequate on Unix then
+   the implementation could be simplified and truly cross-platform locking
+   would be possible.
+
+.. note::
+
+   The current implementation doesn't provide for shared vs. exclusive
+   locks.  It should be possible for multiple reader processes to hold the
+   lock at the same time.
+
+The module defines the following exceptions:
+
+.. exception:: Error
+
+   This is the base class for all exceptions raised by the :class:`LockFile`
+   class.
+
+.. exception:: LockError
+
+   This is the base class for all exceptions raised when attempting to lock
+   a file.
+
+.. exception:: UnlockError
+
+   This is the base class for all exceptions raised when attempting to
+   unlock a file.
+
+.. exception:: LockTimeout
+
+   This exception is raised if the :func:`LockFile.acquire` method is
+   called with a timeout which expires before an existing lock is released.
+
+.. exception:: AlreadyLocked
+
+   This exception is raised if the :func:`LockFile.acquire` detects a
+   file is already locked when in non-blocking mode.
+
+.. exception:: LockFailed
+
+   This exception is raised if the :func:`LockFile.acquire` detects some
+   other condition (such as a non-writable directory) which prevents it from
+   creating its lock file.
+
+.. exception:: NotLocked
+
+   This exception is raised if the file is not locked when
+   :func:`LockFile.release` is called.
+
+.. exception:: NotMyLock
+
+   This exception is raised if the file is locked by another thread or
+   process when :func:`LockFile.release` is called.
+
+The following classes are provided:
+
+.. class:: linklockfile.LinkLockFile(path, threaded=True)
+
+   This class uses the :func:`link(2)` system call as the basic lock
+   mechanism.  *path* is an object in the file system to be locked.  It need
+   not exist, but its directory must exist and be writable at the time the
+   :func:`acquire` and :func:`release` methods are called.  *threaded* is
+   optional, but when set to :const:`True` locks will be distinguished
+   between threads in the same process.
+
+.. class:: mkdirlockfile.MkdirLockFile(path, threaded=True)
+
+   This class uses the :func:`mkdir(2)` system call as the basic lock
+   mechanism.  The parameters have the same meaning as for the
+   :class:`LinkLockFile` class.
+
+.. class:: sqlitelockfile.SQLiteLockFile(path, threaded=True)
+
+   This class uses the :mod:`sqlite3` module to implement the lock
+   mechanism.  The parameters have the same meaning as for the
+   :class:`LinkLockFile` class.
+
+.. class:: LockBase(path, threaded=True)
+
+   This is the base class for all concrete implementations and is available
+   at the lockfile package level so programmers can implement other locking
+   schemes.
+
+By default, the :const:`LockFile` object refers to the
+:class:`mkdirlockfile.MkdirLockFile` class on Windows.  On all other
+platforms it refers to the :class:`linklockfile.LinkLockFile` class.
+
+When locking a file the :class:`linklockfile.LinkLockFile` class creates a
+uniquely named hard link to an empty lock file.  That hard link contains the
+hostname, process id, and if locks between threads are distinguished, the
+thread identifier.  For example, if you want to lock access to a file named
+"README", the lock file is named "README.lock".  With per-thread locks
+enabled the hard link is named HOSTNAME-THREADID-PID.  With only per-process
+locks enabled the hard link is named HOSTNAME--PID.
+
+When using the :class:`mkdirlockfile.MkdirLockFile` class the lock file is a
+directory.  Referring to the example above, README.lock will be a directory
+and HOSTNAME-THREADID-PID will be an empty file within that directory.
+
+.. seealso::
+
+   Module :mod:`msvcrt`
+      Provides the :func:`locking` function, the standard Windows way of
+      locking (parts of) a file.
+
+   Module :mod:`posixfile`
+      The deprecated (since Python 1.5) way of locking files on Posix systems.
+
+   Module :mod:`fcntl`
+      Provides the current best way to lock files on Unix systems
+      (:func:`lockf` and :func:`flock`).
+
+LockFile Objects
+----------------
+
+:class:`LockFile` objects support the :term:`context manager` protocol used
+by the statement:`with` statement.  The timeout option is not supported when
+used in this fashion.  While support for timeouts could be implemented,
+there is no support for handling the eventual :exc:`Timeout` exceptions
+raised by the :func:`__enter__` method, so you would have to protect the
+:keyword:`with` statement with a :keyword:`try` statement.  The resulting
+construct would not be any simpler than just using a :keyword:`try`
+statement in the first place.
+
+:class:`LockFile` has the following user-visible methods:
+
+.. method:: LockFile.acquire(timeout=None)
+
+   Lock the file associated with the :class:`LockFile` object.  If the
+   *timeout* is omitted or :const:`None` the caller will block until the
+   file is unlocked by the object currently holding the lock.  If the
+   *timeout* is zero or a negative number the :exc:`AlreadyLocked` exception
+   will be raised if the file is currently locked by another process or
+   thread.  If the *timeout* is positive, the caller will block for that
+   many seconds waiting for the lock to be released.  If the lock is not
+   released within that period the :exc:`LockTimeout` exception will be
+   raised.
+
+.. method:: LockFile.release()
+
+   Unlock the file associated with the :class:`LockFile` object.  If the
+   file is not currently locked, the :exc:`NotLocked` exception is raised.
+   If the file is locked by another thread or process the :exc:`NotMyLock`
+   exception is raised.
+
+.. method:: is_locked()
+
+   Return the status of the lock on the current file.  If any process or
+   thread (including the current one) is locking the file, :const:`True` is
+   returned, otherwise :const:`False` is returned.
+
+.. method:: break_lock()
+
+   If the file is currently locked, break it.
+
+.. method:: i_am_locking()
+
+   Returns true if the caller holds the lock.
+
+Examples
+--------
+
+This example is the "hello world" for the :mod:`lockfile` package::
+
+    from lockfile import LockFile
+    lock = LockFile("/some/file/or/other")
+    with lock:
+        print lock.path, 'is locked.'
+
+To use this with Python 2.4, you can execute::
+
+    frm lockfile import LockFile
+    lock = LockFile("/some/file/or/other")
+    lock.acquire()
+    print lock.path, 'is locked.'
+    lock.release()
+
+If you don't want to wait forever, you might try::	
+
+    from lockfile import LockFile
+    lock = LockFile("/some/file/or/other")
+    while not lock.i_am_locking():
+	try:
+	    lock.acquire(timeout=60)    # wait up to 60 seconds
+	except LockTimeout:
+	    lock.break_lock()
+	    lock.acquire()
+    print "I locked", lock.path
+    lock.release()
+
+Other Libraries
+---------------
+
+The idea of implementing advisory locking with a standard API is not new
+with :mod:`lockfile`.  There are a number of other libraries available:
+
+* locknix - http://pypi.python.org/pypi/locknix - Unix only
+* mx.MiscLockFile - from Marc André Lemburg, part of the mx.Base
+  distribution - cross-platform.
+* Twisted - http://twistedmatrix.com/trac/browser/trunk/twisted/python/lockfile.py
+* zc.lockfile - http://pypi.python.org/pypi/zc.lockfile
+
+
+Contacting the Author
+---------------------
+
+If you encounter any problems with ``lockfile``, would like help or want to
+submit a patch, contact me directly: Skip Montanaro (skip@pobox.com).

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/80e25b46/tools/bin/pythonSrc/lockfile-0.9.1/lockfile/__init__.py
----------------------------------------------------------------------
diff --git a/tools/bin/pythonSrc/lockfile-0.9.1/lockfile/__init__.py b/tools/bin/pythonSrc/lockfile-0.9.1/lockfile/__init__.py
new file mode 100644
index 0000000..a167cd8
--- /dev/null
+++ b/tools/bin/pythonSrc/lockfile-0.9.1/lockfile/__init__.py
@@ -0,0 +1,286 @@
+
+"""
+lockfile.py - Platform-independent advisory file locks.
+
+Requires Python 2.5 unless you apply 2.4.diff
+Locking is done on a per-thread basis instead of a per-process basis.
+
+Usage:
+
+>>> lock = LockFile('somefile')
+>>> try:
+...     lock.acquire()
+... except AlreadyLocked:
+...     print 'somefile', 'is locked already.'
+... except LockFailed:
+...     print 'somefile', 'can\\'t be locked.'
+... else:
+...     print 'got lock'
+got lock
+>>> print lock.is_locked()
+True
+>>> lock.release()
+
+>>> lock = LockFile('somefile')
+>>> print lock.is_locked()
+False
+>>> with lock:
+...    print lock.is_locked()
+True
+>>> print lock.is_locked()
+False
+
+>>> lock = LockFile('somefile')
+>>> # It is okay to lock twice from the same thread...
+>>> with lock:
+...     lock.acquire()
+...
+>>> # Though no counter is kept, so you can't unlock multiple times...
+>>> print lock.is_locked()
+False
+
+Exceptions:
+
+    Error - base class for other exceptions
+        LockError - base class for all locking exceptions
+            AlreadyLocked - Another thread or process already holds the lock
+            LockFailed - Lock failed for some other reason
+        UnlockError - base class for all unlocking exceptions
+            AlreadyUnlocked - File was not locked.
+            NotMyLock - File was locked but not by the current thread/process
+"""
+
+import sys
+import socket
+import os
+import threading
+import time
+import urllib
+import warnings
+
+# Work with PEP8 and non-PEP8 versions of threading module.
+if not hasattr(threading, "current_thread"):
+    threading.current_thread = threading.currentThread
+if not hasattr(threading.Thread, "get_name"):
+    threading.Thread.get_name = threading.Thread.getName
+
+__all__ = ['Error', 'LockError', 'LockTimeout', 'AlreadyLocked',
+           'LockFailed', 'UnlockError', 'NotLocked', 'NotMyLock',
+           'LinkLockFile', 'MkdirLockFile', 'SQLiteLockFile',
+           'LockBase']
+
+class Error(Exception):
+    """
+    Base class for other exceptions.
+
+    >>> try:
+    ...   raise Error
+    ... except Exception:
+    ...   pass
+    """
+    pass
+
+class LockError(Error):
+    """
+    Base class for error arising from attempts to acquire the lock.
+
+    >>> try:
+    ...   raise LockError
+    ... except Error:
+    ...   pass
+    """
+    pass
+
+class LockTimeout(LockError):
+    """Raised when lock creation fails within a user-defined period of time.
+
+    >>> try:
+    ...   raise LockTimeout
+    ... except LockError:
+    ...   pass
+    """
+    pass
+
+class AlreadyLocked(LockError):
+    """Some other thread/process is locking the file.
+
+    >>> try:
+    ...   raise AlreadyLocked
+    ... except LockError:
+    ...   pass
+    """
+    pass
+
+class LockFailed(LockError):
+    """Lock file creation failed for some other reason.
+
+    >>> try:
+    ...   raise LockFailed
+    ... except LockError:
+    ...   pass
+    """
+    pass
+
+class UnlockError(Error):
+    """
+    Base class for errors arising from attempts to release the lock.
+
+    >>> try:
+    ...   raise UnlockError
+    ... except Error:
+    ...   pass
+    """
+    pass
+
+class NotLocked(UnlockError):
+    """Raised when an attempt is made to unlock an unlocked file.
+
+    >>> try:
+    ...   raise NotLocked
+    ... except UnlockError:
+    ...   pass
+    """
+    pass
+
+class NotMyLock(UnlockError):
+    """Raised when an attempt is made to unlock a file someone else locked.
+
+    >>> try:
+    ...   raise NotMyLock
+    ... except UnlockError:
+    ...   pass
+    """
+    pass
+
+class LockBase:
+    """Base class for platform-specific lock classes."""
+    def __init__(self, path, threaded=True):
+        """
+        >>> lock = LockBase('somefile')
+        >>> lock = LockBase('somefile', threaded=False)
+        """
+        self.path = path
+        self.lock_file = os.path.abspath(path) + ".lock"
+        self.hostname = socket.gethostname()
+        self.pid = os.getpid()
+        if threaded:
+            t = threading.current_thread()
+            # Thread objects in Python 2.4 and earlier do not have ident
+            # attrs.  Worm around that.
+            ident = getattr(t, "ident", hash(t))
+            self.tname = "-%x" % (ident & 0xffffffff)
+        else:
+            self.tname = ""
+        dirname = os.path.dirname(self.lock_file)
+        self.unique_name = os.path.join(dirname,
+                                        "%s%s.%s" % (self.hostname,
+                                                     self.tname,
+                                                     self.pid))
+
+    def acquire(self, timeout=None):
+        """
+        Acquire the lock.
+
+        * If timeout is omitted (or None), wait forever trying to lock the
+          file.
+
+        * If timeout > 0, try to acquire the lock for that many seconds.  If
+          the lock period expires and the file is still locked, raise
+          LockTimeout.
+
+        * If timeout <= 0, raise AlreadyLocked immediately if the file is
+          already locked.
+        """
+        raise NotImplemented("implement in subclass")
+
+    def release(self):
+        """
+        Release the lock.
+
+        If the file is not locked, raise NotLocked.
+        """
+        raise NotImplemented("implement in subclass")
+
+    def is_locked(self):
+        """
+        Tell whether or not the file is locked.
+        """
+        raise NotImplemented("implement in subclass")
+
+    def i_am_locking(self):
+        """
+        Return True if this object is locking the file.
+        """
+        raise NotImplemented("implement in subclass")
+
+    def break_lock(self):
+        """
+        Remove a lock.  Useful if a locking thread failed to unlock.
+        """
+        raise NotImplemented("implement in subclass")
+
+    def __enter__(self):
+        """
+        Context manager support.
+        """
+        self.acquire()
+        return self
+
+    def __exit__(self, *_exc):
+        """
+        Context manager support.
+        """
+        self.release()
+
+def _fl_helper(cls, mod, *args, **kwds):
+    warnings.warn("Import from %s module instead of lockfile package" % mod,
+                  DeprecationWarning, stacklevel=2)
+    # This is a bit funky, but it's only for awhile.  The way the unit tests
+    # are constructed this function winds up as an unbound method, so it
+    # actually takes three args, not two.  We want to toss out self.
+    if not isinstance(args[0], str):
+        # We are testing, avoid the first arg
+        args = args[1:]
+    if len(args) == 1 and not kwds:
+        kwds["threaded"] = True
+    return cls(*args, **kwds)
+
+def LinkFileLock(*args, **kwds):
+    """Factory function provided for backwards compatibility.
+
+    Do not use in new code.  Instead, import LinkLockFile from the
+    lockfile.linklockfile module.
+    """
+    import linklockfile
+    return _fl_helper(linklockfile.LinkLockFile, "lockfile.linklockfile",
+                      *args, **kwds)
+
+def MkdirFileLock(*args, **kwds):
+    """Factory function provided for backwards compatibility.
+
+    Do not use in new code.  Instead, import MkdirLockFile from the
+    lockfile.mkdirlockfile module.
+    """
+    import mkdirlockfile
+    return _fl_helper(mkdirlockfile.MkdirLockFile, "lockfile.mkdirlockfile",
+                      *args, **kwds)
+
+def SQLiteFileLock(*args, **kwds):
+    """Factory function provided for backwards compatibility.
+
+    Do not use in new code.  Instead, import SQLiteLockFile from the
+    lockfile.mkdirlockfile module.
+    """
+    import sqlitelockfile
+    return _fl_helper(sqlitelockfile.SQLiteLockFile, "lockfile.sqlitelockfile",
+                      *args, **kwds)
+
+if hasattr(os, "link"):
+    import linklockfile as _llf
+    LockFile = _llf.LinkLockFile
+else:
+    import mkdirlockfile as _mlf
+    LockFile = _mlf.MkdirLockFile
+
+FileLock = LockFile
+

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/80e25b46/tools/bin/pythonSrc/lockfile-0.9.1/lockfile/linklockfile.py
----------------------------------------------------------------------
diff --git a/tools/bin/pythonSrc/lockfile-0.9.1/lockfile/linklockfile.py b/tools/bin/pythonSrc/lockfile-0.9.1/lockfile/linklockfile.py
new file mode 100644
index 0000000..737fd08
--- /dev/null
+++ b/tools/bin/pythonSrc/lockfile-0.9.1/lockfile/linklockfile.py
@@ -0,0 +1,69 @@
+from __future__ import absolute_import
+
+import time
+import os
+
+from . import (LockBase, LockFailed, NotLocked, NotMyLock, LockTimeout,
+               AlreadyLocked)
+
+class LinkLockFile(LockBase):
+    """Lock access to a file using atomic property of link(2).
+
+    >>> lock = LinkLockFile('somefile')
+    >>> lock = LinkLockFile('somefile', threaded=False)
+    """
+
+    def acquire(self, timeout=None):
+        try:
+            open(self.unique_name, "wb").close()
+        except IOError:
+            raise LockFailed("failed to create %s" % self.unique_name)
+
+        end_time = time.time()
+        if timeout is not None and timeout > 0:
+            end_time += timeout
+
+        while True:
+            # Try and create a hard link to it.
+            try:
+                os.link(self.unique_name, self.lock_file)
+            except OSError:
+                # Link creation failed.  Maybe we've double-locked?
+                nlinks = os.stat(self.unique_name).st_nlink
+                if nlinks == 2:
+                    # The original link plus the one I created == 2.  We're
+                    # good to go.
+                    return
+                else:
+                    # Otherwise the lock creation failed.
+                    if timeout is not None and time.time() > end_time:
+                        os.unlink(self.unique_name)
+                        if timeout > 0:
+                            raise LockTimeout
+                        else:
+                            raise AlreadyLocked
+                    time.sleep(timeout is not None and timeout/10 or 0.1)
+            else:
+                # Link creation succeeded.  We're good to go.
+                return
+
+    def release(self):
+        if not self.is_locked():
+            raise NotLocked
+        elif not os.path.exists(self.unique_name):
+            raise NotMyLock
+        os.unlink(self.unique_name)
+        os.unlink(self.lock_file)
+
+    def is_locked(self):
+        return os.path.exists(self.lock_file)
+
+    def i_am_locking(self):
+        return (self.is_locked() and
+                os.path.exists(self.unique_name) and
+                os.stat(self.unique_name).st_nlink == 2)
+
+    def break_lock(self):
+        if os.path.exists(self.lock_file):
+            os.unlink(self.lock_file)
+

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/80e25b46/tools/bin/pythonSrc/lockfile-0.9.1/lockfile/mkdirlockfile.py
----------------------------------------------------------------------
diff --git a/tools/bin/pythonSrc/lockfile-0.9.1/lockfile/mkdirlockfile.py b/tools/bin/pythonSrc/lockfile-0.9.1/lockfile/mkdirlockfile.py
new file mode 100644
index 0000000..fb78902
--- /dev/null
+++ b/tools/bin/pythonSrc/lockfile-0.9.1/lockfile/mkdirlockfile.py
@@ -0,0 +1,79 @@
+from __future__ import absolute_import, division
+
+import time
+import os
+import sys
+import errno
+
+from . import (LockBase, LockFailed, NotLocked, NotMyLock, LockTimeout,
+               AlreadyLocked)
+
+class MkdirLockFile(LockBase):
+    """Lock file by creating a directory."""
+    def __init__(self, path, threaded=True):
+        """
+        >>> lock = MkdirLockFile('somefile')
+        >>> lock = MkdirLockFile('somefile', threaded=False)
+        """
+        LockBase.__init__(self, path, threaded)
+        # Lock file itself is a directory.  Place the unique file name into
+        # it.
+        self.unique_name  = os.path.join(self.lock_file,
+                                         "%s.%s%s" % (self.hostname,
+                                                      self.tname,
+                                                      self.pid))
+
+    def acquire(self, timeout=None):
+        end_time = time.time()
+        if timeout is not None and timeout > 0:
+            end_time += timeout
+
+        if timeout is None:
+            wait = 0.1
+        else:
+            wait = max(0, timeout / 10)
+
+        while True:
+            try:
+                os.mkdir(self.lock_file)
+            except OSError:
+                err = sys.exc_info()[1]
+                if err.errno == errno.EEXIST:
+                    # Already locked.
+                    if os.path.exists(self.unique_name):
+                        # Already locked by me.
+                        return
+                    if timeout is not None and time.time() > end_time:
+                        if timeout > 0:
+                            raise LockTimeout
+                        else:
+                            # Someone else has the lock.
+                            raise AlreadyLocked
+                    time.sleep(wait)
+                else:
+                    # Couldn't create the lock for some other reason
+                    raise LockFailed("failed to create %s" % self.lock_file)
+            else:
+                open(self.unique_name, "wb").close()
+                return
+
+    def release(self):
+        if not self.is_locked():
+            raise NotLocked
+        elif not os.path.exists(self.unique_name):
+            raise NotMyLock
+        os.unlink(self.unique_name)
+        os.rmdir(self.lock_file)
+
+    def is_locked(self):
+        return os.path.exists(self.lock_file)
+
+    def i_am_locking(self):
+        return (self.is_locked() and
+                os.path.exists(self.unique_name))
+
+    def break_lock(self):
+        if os.path.exists(self.lock_file):
+            for name in os.listdir(self.lock_file):
+                os.unlink(os.path.join(self.lock_file, name))
+            os.rmdir(self.lock_file)

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/80e25b46/tools/bin/pythonSrc/lockfile-0.9.1/lockfile/pidlockfile.py
----------------------------------------------------------------------
diff --git a/tools/bin/pythonSrc/lockfile-0.9.1/lockfile/pidlockfile.py b/tools/bin/pythonSrc/lockfile-0.9.1/lockfile/pidlockfile.py
new file mode 100644
index 0000000..10dcb31
--- /dev/null
+++ b/tools/bin/pythonSrc/lockfile-0.9.1/lockfile/pidlockfile.py
@@ -0,0 +1,189 @@
+# -*- coding: utf-8 -*-
+
+# pidlockfile.py
+#
+# Copyright © 2008–2009 Ben Finney <ben+python@benfinney.id.au>
+#
+# This is free software: you may copy, modify, and/or distribute this work
+# under the terms of the Python Software Foundation License, version 2 or
+# later as published by the Python Software Foundation.
+# No warranty expressed or implied. See the file LICENSE.PSF-2 for details.
+
+""" Lockfile behaviour implemented via Unix PID files.
+    """
+
+from __future__ import absolute_import
+
+import os
+import sys
+import errno
+import time
+
+from . import (LockBase, AlreadyLocked, LockFailed, NotLocked, NotMyLock,
+               LockTimeout)
+
+
+class PIDLockFile(LockBase):
+    """ Lockfile implemented as a Unix PID file.
+
+    The lock file is a normal file named by the attribute `path`.
+    A lock's PID file contains a single line of text, containing
+    the process ID (PID) of the process that acquired the lock.
+
+    >>> lock = PIDLockFile('somefile')
+    >>> lock = PIDLockFile('somefile')
+    """
+
+    def __init__(self, path, threaded=False):
+        # pid lockfiles don't support threaded operation, so always force
+        # False as the threaded arg.
+        LockBase.__init__(self, path, False)
+        dirname = os.path.dirname(self.lock_file)
+        basename = os.path.split(self.path)[-1]
+        self.unique_name = self.path
+
+    def read_pid(self):
+        """ Get the PID from the lock file.
+            """
+        return read_pid_from_pidfile(self.path)
+
+    def is_locked(self):
+        """ Test if the lock is currently held.
+
+            The lock is held if the PID file for this lock exists.
+
+            """
+        return os.path.exists(self.path)
+
+    def i_am_locking(self):
+        """ Test if the lock is held by the current process.
+
+        Returns ``True`` if the current process ID matches the
+        number stored in the PID file.
+        """
+        return self.is_locked() and os.getpid() == self.read_pid()
+
+    def acquire(self, timeout=None):
+        """ Acquire the lock.
+
+        Creates the PID file for this lock, or raises an error if
+        the lock could not be acquired.
+        """
+
+        end_time = time.time()
+        if timeout is not None and timeout > 0:
+            end_time += timeout
+
+        while True:
+            try:
+                write_pid_to_pidfile(self.path)
+            except OSError, exc:
+                if exc.errno == errno.EEXIST:
+                    # The lock creation failed.  Maybe sleep a bit.
+                    if timeout is not None and time.time() > end_time:
+                        if timeout > 0:
+                            raise LockTimeout
+                        else:
+                            raise AlreadyLocked
+                    time.sleep(timeout is not None and timeout/10 or 0.1)
+                else:
+                    raise LockFailed
+            else:
+                return
+
+    def release(self):
+        """ Release the lock.
+
+            Removes the PID file to release the lock, or raises an
+            error if the current process does not hold the lock.
+
+            """
+        if not self.is_locked():
+            raise NotLocked
+        if not self.i_am_locking():
+            raise NotMyLock
+        remove_existing_pidfile(self.path)
+
+    def break_lock(self):
+        """ Break an existing lock.
+
+            Removes the PID file if it already exists, otherwise does
+            nothing.
+
+            """
+        remove_existing_pidfile(self.path)
+
+def read_pid_from_pidfile(pidfile_path):
+    """ Read the PID recorded in the named PID file.
+
+        Read and return the numeric PID recorded as text in the named
+        PID file. If the PID file cannot be read, or if the content is
+        not a valid PID, return ``None``.
+
+        """
+    pid = None
+    try:
+        pidfile = open(pidfile_path, 'r')
+    except IOError:
+        pass
+    else:
+        # According to the FHS 2.3 section on PID files in /var/run:
+        # 
+        #   The file must consist of the process identifier in
+        #   ASCII-encoded decimal, followed by a newline character.
+        # 
+        #   Programs that read PID files should be somewhat flexible
+        #   in what they accept; i.e., they should ignore extra
+        #   whitespace, leading zeroes, absence of the trailing
+        #   newline, or additional lines in the PID file.
+
+        line = pidfile.readline().strip()
+        try:
+            pid = int(line)
+        except ValueError:
+            pass
+        pidfile.close()
+
+    return pid
+
+
+def write_pid_to_pidfile(pidfile_path):
+    """ Write the PID in the named PID file.
+
+        Get the numeric process ID (“PID”) of the current process
+        and write it to the named file as a line of text.
+
+        """
+    open_flags = (os.O_CREAT | os.O_EXCL | os.O_WRONLY)
+    open_mode = 0644
+    pidfile_fd = os.open(pidfile_path, open_flags, open_mode)
+    pidfile = os.fdopen(pidfile_fd, 'w')
+
+    # According to the FHS 2.3 section on PID files in /var/run:
+    #
+    #   The file must consist of the process identifier in
+    #   ASCII-encoded decimal, followed by a newline character. For
+    #   example, if crond was process number 25, /var/run/crond.pid
+    #   would contain three characters: two, five, and newline.
+
+    pid = os.getpid()
+    line = "%(pid)d\n" % vars()
+    pidfile.write(line)
+    pidfile.close()
+
+
+def remove_existing_pidfile(pidfile_path):
+    """ Remove the named PID file if it exists.
+
+        Removing a PID file that doesn't already exist puts us in the
+        desired state, so we ignore the condition if the file does not
+        exist.
+
+        """
+    try:
+        os.remove(pidfile_path)
+    except OSError, exc:
+        if exc.errno == errno.ENOENT:
+            pass
+        else:
+            raise

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/80e25b46/tools/bin/pythonSrc/lockfile-0.9.1/lockfile/sqlitelockfile.py
----------------------------------------------------------------------
diff --git a/tools/bin/pythonSrc/lockfile-0.9.1/lockfile/sqlitelockfile.py b/tools/bin/pythonSrc/lockfile-0.9.1/lockfile/sqlitelockfile.py
new file mode 100644
index 0000000..d044d2a
--- /dev/null
+++ b/tools/bin/pythonSrc/lockfile-0.9.1/lockfile/sqlitelockfile.py
@@ -0,0 +1,146 @@
+from __future__ import absolute_import, division
+
+import time
+import os
+
+from . import LockBase, NotLocked, NotMyLock, LockTimeout, AlreadyLocked
+
+class SQLiteLockFile(LockBase):
+    "Demonstrate SQL-based locking."
+
+    testdb = None
+
+    def __init__(self, path, threaded=True):
+        """
+        >>> lock = SQLiteLockFile('somefile')
+        >>> lock = SQLiteLockFile('somefile', threaded=False)
+        """
+        LockBase.__init__(self, path, threaded)
+        self.lock_file = unicode(self.lock_file)
+        self.unique_name = unicode(self.unique_name)
+
+        if SQLiteLockFile.testdb is None:
+            import tempfile
+            _fd, testdb = tempfile.mkstemp()
+            os.close(_fd)
+            os.unlink(testdb)
+            del _fd, tempfile
+            SQLiteLockFile.testdb = testdb
+
+        import sqlite3
+        self.connection = sqlite3.connect(SQLiteLockFile.testdb)
+        
+        c = self.connection.cursor()
+        try:
+            c.execute("create table locks"
+                      "("
+                      "   lock_file varchar(32),"
+                      "   unique_name varchar(32)"
+                      ")")
+        except sqlite3.OperationalError:
+            pass
+        else:
+            self.connection.commit()
+            import atexit
+            atexit.register(os.unlink, SQLiteLockFile.testdb)
+
+    def acquire(self, timeout=None):
+        end_time = time.time()
+        if timeout is not None and timeout > 0:
+            end_time += timeout
+
+        if timeout is None:
+            wait = 0.1
+        elif timeout <= 0:
+            wait = 0
+        else:
+            wait = timeout / 10
+
+        cursor = self.connection.cursor()
+
+        while True:
+            if not self.is_locked():
+                # Not locked.  Try to lock it.
+                cursor.execute("insert into locks"
+                               "  (lock_file, unique_name)"
+                               "  values"
+                               "  (?, ?)",
+                               (self.lock_file, self.unique_name))
+                self.connection.commit()
+
+                # Check to see if we are the only lock holder.
+                cursor.execute("select * from locks"
+                               "  where unique_name = ?",
+                               (self.unique_name,))
+                rows = cursor.fetchall()
+                if len(rows) > 1:
+                    # Nope.  Someone else got there.  Remove our lock.
+                    cursor.execute("delete from locks"
+                                   "  where unique_name = ?",
+                                   (self.unique_name,))
+                    self.connection.commit()
+                else:
+                    # Yup.  We're done, so go home.
+                    return
+            else:
+                # Check to see if we are the only lock holder.
+                cursor.execute("select * from locks"
+                               "  where unique_name = ?",
+                               (self.unique_name,))
+                rows = cursor.fetchall()
+                if len(rows) == 1:
+                    # We're the locker, so go home.
+                    return
+                    
+            # Maybe we should wait a bit longer.
+            if timeout is not None and time.time() > end_time:
+                if timeout > 0:
+                    # No more waiting.
+                    raise LockTimeout
+                else:
+                    # Someone else has the lock and we are impatient..
+                    raise AlreadyLocked
+
+            # Well, okay.  We'll give it a bit longer.
+            time.sleep(wait)
+
+    def release(self):
+        if not self.is_locked():
+            raise NotLocked
+        if not self.i_am_locking():
+            raise NotMyLock((self._who_is_locking(), self.unique_name))
+        cursor = self.connection.cursor()
+        cursor.execute("delete from locks"
+                       "  where unique_name = ?",
+                       (self.unique_name,))
+        self.connection.commit()
+
+    def _who_is_locking(self):
+        cursor = self.connection.cursor()
+        cursor.execute("select unique_name from locks"
+                       "  where lock_file = ?",
+                       (self.lock_file,))
+        return cursor.fetchone()[0]
+        
+    def is_locked(self):
+        cursor = self.connection.cursor()
+        cursor.execute("select * from locks"
+                       "  where lock_file = ?",
+                       (self.lock_file,))
+        rows = cursor.fetchall()
+        return not not rows
+
+    def i_am_locking(self):
+        cursor = self.connection.cursor()
+        cursor.execute("select * from locks"
+                       "  where lock_file = ?"
+                       "    and unique_name = ?",
+                       (self.lock_file, self.unique_name))
+        return not not cursor.fetchall()
+
+    def break_lock(self):
+        cursor = self.connection.cursor()
+        cursor.execute("delete from locks"
+                       "  where lock_file = ?",
+                       (self.lock_file,))
+        self.connection.commit()

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/80e25b46/tools/bin/pythonSrc/lockfile-0.9.1/setup.py
----------------------------------------------------------------------
diff --git a/tools/bin/pythonSrc/lockfile-0.9.1/setup.py b/tools/bin/pythonSrc/lockfile-0.9.1/setup.py
new file mode 100644
index 0000000..14735b7
--- /dev/null
+++ b/tools/bin/pythonSrc/lockfile-0.9.1/setup.py
@@ -0,0 +1,32 @@
+#!/usr/bin/env python
+
+V = "0.9.1"
+
+from distutils.core import setup
+setup(name='lockfile',
+      author='Skip Montanaro',
+      author_email='skip@pobox.com',
+      url='http://code.google.com/p/pylockfile/',
+      download_url=('http://code.google.com/p/pylockfile/downloads/'
+                    'detail?name=lockfile-%s.tar.gz' % V),
+      version=V,
+      description="Platform-independent file locking module",
+      long_description=open("README").read(),
+      packages=['lockfile'],
+      license='MIT License',
+      classifiers=[
+          'Development Status :: 4 - Beta',
+          'Intended Audience :: Developers',
+          'License :: OSI Approved :: MIT License',
+          'Operating System :: MacOS',
+          'Operating System :: Microsoft :: Windows :: Windows NT/2000',
+          'Operating System :: POSIX',
+          'Programming Language :: Python',
+          'Programming Language :: Python :: 2.4',
+          'Programming Language :: Python :: 2.5',
+          'Programming Language :: Python :: 2.6',
+          'Programming Language :: Python :: 2.7',
+          'Programming Language :: Python :: 3.0',
+          'Topic :: Software Development :: Libraries :: Python Modules',
+          ]
+      )

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/80e25b46/tools/bin/pythonSrc/lockfile-0.9.1/test/compliancetest.py
----------------------------------------------------------------------
diff --git a/tools/bin/pythonSrc/lockfile-0.9.1/test/compliancetest.py b/tools/bin/pythonSrc/lockfile-0.9.1/test/compliancetest.py
new file mode 100644
index 0000000..1cc5c99
--- /dev/null
+++ b/tools/bin/pythonSrc/lockfile-0.9.1/test/compliancetest.py
@@ -0,0 +1,222 @@
+import os
+import threading
+import shutil
+
+import lockfile
+
+class ComplianceTest(object):
+    def __init__(self):
+        self.saved_class = lockfile.LockFile
+
+    def _testfile(self):
+        """Return platform-appropriate file.  Helper for tests."""
+        import tempfile
+        return os.path.join(tempfile.gettempdir(), 'trash-%s' % os.getpid())
+
+    def setup(self):
+        lockfile.LockFile = self.class_to_test
+
+    def teardown(self):
+        try:
+            tf = self._testfile()
+            if os.path.isdir(tf):
+                shutil.rmtree(tf)
+            elif os.path.isfile(tf):
+                os.unlink(tf)
+            elif not os.path.exists(tf):
+                pass
+            else:
+                raise SystemError("unrecognized file: %s" % tf)
+        finally:
+            lockfile.LockFile = self.saved_class
+
+    def _test_acquire_helper(self, tbool):
+        # As simple as it gets.
+        lock = lockfile.LockFile(self._testfile(), threaded=tbool)
+        lock.acquire()
+        assert lock.i_am_locking()
+        lock.release()
+        assert not lock.is_locked()
+
+##    def test_acquire_basic_threaded(self):
+##        self._test_acquire_helper(True)
+
+    def test_acquire_basic_unthreaded(self):
+        self._test_acquire_helper(False)
+
+    def _test_acquire_no_timeout_helper(self, tbool):
+        # No timeout test
+        e1, e2 = threading.Event(), threading.Event()
+        t = _in_thread(self._lock_wait_unlock, e1, e2)
+        e1.wait()         # wait for thread t to acquire lock
+        lock2 = lockfile.LockFile(self._testfile(), threaded=tbool)
+        assert lock2.is_locked()
+        if tbool:
+            assert not lock2.i_am_locking()
+        else:
+            assert lock2.i_am_locking()
+
+        try:
+            lock2.acquire(timeout=-1)
+        except lockfile.AlreadyLocked:
+            pass
+        else:
+            lock2.release()
+            raise AssertionError("did not raise AlreadyLocked in"
+                                 " thread %s" %
+                                 threading.current_thread().get_name())
+
+        e2.set()          # tell thread t to release lock
+        t.join()
+
+##    def test_acquire_no_timeout_threaded(self):
+##        self._test_acquire_no_timeout_helper(True)
+
+##    def test_acquire_no_timeout_unthreaded(self):
+##        self._test_acquire_no_timeout_helper(False)
+
+    def _test_acquire_timeout_helper(self, tbool):
+        # Timeout test
+        e1, e2 = threading.Event(), threading.Event()
+        t = _in_thread(self._lock_wait_unlock, e1, e2)
+        e1.wait()                # wait for thread t to acquire lock
+        lock2 = lockfile.LockFile(self._testfile(), threaded=tbool)
+        assert lock2.is_locked()
+        try:
+            lock2.acquire(timeout=0.1)
+        except lockfile.LockTimeout:
+            pass
+        else:
+            lock2.release()
+            raise AssertionError("did not raise LockTimeout in thread %s" %
+                                 threading.current_thread().get_name())
+
+        e2.set()
+        t.join()
+
+##    def test_acquire_timeout_threaded(self):
+##        self._test_acquire_timeout_helper(True)
+
+    def test_acquire_timeout_unthreaded(self):
+        self._test_acquire_timeout_helper(False)
+
+    def _test_release_basic_helper(self, tbool):
+        lock = lockfile.LockFile(self._testfile(), threaded=tbool)
+        lock.acquire()
+        assert lock.is_locked()
+        lock.release()
+        assert not lock.is_locked()
+        assert not lock.i_am_locking()
+        try:
+            lock.release()
+        except lockfile.NotLocked:
+            pass
+        except lockfile.NotMyLock:
+            raise AssertionError('unexpected exception: %s' %
+                                 lockfile.NotMyLock)
+        else:
+            raise AssertionError('erroneously unlocked file')
+
+##    def test_release_basic_threaded(self):
+##        self._test_release_basic_helper(True)
+
+    def test_release_basic_unthreaded(self):
+        self._test_release_basic_helper(False)
+
+##    def test_release_from_thread(self):
+##        e1, e2 = threading.Event(), threading.Event()
+##        t = _in_thread(self._lock_wait_unlock, e1, e2)
+##        e1.wait()
+##        lock2 = lockfile.LockFile(self._testfile(), threaded=False)
+##        assert not lock2.i_am_locking()
+##        try:
+##            lock2.release()
+##        except lockfile.NotMyLock:
+##            pass
+##        else:
+##            raise AssertionError('erroneously unlocked a file locked'
+##                                 ' by another thread.')
+##        e2.set()
+##        t.join()
+
+    def _test_is_locked_helper(self, tbool):
+        lock = lockfile.LockFile(self._testfile(), threaded=tbool)
+        lock.acquire(timeout=2)
+        assert lock.is_locked()
+        lock.release()
+        assert not lock.is_locked(), "still locked after release!"
+
+##    def test_is_locked_threaded(self):
+##        self._test_is_locked_helper(True)
+
+    def test_is_locked_unthreaded(self):
+        self._test_is_locked_helper(False)
+
+##    def test_i_am_locking_threaded(self):
+##        self._test_i_am_locking_helper(True)
+
+    def test_i_am_locking_unthreaded(self):
+        self._test_i_am_locking_helper(False)
+
+    def _test_i_am_locking_helper(self, tbool):
+        lock1 = lockfile.LockFile(self._testfile(), threaded=tbool)
+        assert not lock1.is_locked()
+        lock1.acquire()
+        try:
+            assert lock1.i_am_locking()
+            lock2 = lockfile.LockFile(self._testfile(), threaded=tbool)
+            assert lock2.is_locked()
+            if tbool:
+                assert not lock2.i_am_locking()
+        finally:
+            lock1.release()
+
+    def _test_break_lock_helper(self, tbool):
+        lock = lockfile.LockFile(self._testfile(), threaded=tbool)
+        lock.acquire()
+        assert lock.is_locked()
+        lock2 = lockfile.LockFile(self._testfile(), threaded=tbool)
+        assert lock2.is_locked()
+        lock2.break_lock()
+        assert not lock2.is_locked()
+        try:
+            lock.release()
+        except lockfile.NotLocked:
+            pass
+        else:
+            raise AssertionError('break lock failed')
+
+##    def test_break_lock_threaded(self):
+##        self._test_break_lock_helper(True)
+
+    def test_break_lock_unthreaded(self):
+        self._test_break_lock_helper(False)
+
+    def _lock_wait_unlock(self, event1, event2):
+        """Lock from another thread.  Helper for tests."""
+        l = lockfile.LockFile(self._testfile())
+        l.acquire()
+        try:
+            event1.set()  # we're in,
+            event2.wait() # wait for boss's permission to leave
+        finally:
+            l.release()
+
+    def test_enter(self):
+        lock = lockfile.LockFile(self._testfile())
+        lock.acquire()
+        try:
+            assert lock.is_locked(), "Not locked after acquire!"
+        finally:
+            lock.release()
+        assert not lock.is_locked(), "still locked after release!"
+
+def _in_thread(func, *args, **kwargs):
+    """Execute func(*args, **kwargs) after dt seconds. Helper for tests."""
+    def _f():
+        func(*args, **kwargs)
+    t = threading.Thread(target=_f, name='/*/*')
+    t.setDaemon(True)
+    t.start()
+    return t
+

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/80e25b46/tools/bin/pythonSrc/lockfile-0.9.1/test/test_lockfile.py
----------------------------------------------------------------------
diff --git a/tools/bin/pythonSrc/lockfile-0.9.1/test/test_lockfile.py b/tools/bin/pythonSrc/lockfile-0.9.1/test/test_lockfile.py
new file mode 100644
index 0000000..3b70cdd
--- /dev/null
+++ b/tools/bin/pythonSrc/lockfile-0.9.1/test/test_lockfile.py
@@ -0,0 +1,30 @@
+import sys
+
+import lockfile.linklockfile, lockfile.mkdirlockfile, lockfile.pidlockfile
+
+from compliancetest import ComplianceTest
+    
+class TestLinkLockFile(ComplianceTest):
+    class_to_test = lockfile.linklockfile.LinkLockFile
+
+class TestMkdirLockFile(ComplianceTest):
+    class_to_test = lockfile.mkdirlockfile.MkdirLockFile
+
+class TestPIDLockFile(ComplianceTest):
+    class_to_test = lockfile.pidlockfile.PIDLockFile
+
+# Check backwards compatibility
+class TestLinkFileLock(ComplianceTest):
+    class_to_test = lockfile.LinkFileLock
+
+class TestMkdirFileLock(ComplianceTest):
+    class_to_test = lockfile.MkdirFileLock
+
+try:
+    import sqlite3
+except ImportError:
+    pass
+else:
+    import lockfile.sqlitelockfile
+    class TestSQLiteLockFile(ComplianceTest):
+        class_to_test = lockfile.sqlitelockfile.SQLiteLockFile

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/80e25b46/tools/bin/pythonSrc/pychecker-0.8.18/COPYRIGHT
----------------------------------------------------------------------
diff --git a/tools/bin/pythonSrc/pychecker-0.8.18/COPYRIGHT b/tools/bin/pythonSrc/pychecker-0.8.18/COPYRIGHT
new file mode 100644
index 0000000..59e9b2f
--- /dev/null
+++ b/tools/bin/pythonSrc/pychecker-0.8.18/COPYRIGHT
@@ -0,0 +1,31 @@
+Copyright (c) 2000-2001, MetaSlash Inc.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+ - Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+
+ - Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the
+   distribution.
+
+ - Neither name of MetaSlash Inc. nor the names of contributors
+   may be used to endorse or promote products derived
+   from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR
+CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/80e25b46/tools/bin/pythonSrc/pychecker-0.8.18/ChangeLog
----------------------------------------------------------------------
diff --git a/tools/bin/pythonSrc/pychecker-0.8.18/ChangeLog b/tools/bin/pythonSrc/pychecker-0.8.18/ChangeLog
new file mode 100644
index 0000000..8284bfa
--- /dev/null
+++ b/tools/bin/pythonSrc/pychecker-0.8.18/ChangeLog
@@ -0,0 +1,349 @@
+2008-07-29  Thomas Vander Stichele  <thomas at apestaart dot org>
+
+	* test/common.py:
+	* test/test_module.py:
+	* test/test_stdlib.py:
+	  Switch to mixedCase as Neil prefers.
+
+2008-07-14  Thomas Vander Stichele  <thomas at apestaart dot org>
+
+	* pychecker/checker.py:
+	  Don't pollute sys.path by inserting every moduleDir into it.
+	  This allows projects to have for example a gtk.py file in a
+	  package that does not conflict with the gtk system library.
+	  Instead, pollute it right before loading the module, then clean up
+	  immediately after.
+
+2008-07-14  Thomas Vander Stichele  <thomas at apestaart dot org>
+
+	* setup.py:
+	  If installing to a staging root, don't include this path in the
+	  install_lib dir.
+	* setup.cfg:
+	  Set optimize = 1 to make rpm not complain about installed but
+	  missing .pyo files.
+	  Fixes python setup.py bdist_rpm
+
+2008-07-14  Thomas Vander Stichele  <thomas at apestaart dot org>
+
+	* pychecker/checker.py:
+	  Make sure args passed for checking now create PyCheckerModule
+	  instances with moduleDir set properly.  This triggers the new
+	  code behaviour where modules are stored as a moduleName, moduleDir
+	  tuple in pcmodules.py, making sure same-named modules get treated
+	  separately.
+	  New test suite now passes again.
+	  Fixes #1563572.
+
+2008-07-14  Thomas Vander Stichele  <thomas at apestaart dot org>
+
+	* test/input/getmodule/A/C.py:
+	* test/input/getmodule/A/__init__.py:
+	* test/input/getmodule/B/C.py:
+	* test/input/getmodule/B/__init__.py:
+	* test/input/getmodule/__init__.py:
+	* test/input/test_getmodule.py:
+	* test/test_module.py:
+	* test/main.py:
+	  Add a test that shows how warnings in modules with the same name,
+	  but different directories, shadow each other. See
+	  http://sourceforge.net/tracker/index.php?func=detail&aid=1563572&group_id=24686&atid=382217
+
+2008-07-14  Thomas Vander Stichele  <thomas at apestaart dot org>
+
+	* test/common.py:
+	  add check_multiple test method that allows checking more than one
+	  argument.
+	* test/expected/test_zope_interface:
+	  update expected string
+
+2008-07-14  Thomas Vander Stichele  <thomas at apestaart dot org>
+
+	* pychecker/pcmodules.py:
+	  New module; replaces checker._allModules
+	  Allows us to track and differentiate between modules with the same
+	  name but from different paths.
+	* pychecker/checker.py:
+	  Use it instead of _allModules
+	* pychecker/warn.py:
+	  Also use it in the code that checks if a base class's __init__ was
+	  called, instead of only checking sys.modules, which only works
+	  if we pollute sys.modules (which is what we're trying to fix)
+
+2008-07-13  Thomas Vander Stichele  <thomas at apestaart dot org>
+
+	* pychecker/checker.py:
+	  Instantiate Class with the PycheckerModule instance instead of the
+	  real module; this allows us to see and act on presence of moduleDir.
+
+2008-07-13  Thomas Vander Stichele  <thomas at apestaart dot org>
+
+	* pychecker/checker.py:
+	  Change _findModule to take an optional moduleDir keyword argument.
+	  Use it in setupMainCode
+	  Make sibling imports work by temporarily putting moduleDir on
+	  sys.path
+
+2008-07-13  Thomas Vander Stichele  <thomas at apestaart dot org>
+
+	* pychecker/checker.py:
+	  Add self.moduleDir to filename() for PyCheckerModule.
+
+2008-07-13  Thomas Vander Stichele  <thomas at apestaart dot org>
+
+	* pychecker/checker.py:
+	  Refactor code such that we can pass a moduleDir keyword argument to
+	  PyCheckerModule.  This will allow us to discern between modules
+	  with the same name, but in a different directory.
+	  Change allModules to be a dict of (moduleName, moduleDir) -> module
+	  No behaviour change yet.
+
+2008-07-13  Thomas Vander Stichele  <thomas at apestaart dot org>
+
+	* pychecker/checker.py:
+	  When showing what we're processing, show module name and file name.
+	* test_expected/test1:
+	* test_expected/test1-2.3:
+	* test_expected/test1-2.4:
+	* test_expected/test1-2.5:
+	* test_expected/test10:
+	* test_expected/test100:
+	* test_expected/test101:
+	* test_expected/test11:
+	* test_expected/test12:
+	* test_expected/test13:
+	* test_expected/test14:
+	* test_expected/test15:
+	* test_expected/test16:
+	* test_expected/test17:
+	* test_expected/test17-2.4:
+	* test_expected/test18:
+	* test_expected/test19:
+	* test_expected/test2:
+	* test_expected/test20:
+	* test_expected/test20-2.4:
+	* test_expected/test20-2.5:
+	* test_expected/test21:
+	* test_expected/test22:
+	* test_expected/test23:
+	* test_expected/test24:
+	* test_expected/test25:
+	* test_expected/test26:
+	* test_expected/test27:
+	* test_expected/test27-2.2:
+	* test_expected/test27-2.3:
+	* test_expected/test27-2.4:
+	* test_expected/test27-2.5:
+	* test_expected/test28:
+	* test_expected/test29:
+	* test_expected/test3:
+	* test_expected/test3-2.2:
+	* test_expected/test3-2.3:
+	* test_expected/test3-2.4:
+	* test_expected/test3-2.5:
+	* test_expected/test30:
+	* test_expected/test31:
+	* test_expected/test32:
+	* test_expected/test33:
+	* test_expected/test34:
+	* test_expected/test34-2.2:
+	* test_expected/test34-2.3:
+	* test_expected/test34-2.4:
+	* test_expected/test34-2.5:
+	* test_expected/test35:
+	* test_expected/test36:
+	* test_expected/test37:
+	* test_expected/test38:
+	* test_expected/test39:
+	* test_expected/test39-2.2:
+	* test_expected/test39-2.3:
+	* test_expected/test39-2.4:
+	* test_expected/test39-2.5:
+	* test_expected/test4:
+	* test_expected/test40:
+	* test_expected/test41:
+	* test_expected/test42:
+	* test_expected/test43:
+	* test_expected/test44:
+	* test_expected/test45:
+	* test_expected/test46:
+	* test_expected/test47:
+	* test_expected/test48:
+	* test_expected/test49:
+	* test_expected/test5:
+	* test_expected/test50:
+	* test_expected/test51:
+	* test_expected/test52:
+	* test_expected/test53:
+	* test_expected/test54:
+	* test_expected/test55:
+	* test_expected/test56:
+	* test_expected/test57:
+	* test_expected/test58:
+	* test_expected/test58-2.2:
+	* test_expected/test58-2.3:
+	* test_expected/test58-2.4:
+	* test_expected/test58-2.5:
+	* test_expected/test59:
+	* test_expected/test6:
+	* test_expected/test60:
+	* test_expected/test61:
+	* test_expected/test62:
+	* test_expected/test63:
+	* test_expected/test64:
+	* test_expected/test65:
+	* test_expected/test66:
+	* test_expected/test67:
+	* test_expected/test68:
+	* test_expected/test68-2.4:
+	* test_expected/test68-2.5:
+	* test_expected/test69:
+	* test_expected/test7:
+	* test_expected/test70:
+	* test_expected/test71:
+	* test_expected/test71-2.4:
+	* test_expected/test71-2.5:
+	* test_expected/test72:
+	* test_expected/test73:
+	* test_expected/test74:
+	* test_expected/test74-2.4:
+	* test_expected/test74-2.5:
+	* test_expected/test75:
+	* test_expected/test75-2.2:
+	* test_expected/test75-2.3:
+	* test_expected/test75-2.4:
+	* test_expected/test75-2.5:
+	* test_expected/test76:
+	* test_expected/test77:
+	* test_expected/test78:
+	* test_expected/test79:
+	* test_expected/test8:
+	* test_expected/test80:
+	* test_expected/test80-2.2:
+	* test_expected/test80-2.3:
+	* test_expected/test80-2.4:
+	* test_expected/test80-2.5:
+	* test_expected/test81:
+	* test_expected/test82:
+	* test_expected/test83:
+	* test_expected/test84:
+	* test_expected/test85:
+	* test_expected/test86:
+	* test_expected/test87:
+	* test_expected/test88:
+	* test_expected/test88-2.4:
+	* test_expected/test89:
+	* test_expected/test89-2.2:
+	* test_expected/test89-2.3:
+	* test_expected/test89-2.4:
+	* test_expected/test89-2.5:
+	* test_expected/test9:
+	* test_expected/test90:
+	* test_expected/test92:
+	* test_expected/test93:
+	* test_expected/test94:
+	* test_expected/test95:
+	* test_expected/test96:
+	* test_expected/test97:
+	* test_expected/test98:
+	* test_expected/test99:
+	  Fix all expected test output for this change, without any
+	  regressions.
+
+2008-07-13  Thomas Vander Stichele  <thomas at apestaart dot org>
+
+	* pychecker/checker.py:
+	  Document and change getModules such that, for each argument
+	  that is a file, it returns a moduleName, moduleDir tuple
+	  so that modules with the same name can still be treated separately.
+	  Change callers to follow.
+	  First step towards fixing the bug where modules with the same name
+	  shadow each other's pychecker warnings.
+
+2008-07-13  Thomas Vander Stichele  <thomas at apestaart dot org>
+
+	* test/common.py:
+	  Document method.
+
+2008-07-12  Thomas Vander Stichele  <thomas at apestaart dot org>
+
+	* pychecker/warn.py:
+	  Change getStandardLibrary to getStandardLibraries (a list),
+	  so we can handle both the arch-invariant and arch-specific python
+	  site-packages.
+	  This makes sure that -q/--stdlib works the same way on 32-bit and
+	  64-bit systems.
+	  Fixes #1564614, and makes the new test suite pass.
+	  (Try it with python test/main.py)
+
+2008-07-12  Thomas Vander Stichele  <thomas at apestaart dot org>
+
+	* test/test_stdlib.py:
+	  Rename and document test.
+
+2008-07-12  Thomas Vander Stichele  <thomas at apestaart dot org>
+
+	* test/common.py:
+	* test/expected/test_zope_interface:
+	* test/input/test_zope_interface.py:
+	* test/main.py:
+	* test/test_stdlib.py:
+	  Add a first stab at a unittest-based testsuite.
+	  Add a test for bug #382217 that I wanted to fix that can't
+	  be tested in the current test suite.
+
+2008-07-04  Thomas Vander Stichele  <thomas at apestaart dot org>
+
+	* test_input/test86.py:
+	  Add a test for except KeyboardInterrupt, which was fixed by Neil
+	  in pychecker/CodeChecks.py: 1.170 on 23-Apr-07.
+
+2008-07-02  Thomas Vander Stichele  <thomas at apestaart dot org>
+
+	* pychecker/CodeChecks.py:
+	  Allow using setattr with a static argument inside lambda calls,
+	  where the alternative is a syntax error since you're not allowed to
+	  do an assignment expression.
+	  Fixes #1565876.
+
+2008-07-01  Thomas Vander Stichele  <thomas at apestaart dot org>
+
+	* pychecker/checker.py:
+	  Revert IDLE patch which breaks test42.py
+	  See #2007203.
+
+2008-07-01  Thomas Vander Stichele  <thomas at apestaart dot org>
+
+	* pychecker/checker.py:
+	* pychecker/warn.py:
+	  Respect the blacklist of modules when warning about classes for
+	  which the module cannot be found.
+	* test_check.sh:
+	* test_expected/test101:
+	* test_input/test101.py:
+	  Add a test for it.
+	  Fixes #1563495.
+
+2008-07-01  Thomas Vander Stichele  <thomas at apestaart dot org>
+
+	* test_expected/test100:
+	* test_input/test100.py:
+	  Actually add the tests.
+
+2008-06-30  Thomas Vander Stichele  <thomas at apestaart dot org>
+
+	* pychecker/checker.py:
+	  If an object looks like a class object because it has __bases__
+	  but it does not have __names__, make up a name.
+	  Fixes #1563494.
+	* test_check.sh:
+	  Add a test that previously failed.
+
+2008-06-30  Thomas Vander Stichele  <thomas at apestaart dot org>
+
+	* MANIFEST.in:
+	* CHANGELOG:
+	* NEWS:
+	  Moved CHANGELOG to NEWS since it really contains release news.
+	  Created real ChangeLog.
+

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/80e25b46/tools/bin/pythonSrc/pychecker-0.8.18/KNOWN_BUGS
----------------------------------------------------------------------
diff --git a/tools/bin/pythonSrc/pychecker-0.8.18/KNOWN_BUGS b/tools/bin/pythonSrc/pychecker-0.8.18/KNOWN_BUGS
new file mode 100644
index 0000000..36f05d3
--- /dev/null
+++ b/tools/bin/pythonSrc/pychecker-0.8.18/KNOWN_BUGS
@@ -0,0 +1,100 @@
+
+Crash when running on code that does:
+
+	from wxPython.wx import *
+
+The problem is in wxGTK-2.2.6 and earlier versions.
+
+Below is a patch to wxGTK 2.2.6 that fixes the problem.
+
+This problem has been reported:  
+http://sourceforge.net/tracker/?func=detail&atid=109863&aid=417923&group_id=9863
+
+-----------
+
+*** src/gtk/app.cpp.orig	Sat Apr 21 17:12:35 2001
+--- src/gtk/app.cpp	Sat Apr 21 17:14:46 2001
+***************
+*** 582,597 ****
+--- 582,600 ----
+  
+      // GL: I'm annoyed ... I don't know where to put this and I don't want to
+      // create a module for that as it's part of the core.
+  #if wxUSE_THREADS
+      delete wxPendingEvents;
++     wxPendingEvents = 0;
+      delete wxPendingEventsLocker;
++     wxPendingEventsLocker = 0;
+  #endif
+  
+      wxSystemSettings::Done();
+  
+      delete[] wxBuffer;
++     wxBuffer = 0;
+  
+      wxClassInfo::CleanUpClasses();
+  
+      // check for memory leaks
+  #if (defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT
+*** src/common/resource.cpp.orig	Sat Apr 21 17:10:23 2001
+--- src/common/resource.cpp	Sat Apr 21 17:06:42 2001
+***************
+*** 110,121 ****
+--- 110,125 ----
+  }
+  
+  void wxCleanUpResourceSystem()
+  {
+      delete wxDefaultResourceTable;
++     wxDefaultResourceTable = 0;
+      if (wxResourceBuffer)
++     {
+          delete[] wxResourceBuffer;
++         wxResourceBuffer = 0;
++     }
+  }
+  
+  void wxLogWarning(char *msg)
+  {
+      wxMessageBox(msg, _("Warning"), wxOK);
+
+---------------------------------------------------------------------
+
+exec statements are not checked.  Therefore, variables and modules used in 
+exec statements may cause spurious warnings.  To avoid the warnings,
+consider rewriting your code to use eval() or getattr().
+
+For example, consider rewriting this code:
+
+	exec 'var = object.' + member
+	print var
+
+to:
+
+	var = eval('object.' + member)
+	print var
+
+or:
+
+	var = getattr(object, member)
+	print var
+
+---------------------------------------------------------------------
+
+The following code generates a spurious warning:
+
+	from XXX import *
+
+	class SameName:
+	    def __init__(self): pass
+
+And in the file XXX:
+
+	class SameName:
+	    def __init__(self, c): pass
+
+	class Anyname:
+	    def __init__(self):
+	        self.xxx = SameName(1)
+
+---------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/80e25b46/tools/bin/pythonSrc/pychecker-0.8.18/MAINTAINERS
----------------------------------------------------------------------
diff --git a/tools/bin/pythonSrc/pychecker-0.8.18/MAINTAINERS b/tools/bin/pythonSrc/pychecker-0.8.18/MAINTAINERS
new file mode 100644
index 0000000..61b901d
--- /dev/null
+++ b/tools/bin/pythonSrc/pychecker-0.8.18/MAINTAINERS
@@ -0,0 +1,81 @@
+
+Neal Norwitz            nnorwitz@gmail.com
+Eric C. Newton          ecn@metaslash.com
+
+
+Other Contributors:
+
+Barry Scott             barry@scottb.demon.co.uk
+                                Fix Base class not init spurious warning
+                                Other misc suggestions and fixes
+
+Shakeeb Alireza                 bug reports
+Andy Anderson                   many bug reports and fixes
+Erwin S. Andreasen              bug reports
+Anthony Baxter                  bug reports
+Alexander Belchenko             bug reports and fixes
+Jeff Bellegarde                 bug reports and fixes
+Andrew Bennetts                 suggestion: check for modifying def arg values
+Riaan Booysen                   bug reports, suggestions, etc.
+John Bowe                       bug reports, suggestions, etc.
+Mike Brown                      bug report
+Gary Capell                     bug reports and refactoring suggestions
+Loris Caren                     testing, etc.
+Charles Cazabon                 bug report
+Nicolas Chauvat                 setup.py
+Allan Crooks                    bug reports
+Jeff Collins                    checker.findModule
+Tom Culliton                    bug reports and suggestions
+Andr� Dahlqvist                 bug reports
+Walter Doerwald                 bug reports and fixes
+Mika Eloranta                   bug reports
+Jeff Epler                      bug reports
+Mark Favas                      bug reports
+Erik Max Francis                bug reports and suggestions
+Dan Fandrich                    bug reports
+Alexandre Fayolle               bug reports
+Jeremy Fincher                  bug reports
+Horst Gassner                   bug reports and suggestions
+Stuart D. Gathman               bug reports and suggestions
+Geoff Gerrietts                 bug reports
+Johannes Gijsbers               bug reports
+Hartmut Goebel                  patches
+Joel Gould                      bug reports
+greep                           bug reports
+John-Mark Gurney                bug reports
+Thomas Heller                   bug reports and suggestions
+Raymond Hettinger               suggestions
+Tim Hochberg                    bug reports
+Eric Huss                       bug reports
+Ben Hutchings                   bug reports
+Jeremy Hylton                   bug reports and suggestions
+Garth T Kidd                    bug reports and suggestions
+Bastian Kleineidam              patches
+Brad Knotwell                   bug reports
+John Machin                     bug reports
+Jonathan Mark                   bug reports and suggestions
+Evelyn Mitchell                 bug reports
+Skip Montanaro                  bug reports and suggestions
+Michele Moore                   many suggestions
+Jon Nelson                      fix setup.py, add MANIFEST.in
+Jason Orendorff                 suggestions
+Ian Parker                      suggestions
+Fernando P�rez                  bug reports
+Kenneth Pronovici               debian maintainer, bug reports, patches, setup.py
+Eric S. Raymond                 bug reports and suggestions
+Terry Reedy                     suggestions
+Jon Ribbens                     bugs, bugs, bugs
+Guido van Rossum                bug reports and suggestions
+Jim Rutledge                    bug reports and suggestions
+Rich Salz                       bug reports and suggestions
+John Shue                       patches, etc.
+Stephan A. Terre                bug reports
+Lucio Torre                     suggestions
+Miloslav Trmac                  bug reports and patches
+Sheng-Te Tsao                   bug reports and suggestions
+Kevin Turner                    bug report
+Joe VanAndel                    bug reports
+Greg Ward                       bug reports, patches, etc
+Barry Warsaw                    bug reports
+Matt Wilson                     bug reports and fixes
+Andy Wingo                      bug reports and fixes

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/80e25b46/tools/bin/pythonSrc/pychecker-0.8.18/MANIFEST.in
----------------------------------------------------------------------
diff --git a/tools/bin/pythonSrc/pychecker-0.8.18/MANIFEST.in b/tools/bin/pythonSrc/pychecker-0.8.18/MANIFEST.in
new file mode 100644
index 0000000..f4c77a2
--- /dev/null
+++ b/tools/bin/pythonSrc/pychecker-0.8.18/MANIFEST.in
@@ -0,0 +1,2 @@
+include COPYRIGHT VERSION ChangeLog KNOWN_BUGS MAINTAINERS NEWS TODO 
+include README pycheckrc 


Mime
View raw message