Beispiel #1
0
    def start(self):
        BaseService.start(self)
        self._directory_service_proxy.start()

        self.log.info("starting services...")
        for service_name, service in self._directory.iteritems():
            self.log.info("starting service %s" % service_name)
            self.started_services.put(service.start())
Beispiel #2
0
    def start(self):
        BaseService.start(self)
        self._directory_service_proxy.start()

        self.log.info("starting services...")
        for service_name, service in self._directory.iteritems():
            self.log.info("starting service %s" % service_name)
            self.started_services.put(service.start())
Beispiel #3
0
class inittest(unittest.TestCase):

    def setUp(self):
        
        self.host = "www.harshniketseta.local"
        self.path = "testpath"
        
        self.base = BaseService("http://"+urljoin(self.host, self.path))
        
        self.rest = Rest(self.host, self.path)
        self.xmlrpc = XMLRPC(self.host, self.path)

    def testrestinit(self):
        self.assertEqual(self.base.getURL(), self.rest.getURL())

    
    def testXMLRPCinit(self):
        self.assertEqual(self.base.getURL(), self.xmlrpc.getURL())
Beispiel #4
0
 def setUp(self):
     
     self.host = "www.harshniketseta.local"
     self.path = "testpath"
     
     self.base = BaseService("http://"+urljoin(self.host, self.path))
     
     self.rest = Rest(self.host, self.path)
     self.xmlrpc = XMLRPC(self.host, self.path)
Beispiel #5
0
 def start(self):
     BaseService.start(self)
     self._service_manager.start()
     return self.greenlet
Beispiel #6
0
 def __init__(self, name):
     BaseService.__init__(self, name)
     self._service_manager = ServiceManager("service-manager")  # workers each handle one rest endpoint
     self.event_loop_state = RoundRobinIndexer(2)
Beispiel #7
0
 def __init__(self, name):
     scales.init(self, '/service-manager')
     BaseService.__init__(self, name)
     self._directory = {}
     self.started_services = Queue()
     self._directory_service_proxy = DirectoryService(self._directory)
Beispiel #8
0
 def stop(self):
     self._service_manager.stop_services()
     self._service_manager.stop()
     BaseService.stop(self)
Beispiel #9
0
# user_command.py
__author__ = 'Ron Roth Jr'
__contact__ = 'u/ensosati'

import traceback
import pytz
from config.setup import Setup
from models.user import User
from services import BaseService
from utils import T

SETUP = Setup()
USER_HELP = SETUP.user_help
RESERVED = SETUP.reserved_commands

base_svc = BaseService()

class UserCommand():
    """
    Handle 'user', 'u' commands and subcommands

    Subcommands:
        help - display a set of instructions on UserCommand usage
        user, u - display and create new users by name
        timezone, tz - set or display a list of existing timezones
        url, website, contact - set the contact url for the user
        alias - set up alias commands
    """

    def __init__(self, parent, ctx, args, guild, user, channel):
        """
Beispiel #10
0
 def start(self):
     BaseService.start(self)
     self._service_manager.start()
     return self.greenlet
Beispiel #11
0
 def __init__(self, name):
     BaseService.__init__(self, name)
     self._service_manager = ServiceManager(
         "service-manager")  # workers each handle one rest endpoint
     self.event_loop_state = RoundRobinIndexer(2)
Beispiel #12
0
 def __init__(self, name):
     scales.init(self, '/service-manager')
     BaseService.__init__(self, name)
     self._directory = {}
     self.started_services = Queue()
     self._directory_service_proxy = DirectoryService(self._directory)
Beispiel #13
0
 def stop(self):
     self._service_manager.stop_services()
     self._service_manager.stop()
     BaseService.stop(self)