Skip to content

Commit

Permalink
Remove add_message function
Browse files Browse the repository at this point in the history
Superseded by advance printer.out functionality
  • Loading branch information
LexiconCode committed Aug 4, 2021
1 parent 3d37b32 commit 66cadd2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 18 deletions.
6 changes: 2 additions & 4 deletions _caster.py
Expand Up @@ -24,6 +24,7 @@

_NEXUS = None

from castervoice.lib import printer
from castervoice.lib import control

if control.nexus() is None: # Initialize Caster State
Expand All @@ -42,7 +43,4 @@
from castervoice.asynch.sikuli import sikuli_controller
sikuli_controller.get_instance().bootstrap_start_server_proxy()

print("\n*- Starting " + settings.SOFTWARE_NAME + " -*")

for message in settings.STARTUP_MESSAGES:
print("\n" + message + "\n")
printer.out("\n*- Starting " + settings.SOFTWARE_NAME + " -*")
5 changes: 2 additions & 3 deletions castervoice/lib/merge/additions.py
@@ -1,6 +1,6 @@
from dragonfly import ShortIntegerRef
from dragonfly.grammar.elements import Choice
from castervoice.lib import settings
from castervoice.lib import printer


class IntegerRefST(ShortIntegerRef):
Expand All @@ -10,8 +10,7 @@ class IntegerRefST(ShortIntegerRef):
"""

def __init__(self, name, min, max, default=None):
message = "Detected 'IntegerRefST' import in rules/grammars.\nIntegerRefST and Integer Remap has been removed. \nUpdate your rules to `from dragonfly import ShortIntegerRef` in instead of IntegerRefST"
settings.add_message(message)
printer.out("\nDetected 'IntegerRefST' import in rules/grammars.\nIntegerRefST and Integer Remap has been removed. \nUpdate your rules to `from dragonfly import ShortIntegerRef` in instead of IntegerRefST\n")
super(IntegerRefST, self).__init__(name, min, max, default)


Expand Down
11 changes: 0 additions & 11 deletions castervoice/lib/settings.py
Expand Up @@ -45,7 +45,6 @@
QTYPE_CONFIRM = "6"
WXTYPE_SETTINGS = "7"
HMC_SEPARATOR = "[hmc]"
STARTUP_MESSAGES = []

# calculated fields
SETTINGS = None
Expand All @@ -55,16 +54,6 @@
_USER_DIR = None
_SETTINGS_PATH = None

def add_message(message):
"""
Add string message to be printed when Caster initializes
message: str
"""
try:
if message not in STARTUP_MESSAGES:
STARTUP_MESSAGES.append(str(message))
except Exception as e:
print(e)

def _get_platform_information():
"""Return a dictionary containing platform-specific information."""
Expand Down

0 comments on commit 66cadd2

Please sign in to comment.