<commit_before>from snp.SNPService import SNPService


class DeviceService(SNPService):

    def __init__(self, config):
        self.config = config

    def startService(self):
        #TODO: connect to all deviceServers fom db
        pass

    def connectionMade(self, protocol):
        pass<commit_msg>Auto connect to all device servers in db<commit_after>from snp import SNPService, SNProtocolClientFactory
from DB import DB


class DeviceService(SNPService):

    def __init__(self, config):
        self.config = config

    def startService(self):
        def callb(res):
            from twisted.internet import reactor
            for dev in res:
                fact = SNProtocolClientFactory(self)
                reactor.connectTCP(dev[1], dev[2], fact)
        DB.get_device_servers().addCallback(callb)
        pass

    def connectionMade(self, protocol):
        pass
{'fraction_non_alphanumeric': 0.07336343115124154, 'fraction_numerical': 0.002257336343115124, 'mean_word_length': 2.665289256198347, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1854514', 'n_tokens_mistral': 251, 'n_tokens_neox': 238, 'n_words': 70}