def __init__(self, param_config=None):
        self.cm = configuration_manager.Configuration(
            param_config=param_config)
        global cm
        cm = self.cm

        # list to store the Channels instances in
        self.channels = list()

        # network setup if used
        self.network = networking.Networking(cm)
        self.server = self.network.networking == "server" or self.network.networking == "serverjson"
        self.broadcast = self.network.broadcast

        self.led = None
        if self.cm.configs.led:
            self.led = list()
            if self.cm.configs.led_multiprocess:
                LEDManager.register('LED', led_module.Led)
                for lc in self.cm.configs.led:
                    self.cm.set_led(config_file=lc)
                    self.ledmanager = LEDManager()
                    self.ledmanager.start()
                    self.cm.led.multiprocess = True
                    self.led.append(self.ledmanager.LED(self.cm.led))
            else:
                for lc in self.cm.configs.led:
                    self.cm.set_led(config_file=lc)
                    self.cm.led.multiprocess = False
                    self.led.append(led_module.Led(self.cm.led))

        self.create_lights()
        self.set_overrides()
Example #2
0
import fcntl
import logging
import os
import signal
import sys
import time

from BeautifulSoup import BeautifulSoup
from googlevoice import Voice
from googlevoice.util import LoginError, ValidationError
from threading import Thread

import configuration_manager
import commands

cm = configuration_manager.Configuration(True)

logging.basicConfig(
    filename=configuration_manager.LOG_DIR + '/music_and_lights.check.dbg',
    format='[%(asctime)s] %(levelname)s {%(pathname)s:%(lineno)d}'
    ' - %(message)s',
    level=logging.INFO)


class Sms(Thread):
    """Check SMS messages from a Google Voice account to control the lightshow

    When executed, this script will check all the SMS messages from a Google Voice account checking
    for either the "help" command, which will cause a help message to be sent back to the original
    sender, or a single number indicating which song they are voting for.
Example #3
0
import fcntl
import logging
import os
import signal
import sys
import time

from bs4 import BeautifulSoup
from googlevoice import Voice
from googlevoice.util import LoginError, ValidationError
from threading import Thread

import configuration_manager
import commands

cm = configuration_manager.Configuration(sms=True)

logging.basicConfig(filename=configuration_manager.LOG_DIR + '/music_and_lights.check.dbg',
                    format='[%(asctime)s] %(levelname)s {%(pathname)s:%(lineno)d}'
                           ' - %(message)s',
                    level=logging.INFO)


class Sms(Thread):
    """Check SMS messages from a Google Voice account to control the lightshow

    When executed, this script will check all the SMS messages from a Google Voice account checking
    for either the "help" command, which will cause a help message to be sent back to the original
    sender, or a single number indicating which song they are voting for.

    When a song is voted for, the playlist file will be updated with the sender's cell phone number