Example #1
0
 def handle(self, *args, **options):
     from django.conf import settings
     translation.activate(settings.LANGUAGE_CODE)
     if len(options) > 0:
         config_file = options['config']
     else:
         config_file = defaults.DEFAULT_CONFIG
     try:
         self.stdout.write('Starting Twisted Brew (config:{0})'.format(config_file))
         master = None
         config = coreutils.parse_config(config_file)
         if config.master is not None:
             master = Master(config.communication, config.master)
         coreutils.start_workers(config)
         if master is not None:
             master.info()
             master.start()
         else:
             log.set_log_receiver(log.LOG_RECEIVER_STD)
     except Exception as e:
         raise CommandError('Could not start Twisted Brew: {0}'.format(e.__class__.__name__))
     self.stdout.write('Successfully started Twisted Brew')
Example #2
0
 def handle(self, *args, **options):
     from django.conf import settings
     translation.activate(settings.LANGUAGE_CODE)
     if len(options) > 0:
         config_file = options['config']
     else:
         config_file = defaults.DEFAULT_CONFIG
     try:
         self.stdout.write(
             'Starting Twisted Brew (config:{0})'.format(config_file))
         master = None
         config = coreutils.parse_config(config_file)
         if config.master is not None:
             master = Master(config.communication, config.master)
         coreutils.start_workers(config)
         if master is not None:
             master.info()
             master.start()
         else:
             log.set_log_receiver(log.LOG_RECEIVER_STD)
     except Exception as e:
         raise CommandError('Could not start Twisted Brew: {0}'.format(
             e.__class__.__name__))
     self.stdout.write('Successfully started Twisted Brew')
Example #3
0
#!/usr/bin python
import django.conf
import sys
import twisted_brew.settings

django.conf.settings.configure()
django.conf.settings.DATABASES = twisted_brew.settings.DATABASES
django.conf.settings.INSTALLED_APPS = twisted_brew.settings.INSTALLED_APPS

from core.utils import coreutils
import core.defaults as defaults
from core.master import Master

configfile = defaults.DEFAULT_CONFIG

if len(sys.argv) > 1:
    configfile = sys.argv[1]

print('Starting Twisted Brew (config:{0})'.format(configfile))

master = None
config = coreutils.parse_config(configfile)
if config.master is not None:
    master = Master(config.communication, config.master)
coreutils.start_workers(config)
if master is not None:
    master.info()
    master.start()