Exemplo n.º 1
0
    def __init__(self,
                 bus,
                 cfg_file=None,
                 logfile=None,
                 pidfile=None,
                 webroot=None,
                 hostname=None,
                 port=None):
        SimplePlugin.__init__(self, bus)

        self.finalized = False
        self.pid = os.getpid()
        self.filename = StatusFile.status_filename(self.pid)

        tangelo.log("here")
        self.status = {
            k: str(v)
            for k, v in zip(StatusFile.fields, map(eval, StatusFile.fields))
        }
        self.status["pid"] = str(self.pid)
        tangelo.log("there")

        for k, v in self.status.iteritems():
            if v is None:
                raise TypeError("argument '%s' cannot be None" % (k))
Exemplo n.º 2
0
    def __init__(self, bus):
        SimplePlugin.__init__(self, bus)

        self.queue = UniquePriorityQueue()
        self.threads = None
        self.start_threads = cpu_count() * 2
        self.bus.subscribe("bind_background_task", self.bind_background_task)
        self.running = 0
        self.done = queue.Queue()
Exemplo n.º 3
0
 def __init__(self, bus, num_threads, subscribe_event, publish_success_event=None, publish_fail_event=None):
     SimplePlugin.__init__(self, bus)
     self.threads = []
     
     self.queue = Queue()
     
     self.num_threads = num_threads
     self.subscribe_event = subscribe_event
     self.publish_success_event = publish_success_event
     self.publish_fail_event = publish_fail_event
Exemplo n.º 4
0
    def __init__(self, bus):
        SimplePlugin.__init__(self, bus)
        self.name = "logs"
        self.logname = self.name.upper().ljust(6)
        self.client = None
        applyai.log('in init', self.logname)
        self.project = os.environ['PROJECT']

        # grab the current LogRecordFactory
        self.old_factory = logging.getLogRecordFactory()
Exemplo n.º 5
0
    def __init__(self, bus, interval = 300, comic_path=None, temp_path=None, sleep = 1, thumb_width = 300, thumb_height = 400):
        SimplePlugin.__init__(self, bus)

        self._cdb = comic_db()
        self._sleep = sleep
        self._interval = interval
        self._comic_path = comic_path
        self._temp_path = temp_path
        self._request_scan = 0
        self._thumb_width = thumb_width
        self._thumb_height = thumb_height
Exemplo n.º 6
0
 def __init__(self, bus, sleep=2):
     SimplePlugin.__init__(self, bus)
     self._paused = False
     self._sleep = sleep
     self.count = 0
     mac_dict[pi_addr] = user_model('pi', '')
     conn = socket.socket(socket.AF_PACKET, socket.SOCK_RAW,
                          socket.ntohs(3))
     for tuple in list_devices('wlan0'):
         if (tuple[2].upper() not in wireless_macs):
             print(tuple[2].upper())
             wireless_macs.add(tuple[2].upper())
             mac_dict[tuple[2].upper()] = user_model('unknown', tuple[0])
Exemplo n.º 7
0
    def __init__(self, bus, cfg_file=None, logfile=None, pidfile=None, webroot=None, hostname=None, port=None):
        SimplePlugin.__init__(self, bus)
        
        self.finalized = False
        self.pid = os.getpid()
        self.filename = StatusFile.status_filename(self.pid)

        tangelo.log("here")
        self.status = {k: str(v) for k, v in zip(StatusFile.fields, map(eval, StatusFile.fields))}
        tangelo.log("there")

        for k, v in self.status.iteritems():
            if v is None:
                raise TypeError("argument '%s' cannot be None" % (k))
Exemplo n.º 8
0
    def __init__(self, bus, assembler, eager_init=True):
        """
        :arg cherrypy.process.wspbus.Bus bus:
           the CherryPy Web Site Process Bus
        :arg aglyph.assembler.Assembler assembler:
           the configured Aglyph assembler (or binder)
        :keyword bool eager_init:
           if ``True``, all *singleton* and *borg* components in the
           assembler's context will be pre-assembed and cached when the
           Aglyph DI plugin is started

        """
        SimplePlugin.__init__(self, bus)
        self._assembler = assembler
        self._eager_init = eager_init
Exemplo n.º 9
0
    def __init__(self, bus):
        SimplePlugin.__init__(self, bus)

        self._crons = []
Exemplo n.º 10
0
 def __init__(self, bus):
     """ Initiates scheduler. """
     SimplePlugin.__init__(self, bus)
     self.scheduler = Scheduler()
Exemplo n.º 11
0
Arquivo: mdx.py Projeto: skanct/pyFF
 def __init__(self, bus, d=None):
     SimplePlugin.__init__(self, bus)
     self.dir = d
Exemplo n.º 12
0
	def __init__(self, bus, callback):
		SimplePlugin.__init__(self, bus)
		self.callback = callback
Exemplo n.º 13
0
 def __init__(self, bus, server):
     SimplePlugin.__init__(self, bus)
     self.server = server
Exemplo n.º 14
0
 def __init__(self, bus, d=None):
     SimplePlugin.__init__(self, bus)
     self.dir = d
Exemplo n.º 15
0
 def __init__ (self,engine):
     SimpleWSGISoapApp.__init__ (self)
     self.pm = ProjectManager ("/var/cache/elbe")
     SimplePlugin.__init__(self,engine)
     self.subscribe()
Exemplo n.º 16
0
    def __init__(self, app, pm, engine):
        self.pm = pm
        SessionMiddleware.__init__(self, app)

        SimplePlugin.__init__(self, engine)
        self.subscribe()
Exemplo n.º 17
0
 def __init__(self, engine, port=8080, prefix=''):
     SimplePlugin.__init__(self, engine)
     self.port = port
     self.prefix = prefix
Exemplo n.º 18
0
 def __init__(self, bus, qsize=100, qwait=2, safe_stop=True):
     SimplePlugin.__init__(self, bus)
     self.q = Queue.Queue(qsize)
     self.qwait = qwait
     self.safe_stop = safe_stop
Exemplo n.º 19
0
	def __init__(self, engine, on_demand_queue, result_queue, scanned_set): 
		SimplePlugin.__init__(self, engine)
		self.on_demand_queue = on_demand_queue
		self.result_queue = result_queue
		self.scanned_set = scanned_set
Exemplo n.º 20
0
 def __init__(self, bus, base_path, working_dir):
     SimplePlugin.__init__(self, bus)
     self.command = self.command % base_path
     self.daemon = Executer(self.command, working_dir)
     self.base_path = base_path
     self.working_dir = working_dir
Exemplo n.º 21
0
 def __init__(self, bus, **kvargs):
     SimplePlugin.__init__(self, bus)
     self.environment = Environment(autoescape=True, **kvargs)
Exemplo n.º 22
0
    def __init__(self, bus, raise_exceptions=logging.raiseExceptions, config={}):

        SimplePlugin.__init__(self, bus)

        self.raise_exceptions = raise_exceptions
        self.config = config
Exemplo n.º 23
0
 def __init__(self, bus, config, prefix="sqlalchemy_engine"):
     SimplePlugin.__init__(self, bus)
     self.config = config
     self.prefix = prefix
Exemplo n.º 24
0
    def __init__(self, app, pm, engine):
        self.pm = pm
        SessionMiddleware.__init__(self, app)

        SimplePlugin.__init__(self, engine)
        self.subscribe()
Exemplo n.º 25
0
 def __init__(self, engine, port=8080, prefix=''):
     SimplePlugin.__init__(self, engine)
     self.port = port
     self.prefix = prefix
     self.ip_address = '0.0.0.0'
Exemplo n.º 26
0
 def __init__(self, bus, db_name):
     SimplePlugin.__init__(self, bus)
     self.db_name = db_name
Exemplo n.º 27
0
 def __init__(self, worker, bus, master_url=None):
     SimplePlugin.__init__(self, bus)
     self.worker = worker
     self.master_url = master_url
     self.stop_event = Event()
Exemplo n.º 28
0
 def __init__(self, bus):
     SimplePlugin.__init__(self, bus)
     self.env = None
     self.bus.subscribe("bind_jinja", self.bind_jinja)
Exemplo n.º 29
0
 def __init__(self, engine, port=8080, prefix=''):
     SimplePlugin.__init__(self, engine)
     self.port = port
     self.prefix = prefix
     self.ip_address = '0.0.0.0'
Exemplo n.º 30
0
 def __init__(self, bus):
     SimplePlugin.__init__(self, bus)
Exemplo n.º 31
0
 def __init__(self, bus):
     SimplePlugin.__init__(self, bus)
Exemplo n.º 32
0
 def __init__(self, bus, browser):
     SimplePlugin.__init__(self, bus)
     self.browser = browser