Browse Source

Adding charsets to namespace. Fixing consistency issues.

Matt Sparks 15 years ago
parent
commit
55d59beb7f
3 changed files with 10 additions and 7 deletions
  1. 1 0
      alphasign/__init__.py
  2. 2 0
      alphasign/string.py
  3. 7 7
      alphasign/text.py

+ 1 - 0
alphasign/__init__.py

@@ -18,4 +18,5 @@ import positions
 import modes
 import speeds
 import extchars
+import charsets
 import counters

+ 2 - 0
alphasign/string.py

@@ -4,6 +4,8 @@ from packet import Packet
 
 class String(object):
   def __init__(self, data=None, label=None, size=None):
+    if data is None:
+      data = ""
     if label is None:
       label = "1"
     if size is None:

+ 7 - 7
alphasign/text.py

@@ -5,15 +5,15 @@ from packet import Packet
 
 
 class Text(object):
-  def __init__(self, msg=None, label=None, size=None, position=None, mode=None):
-    if msg is None:
-      msg = ""
+  def __init__(self, data=None, label=None, size=None, position=None, mode=None):
+    if data is None:
+      data = ""
     if label is None:
       label = "A"
     if size is None:
       size = 64
-    if len(msg) > size:
-      size = len(msg)
+    if len(data) > size:
+      size = len(data)
     if size > 125:
       size = 125
     if size < 1:
@@ -25,7 +25,7 @@ class Text(object):
 
     self.label = label
     self.size = size
-    self.msg = msg
+    self.data = data
     self.position = position
     self.mode = mode
 
@@ -36,7 +36,7 @@ class Text(object):
                                       constants.ESC,
                                       self.position,
                                       self.mode,
-                                      self.msg))
+                                      self.data))
     return str(packet)
 
   def __repr__(self):