Ben Bass avatar Ben Bass committed bd593a0

bump to 0.12pre

Comments (0)

Files changed (3)

 # built documents.
 #
 # The short X.Y version.
-version = '0.11'
+version = '0.12pre'
 # The full version, including alpha/beta/rc tags.
-release = '0.11'
+release = '0.12pre'
 
 # The language for content autogenerated by Sphinx. Refer to documentation
 # for a list of supported languages.

pylibftdi/bitbang.py

         lines is persisted in this object for the purposes of reading,
         so read-modify-write operations (e.g. drv.port+=1) are valid.
         """
-        if self.sync:
-            result = self.read_pins()
+        if self._direction == ALL_OUTPUTS:
+            # a minor optimisation; no point reading from the port if
+            # we have no input lines set
+            result = self.latch
         else:
-            # the coercion to bytearray here is to make this work
-            # transparently between Python2 and Python3 - equivalent
-            # of ord() for Python2, a time-wasting do-nothing on Python3
-            result = bytearray(super(BitBangDevice, self).read(1))[0]
+            if self.sync:
+                result = self.read_pins()
+            else:
+                # the coercion to bytearray here is to make this work
+                # transparently between Python2 and Python3 - equivalent
+                # of ord() for Python2, a time-wasting do-nothing on Python3
+                result = bytearray(super(BitBangDevice, self).read(1))[0]
 
-        # replace the 'output' bits with current value of self.latch -
-        # the last written value. This makes read-modify-write
-        # operations (e.g. 'drv.port |= 0x10') work as expected
-        result = ((result & ~self._direction) |    # read input
-                  (self.latch & self._direction))  # output latch
+            # replace the 'output' bits with current value of self.latch -
+            # the last written value. This makes read-modify-write
+            # operations (e.g. 'drv.port |= 0x10') work as expected
+            result = ((result & ~self._direction) |    # read input
+                      (self.latch & self._direction))  # output latch
         return result
 
     @port.setter
 
 setup(
     name="pylibftdi",
-    version="0.11",
+    version="0.12.pre",
     description="Pythonic interface to FTDI devices using libftdi",
     long_description=open('README.rst').read(),
     author="Ben Bass",
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.