本文整理汇总了Python中observable.Observable.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python Observable.__init__方法的具体用法?Python Observable.__init__怎么用?Python Observable.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类observable.Observable
的用法示例。
在下文中一共展示了Observable.__init__方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from observable import Observable [as 别名]
# 或者: from observable.Observable import __init__ [as 别名]
def __init__(self, config, environ, logger, statechglogger):
Observable.__init__(self)
self.config = config
self.environ = environ
self.statechglogger = statechglogger
self.logdispatch = logger
self.rulenumber = 0
self.rulename = 'template class'
self.mandatory = False
self.helptext = """This is the default help text for the base rule
class. If you are seeing this text it is because the developer for one of the
rules forgot to assign the appropriate help text. Please file a bug against
LANL-stonix."""
self.executionpriority = 50
self.rootrequired = True
self.configinsimple = False
self.detailedresults = """This is the default detailed results text
for the base rule class. If you are seeing this text it is because the
developer for one of the rules forgot to assign the appropriate text.
Please file a bug against stonix."""
self.compliant = False
self.rulesuccess = True
self.databaserule = False
self.applicable = {'default': 'default'}
self.revertable = False
self.confitems = []
self.currstate = "notconfigured"
self.targetstate = "configured"
self.guidance = []
示例2: __init__
# 需要导入模块: from observable import Observable [as 别名]
# 或者: from observable.Observable import __init__ [as 别名]
def __init__(self, network_interface, src_ip, target_ip):
Observable.__init__(self)
Executable.__init__(self, self.ping_executable)
self.network_interface = network_interface
self.src_ip = src_ip
self.target_ip = target_ip
print "# Setting up loop for pinging " + target_ip + " (with " + src_ip + " on " + network_interface + ") "
示例3: __init__
# 需要导入模块: from observable import Observable [as 别名]
# 或者: from observable.Observable import __init__ [as 别名]
def __init__(self, config):
self._config = config
self._mame = None
self._connection = None
self._running = False
Observable.__init__(self)
threading.Thread.__init__(self)
示例4: __init__
# 需要导入模块: from observable import Observable [as 别名]
# 或者: from observable.Observable import __init__ [as 别名]
def __init__(self,id_scan,nom_unique,type_scan,chemin_rapport,liste_adresses,nmap_options=None,nessus_policy_id=None):
Observable.__init__(self)
self.nmap={'enable':False,'options':None,'instance':None,'status':'disable','progress':0,'import':'disable'}
self.nessus={'enable':False,'id':-1,'policy_id':None,'status':'disable','progress':0,'import':'disable'}
self.erreurs=[]
self.cibles=liste_adresses
self.nom_unique=nom_unique
self.chemin_rapport=chemin_rapport
self.id_scan=id_scan
self.tache_attente=[]
self.compteur_erreur_nessus=0
self.type_scan=type_scan
if nmap_options!=None:
self.nmap['enable']=True
self.nmap['options']=nmap_options
self.nmap['status']='ready'
self.nmap['import']='ready'
self.nmap['instance']=scanNmap(self.cibles,self.nmap['options'],CHEMIN_TEMP+'nmap/'+str(self.nom_unique)+'.xml')
if nessus_policy_id!=None:
self.nessus['enable']=True
self.nessus['policy_id']=nessus_policy_id
self.nessus['status']='ready'
self.nessus['import']='ready'
示例5: __init__
# 需要导入模块: from observable import Observable [as 别名]
# 或者: from observable.Observable import __init__ [as 别名]
def __init__(self, environment):
Observable.__init__(self)
self.environment = environment
self.debug = self.environment.getdebugmode()
self.verbose = self.environment.getverbosemode()
self.constsrequired = [localize.REPORTSERVER,
localize.STONIXDEVS,
localize.STONIXERR,
localize.MAILRELAYSERVER]
reportfile = 'stonix-report.log'
xmlfile = 'stonix-xmlreport.xml'
self.logpath = self.environment.get_log_path()
self.reportlog = os.path.join(self.logpath, reportfile)
self.xmllog = os.path.join(self.logpath, xmlfile)
if self.debug:
print 'LOGDISPATCHER: xml log path: ' + self.xmllog
if os.path.isfile(self.xmllog):
try:
if os.path.exists(self.xmllog + '.old'):
os.remove(self.xmllog + '.old')
move(self.xmllog, self.xmllog + '.old')
except (KeyboardInterrupt, SystemExit):
# User initiated exit
raise
except Exception, err:
print 'logdispatcher: '
print traceback.format_exc()
print err
示例6: __init__
# 需要导入模块: from observable import Observable [as 别名]
# 或者: from observable.Observable import __init__ [as 别名]
def __init__(self, app=None):
Observable.__init__(self)
self.app = None
self.resources = {}
if app is not None:
self.init_app(app)
示例7: __init__
# 需要导入模块: from observable import Observable [as 别名]
# 或者: from observable.Observable import __init__ [as 别名]
def __init__(self, trigger, func, args, kwargs, misfire_grace_time,
coalesce, name=None, max_runs=None, max_instances=1, active=True):
Observable.__init__(self)
if not trigger:
raise ValueError('The trigger must not be None')
if not hasattr(func, '__call__'):
raise TypeError('func must be callable')
if not hasattr(args, '__getitem__'):
raise TypeError('args must be a list-like object')
if not hasattr(kwargs, '__getitem__'):
raise TypeError('kwargs must be a dict-like object')
if misfire_grace_time <= 0:
raise ValueError('misfire_grace_time must be a positive value')
if max_runs is not None and max_runs <= 0:
raise ValueError('max_runs must be a positive value')
if max_instances <= 0:
raise ValueError('max_instances must be a positive value')
self._lock = Lock()
self.trigger = trigger
self.func = func
self.args = args
self.kwargs = kwargs
self.name = to_unicode(name or get_callable_name(func))
self.misfire_grace_time = misfire_grace_time
self.coalesce = coalesce
self.max_runs = max_runs
self.max_instances = max_instances
self.runs = 0
self.instances = 0
self.active = active
示例8: __init__
# 需要导入模块: from observable import Observable [as 别名]
# 或者: from observable.Observable import __init__ [as 别名]
def __init__(self, tableau_adresse, options, fichier_sortie):
Thread.__init__(self)
Observable.__init__(self)
self.adresse = ""
self.progress = 0.0
self.status = "ready"
# On cree un string a partir de la liste des adresses
# contenues dans le tableau
for ip in tableau_adresse:
try:
ip = valideIP(ip)
self.adresse += " " + str(ip)
except:
pass
liste_arguments = [options, fichier_sortie]
# Contrôle des arguments
for arg in liste_arguments:
error = re.search('[;|<>"`&{}]', str(arg))
if error != None:
raise Exception("Paramètres Nmap invalide")
# Si pas de levé d'exception
self.options = options
self.fichier_sortie = fichier_sortie
示例9: __init__
# 需要导入模块: from observable import Observable [as 别名]
# 或者: from observable.Observable import __init__ [as 别名]
def __init__(self):
Observable.__init__(self)
self.level = 0
self.isPaused = True
self.id = None
self.currClip = None
self.currClipIndex = None
self.name = None
self.md5 = None
self.dDBook = None
self.msg = "Welcome to Daisy Delight"
示例10: __init__
# 需要导入模块: from observable import Observable [as 别名]
# 或者: from observable.Observable import __init__ [as 别名]
def __init__(self,connection,transparent):
Observable.__init__(self)
self.connection = connection
self.transparent = transparent
connection.addListeners(self)
self.datas = HostsInfos()
self.nas= Nas(connection, transparent, self.datas)
self.L2=LearningSwitch(connection, transparent)
self.add_observer(self.nas,'nac')
self.dhcp_interceptor = DhcpIntercept(connection, transparent, self.datas)
self.add_observer(self.dhcp_interceptor,'dhcp')
示例11: __init__
# 需要导入模块: from observable import Observable [as 别名]
# 或者: from observable.Observable import __init__ [as 别名]
def __init__(self):
Thread.__init__(self)
Observable.__init__(self)
self.scanListe=[]
self.ScannerNessus=Nessus()
self.attenteNessus=[]
try:
self.ScannerNessus.connexion()
except:
pass
self.log=log(CHEMIN_LOGS+'scan.log','scanner.'+'srv_tache')
示例12: __init__
# 需要导入模块: from observable import Observable [as 别名]
# 或者: from observable.Observable import __init__ [as 别名]
def __init__(self, hostname):
Observable.__init__(self)
self.play_status = ''
self.current_song = []
self.song_time_elapsed = 0
self.song_time_total = 0
self.volume = 0
self.client = MPDClient()
self.client.timeout = 10
self.client.idletimeout = None
connected = False
logger.debug('Connecting')
while not connected:
try:
logger.debug('.')
self.client.connect(hostname, 6600)
connected = True
logger.debug('Connected')
except mpd.ConnectionError:
time.sleep(0.2)
self.time_thread = None
示例13: __init__
# 需要导入模块: from observable import Observable [as 别名]
# 或者: from observable.Observable import __init__ [as 别名]
def __init__(self, connection, transparent, host_authenticated):
Observable.__init__(self)
Thread.__init__(self)
self.radclient = radClient(rad_secret, rad_addr, rad_authport)
self.connection = connection
self.transparent = transparent
self.hosts_authenticated = host_authenticated
self.host_progress={}
#Permet de stocker la liste des machines en cours d'authentification
#{'aa:bb:cc:dd:ee:ff':
# {
# 'switch': mac_addr,
# 'port': int,
# 'match':[],
# 'internal-identity': toto,
# 'external-identity': toto,
# 'mac': aa:bb:cc:dd:ee:ff,
# 'authenticated': False #Case for periodic-authenticated
# }
#}
self.start()
示例14: __init__
# 需要导入模块: from observable import Observable [as 别名]
# 或者: from observable.Observable import __init__ [as 别名]
def __init__(self, connection, transparent, host_authenticated):
Observable.__init__(self)
self.connection = connection
self.transparent = transparent
self.hosts_authenticated = host_authenticated
self.sock= socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
示例15: __init__
# 需要导入模块: from observable import Observable [as 别名]
# 或者: from observable.Observable import __init__ [as 别名]
def __init__(self):
Observable.__init__(self)