Commits

Ben Bass  committed 1cc7c43

minor cleanup

  • Participants
  • Parent commits 43aeb53

Comments (0)

Files changed (4)

File pylibftdi/_base.py

 # This module contains things needed by at least one other
 # module so as to prevent circular imports.
 
-__ALL__ = ['Refuser', 'ParrotEgg', 'DeadParrot', 'FtdiError']
-
-
-class Refuser(object):
-
-    def __getattribute__(self, key):
-        # perhaps we should produce an appropriate quote at random...
-        raise TypeError(object.__getattribute__(self, 'message'))
-
-    def __setattr__(self, key, val):
-        raise TypeError(object.__getattribute__(self, 'message'))
-
-    def __call__(self, *o, **kw):
-        raise TypeError(object.__getattribute__(self, 'message'))
-
-
-class ParrotEgg(Refuser):
-    message = "This object is not yet... (missing open()?)"
-
-
-class DeadParrot(Refuser):
-    message = "This object is no more!"
+__ALL__ = ['FtdiError']
 
 
 class FtdiError(Exception):

File tests/__init__.py

 """tests for pylibftdi"""
+
+# this file must exist for python -m unittest discover to work

File tests/test_all.py

-
-#from pylibftdi.tests.test_common import unittest
-#from pylibftdi.tests import test_bitbang, test_driver
-
-#unittest.main()

File tests/test_common.py

 functionality without requiring an actual hardware device
 to be attached.
 """
+import logging
 
 import sys
 if sys.version_info < (2, 7):
 else:
     import unittest  # NOQA
 
-VERBOSE = False
-
 
 class SimpleMock(object):
     """
 
     def __call__(self, *o, **k):
         CallLog.append(self.__name)
-        if VERBOSE:
-            print("%s(*%s, **%s)" % (self.__name, o, k))
+        logging.debug("%s(*%s, **%s)" % (self.__name, o, k))
         return 0
 
 
 # importing this _does_ things...
 pylibftdi.driver.Driver = MockDriver
 
-if set(['-v', '--verbose']) & set(sys.argv):
-    VERBOSE = True
+verbose = set(['-v', '--verbose']) & set(sys.argv)
+logging.basicConfig(level=logging.DEBUG if verbose else logging.INFO)