def run(self): for device in enumDevices(): devid = device.devid struc = device.structure appmod = eval('__import__(\'structures.'+struc+'\').'+struc) try: if appmod.DONTRUN: print 'Will not run '+str(devid)+' struct '+str(struc)+' due to DONTRUN' continue except: pass self.devices[devid] = returnModdedApplication(appmod.MyApplication, device) for devid, application in self.devices.iteritems(): print 'Starting '+str(Device(devid).structure)+' for '+str(devid) application._start()
def run(self): for device in enumDevices(): devid = device.devid struc = device.structure appmod = eval('__import__(\'structures.' + struc + '\').' + struc) try: if appmod.DONTRUN: print 'Will not run ' + str(devid) + ' struct ' + str( struc) + ' due to DONTRUN' continue except: pass self.devices[devid] = returnModdedApplication( appmod.MyApplication, device) for devid, application in self.devices.iteritems(): print 'Starting ' + str( Device(devid).structure) + ' for ' + str(devid) application._start()
#! /usr/bin/python # coding=UTF-8 '''Uruchamiane gdy serwer się wyłącza''' from patelnia.p24 import enumDevices from afruntime.device import Device import os from sys import exit for x in enumDevices(): Device(x.devid).setStat('thread.reader', 0) Device(x.devid).setStat('thread.handler', 0) Device(x.devid).setStat('online', 0) exit(0)