Browse Source

Adding devices module for device identification constants

Matt Sparks 13 years ago
parent
commit
0c5710b886
4 changed files with 30 additions and 4 deletions
  1. 5 4
      alphasign/__init__.py
  2. 20 0
      alphasign/devices.py
  3. 4 0
      docs/devices.rst
  4. 1 0
      docs/index.rst

+ 5 - 4
alphasign/__init__.py

@@ -14,10 +14,11 @@ from string import String
 from packet import Packet
 from text import Text
 
+import charsets
 import colors
-import positions
+import counters
+import devices
+import extchars
 import modes
+import positions
 import speeds
-import extchars
-import charsets
-import counters

+ 20 - 0
alphasign/devices.py

@@ -0,0 +1,20 @@
+"""
+Device constants are used during instantiation of interface classes (such as
+:class:`alphasign.interfaces.local.USB`) to describe particular sign devices.
+
+The following constants are defined in this module:
+
+* :const:`USB_BETABRITE_PRISM` = (0x8765, 0x1234)
+
+--------
+Examples
+--------
+
+Connect to a BetaBrite Prism sign using USB::
+
+  sign = alphasign.USB(alphasign.devices.USB_BETABRITE_PRISM)
+  sign.connect()
+  ...
+"""
+
+USB_BETABRITE_PRISM = (0x8765, 0x1234)

+ 4 - 0
docs/devices.rst

@@ -0,0 +1,4 @@
+Devices
+=======
+
+.. automodule:: alphasign.devices

+ 1 - 0
docs/index.rst

@@ -14,6 +14,7 @@ The alphasign package is a Python API for the
   colors
   counters
   date
+  devices
   extchars
   modes
   packet