Ben Bass avatar Ben Bass committed 817b568

fixes following refactoring

Comments (0)

Files changed (5)

+pylibftdi changes
+=================
+
+0.5
+ * fix various bugs found by pyflakes
+ * improve module organisation, while providing interface compatibility
+0.4.1
+ * fix release issue
+0.4
+ * fixed embarrassing bug which caused things not to work on Linux 
+   (is now find_library('ftdi') instead of find_library('libftdi'))
+ * lots of error checking, new FtdiError exception. Before it just
+   tended to segfault if things weren't just-so.
+ * get_error() is now get_error_string().  It's still early enough
+   to change the API, and if I thought it was get_error_string
+   multiple times when I wrote the error checking code, it probably
+   should be the more natural thing.
+0.3
+ * added some examples
+ * new Bus class in pylibftdi (though it probably belongs somewhere else)
+ * first release on PyPI
+0.2
+ * fixed various bugs
+ * added ftdi_fn and set_baudrate functions in Driver class
+ * changed interface in BitBangDriver to direction/port properties
+   rather than overriding the read/write functions, which are therefore
+   still available as in the Driver class.
+0.1
+ * first release. Tested with libftdi 0.18 on Mac OS X 10.6 and Linux
+  (stock EEEPC 701 Xandros Linux, Ubuntu 10.04)
  * Perhaps add support for D2XX driver, though the name then becomes a
    slight liability ;)
 
-Changes
--------
-0.4.1
- * fix release issue
-0.4
- * fixed embarrassing bug which caused things not to work on Linux 
-   (is now find_library('ftdi') instead of find_library('libftdi'))
- * lots of error checking, new FtdiError exception. Before it just
-   tended to segfault if things weren't just-so.
- * get_error() is now get_error_string().  It's still early enough
-   to change the API, and if I thought it was get_error_string
-   multiple times when I wrote the error checking code, it probably
-   should be the more natural thing.
-0.3
- * added some examples
- * new Bus class in pylibftdi (though it probably belongs somewhere else)
- * first release on PyPI
-0.2
- * fixed various bugs
- * added ftdi_fn and set_baudrate functions in Driver class
- * changed interface in BitBangDriver to direction/port properties
-   rather than overriding the read/write functions, which are therefore
-   still available as in the Driver class.
-0.1
- * first release. Tested with libftdi 0.18 on Mac OS X 10.6 and Linux
-  (stock EEEPC 701 Xandros Linux, Ubuntu 10.04)

pylibftdi/__init__.py

 __AUTHOR__ = "Ben Bass"
 
 
-__ALL__ = ['Driver', 'BitBangDriver', 'Bus', 'ALL_OUTPUTS', 'ALL_INPUTS']
+__ALL__ = ['Driver', 'BitBangDriver', 'Bus', 'FtdiError',
+           'ALL_OUTPUTS', 'ALL_INPUTS', 'BB_OUTPUT', 'BB_INPUT']
 
-from pylibftdi.util import Bus
-from pylibftdi.driver import Driver
-from pylibftdi.bitbang import BitBangDriver, ALL_OUTPUTS, ALL_INPUTS
+from pylibftdi import _base, driver, util, bitbang
+
+# Bring them in to package scope so we can treat pylibftdi
+# as a module if we want.
+FtdiError = _base.FtdiError
+Bus = util.Bus
+Driver = driver.Driver
+BitBangDriver = bitbang.BitBangDriver
+
+ALL_OUTPUTS = bitbang.ALL_OUTPUTS
+ALL_INPUTS = bitbang.ALL_INPUTS
+BB_OUTPUT = bitbang.BB_OUTPUT
+BB_INPUT = bitbang.BB_INPUT
+

pylibftdi/_base.py

+"""
+pylibftdi - python wrapper for libftdi
 
+Copyright (c) 2010 Ben Bass <benbass@codedstructure.net>
+See LICENSE file for details and (absence of) warranty
+
+pylibftdi: http://bitbucket.org/codedstructure/pylibftdi
+
+"""
+
+# This module contains things needed by at least one other
+# module so as to prevent circular imports.
 
 __ALL__ = ['Refuser', 'ParrotEgg', 'DeadParrot', 'FtdiError']
 

pylibftdi/driver.py

 from ctypes import (CDLL, byref, c_char_p, create_string_buffer)
 from ctypes.util import find_library
 
-from pylibftdi.base import ParrotEgg, DeadParrot, FtdiError
+from pylibftdi._base import ParrotEgg, DeadParrot, FtdiError
 
 class Driver(object):
     def __init__(self):
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.