• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python logger.info函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中net.aircable.utils.logger.info函数的典型用法代码示例。如果您正苦于以下问题:Python info函数的具体用法?Python info怎么用?Python info使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了info函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: __init__

 def __init__(self, path=None, name=None, egg=None):
   '''
   Try to register a new plugin.
   
   @path=Path to the plugin
   @name=Name of the plugin it self
   @egg=True if the plugin is stored into an egg file
   '''
   if not egg:
     self.path = os.path.join(path, name)
   else:
     self.path = path
   if not egg:
     self.name = 'plugins.%s' % name
   else:
     self.name = name
   self.egg = egg
   if not self.egg:
     self.__loadFromFile(self.path)
   else:
     self.__loadFromEgg(self.path)
   self.enabled = self.provides.get('enabled', False)
   self.__module = None
   self.__version = None
   self.__version_info = None
   self.__rpc = None
   logger.info("Plugin: %s registered" % self.name)
开发者ID:Nyophyte,项目名称:proximitymarketing,代码行数:27,代码来源:pluginsystem.py


示例2: endConnection

	def endConnection(self, exit=True):
		self.shellPushIntoHistory(time.time())
		
		time.sleep(2)
		if exit:
			logger.info("Sending exit")
			self.shellExit()
开发者ID:Nyophyte,项目名称:proximitymarketing,代码行数:7,代码来源:sppBase.py


示例3: handle_connection

    def handle_connection(self, conn, remote):
        request = conn.recv(4096)
        conn.setblocking(0)
        command, url = request.splitlines()[0].split()[:2]
        if command.strip() != "GET":
            conn.shutdown(sk.SHUT_RDWR)
            conn.close()
            return True

        if url.strip() != "/":
            conn.shutdown(sk.SHUT_RDWR)
            conn.close()
            return True

        logger.info("Got a connection to the http stream, redirecting")
        host = ""
        for line in request.splitlines():
            if line.find("Host") > -1:
                host = line.strip().split()[1].split(":", 1)[0]

        conn.sendall("HTTP/1.0 200 OK\r\n")
        conn.sendall("Content-type:multipart/x-mixed-replace; boundary=--myboundary\r\n")
        conn.sendall("\r\n")
        self.clientsockets[remote] = conn
        logger.info("Connection ready for streamming")
        return True
开发者ID:jpancier,项目名称:proximitymarketing,代码行数:26,代码来源:streamserver.py


示例4: handle_file_failed

def handle_file_failed(dongle, remote, pending, channel, files, ret, err, services):
    logger.info("handle file failed %s[%s]: %s" % (remote, channel, files))
    logger.debug(err)
    try:
        try_again = []
	rules = get_campaign_rule(files)
        if rules is None or len(rules)==0:
            raise Exception("Couldn't find rule")

        for rule in rules:
            record = save_file_failed(rule, dongle, ret, remote)

    	    # from here we try again either on timeout or if rejected count is 
    	    # smaller than filter
    	    if rule.tryAgain(record=record):
    		try_again.append(rule)

	# if we can't try again this method will raise an exception
	# and the try/catch will make sure the remote device gets out
	# of our pending list
    	if upload_after_rejected(try_again, services, dongle=dongle, remote=remote):
    	    return
    except Exception, err:
        logger.error("OOOPS!!!")
        logger.exception(err)
开发者ID:Nyophyte,项目名称:proximitymarketing,代码行数:25,代码来源:uploader.py


示例5: on_disconnect

 def on_disconnect(self):
     a = [ p for p in pending if pending[p]==self]
     if len(a) > 0:
        logger.info("a client disconnected, clearing %s pending transactions" % len(a))
        for p in a:
            pending.pop(p)
     services.remove(self)
开发者ID:Nyophyte,项目名称:proximitymarketing,代码行数:7,代码来源:rpc.py


示例6: exposed_setConcurrent

    def exposed_setConcurrent(self, val):
	'''
	Exposed method that lets the server tell us if we should do concurrent 
	scanning (all the scanners work at the same time), or sequence scanning.
	'''
        self.concurrent = val
        logger.info("setConcurrent %s" % val)
开发者ID:Nyophyte,项目名称:proximitymarketing,代码行数:7,代码来源:scanner.py


示例7: exposed_uploader_register

        def exposed_uploader_register(self, client = None,
    					    remote_quit=None, 
    					    dongles=None):
            global enabled
            all_dongles.update(dongles)
            self.dongles = set()
            self.add_dongle = async(client.add_dongle)
            self.upload = async(client.upload)
            self.remote_quit = async(remote_quit)
            self.refreshUploaders = async(client.refreshUploaders)

            self.uploader = client

            if not enabled:
                return

            if not db_ready():
        	return

            logger.info("uploader register")
            for dongle in dongles:
                self.dongles.add( str(dongle), )

            for dongle, max_conn, name in rpc.uploader.get_dongles(dongles):
                logger.info("%s: %s[%s]" % (dongle, name, max_conn))
                self.add_dongle(dongle, max_conn, name)
            self.refreshUploaders()
开发者ID:Nyophyte,项目名称:proximitymarketing,代码行数:27,代码来源:rpc.py


示例8: handle_parent

def handle_parent(signum, frame):
    '''
    When the parent gets the kill signal it will stop it self no forking more
    childrens.
    '''
    logger.info("Parent killed, doing exit")
    sys.exit(0)
开发者ID:Nyophyte,项目名称:proximitymarketing,代码行数:7,代码来源:autoreload.py


示例9: latest_picture

def latest_picture(request):
    try:
	b = models.CameraRecord.objects.latest('time').picture.name
    except:
	b = None
    logger.info(b)
    return HttpResponse( json.dumps({'name': b}), 'application/json')
开发者ID:Nyophyte,项目名称:proximitymarketing,代码行数:7,代码来源:views.py


示例10: handle_adapter_added_or_removed

def handle_adapter_added_or_removed(path, signal):
    '''
    When ever a dongle is added or removed this function gets called, so we can
    restart the rpc client.
    '''
    logger.info("bluez.%s: %s" % (signal, path))
    stop()
开发者ID:Nyophyte,项目名称:proximitymarketing,代码行数:7,代码来源:manager.py


示例11: started

def started(scanner, address):
    logger.info('scan_started %s' % address)
    dongle = ScannerBluetoothDongle.objects.get(address=address)
    record = DeviceRecord()
    record.action = signals.CYCLE_SCAN_DONGLE
    record.dongle = dongle
    record.save()
开发者ID:Nyophyte,项目名称:proximitymarketing,代码行数:7,代码来源:scanner.py


示例12: disconnect

	def disconnect(self, force=False):
	    if not force:
		self.checkConnected("Can't close if it's opened");
	    logger.info("Closing socket");
	    self.socket.shutdown(socket.SHUT_RDWR);
	    self.socket.close()
	    self.socket = None
开发者ID:Nyophyte,项目名称:proximitymarketing,代码行数:7,代码来源:sppBase.py


示例13: handle_sdp_timeout

def handle_sdp_timeout(dongle, remote, pending):
    logger.info("SDP timeout: %s" % remote )
    pending.pop(remote)
    record = RemoteBluetoothDeviceSDPTimeout()
    record.dongle = UploaderBluetoothDongle.objects.get(address=dongle)
    record.setRemoteDevice(remote)
    record.save()
开发者ID:Nyophyte,项目名称:proximitymarketing,代码行数:7,代码来源:uploader.py


示例14: __restart_server

def __restart_server():
    logger.info("restarting server")
    try:
        server = rpyc.connect('localhost', 8010)
        server.root.restart()
    except:
        #could be that we're only running the web server
        pass
开发者ID:Nyophyte,项目名称:proximitymarketing,代码行数:8,代码来源:models.py


示例15: handle_name_owner_changed

    def handle_name_owner_changed(self, own, old, new):
	''' detect if a name owner is gone, this prevents dead locks '''
	if own in self.connections:
	    if new is None or len(new) is 0:
		for client in self.connections[own]:
		    logger.info("%s lost connection, killing it" % client.path)
		    client.force_disconnect()
		self.connections[own] = None
开发者ID:Nyophyte,项目名称:proximitymarketing,代码行数:8,代码来源:remotescanner.py


示例16: handle_sdp_norecord

def handle_sdp_norecord(dongle, remote, pending):
    logger.info("No SDP: %s" % remote)
    pending.pop(remote)
    remote=RemoteDevice.objects.filter(address=remote).get()
    if RemoteBluetoothDeviceNoSDP.objects.filter(remote=remote).count() == 0:
        record = RemoteBluetoothDeviceNoSDP()
        record.dongle = UploaderBluetoothDongle.objects.get(address=dongle)
        record.remote = remote
        record.save()
开发者ID:Nyophyte,项目名称:proximitymarketing,代码行数:9,代码来源:uploader.py


示例17: db_ready

def db_ready():
    try:
        from openproximity.models import BluetoothDongle
        BluetoothDongle.objects.count()
        return True
    except Exception, err:
	logger.info("Database not ready")
	logger.exception(err)
	return False
开发者ID:Nyophyte,项目名称:proximitymarketing,代码行数:9,代码来源:rpc.py


示例18: __sanitize

 def __sanitize(self):
     try:
         if self.tree is None:
             self.__getXmlTree()
     except Exception, err:
         logger.info("failed while loading file settings, trying to simulate"
                 " config file")
         logger.exception(err)
         self.tree=etree.fromstring(DEFAULT)
开发者ID:Nyophyte,项目名称:proximitymarketing,代码行数:9,代码来源:lxmltool.py


示例19: handle_file_uploaded

def handle_file_uploaded(dongle, remote, pending, channel, files):
    logger.info("files uploaded: %s[%s]: %s" % ( remote, channel, files) )
    pending.pop(remote)
    for rule in get_campaign_rule(files):
	record = RemoteBluetoothDeviceFilesSuccess()
	record.dongle = UploaderBluetoothDongle.objects.get(address=dongle)
	record.campaign = rule
	record.setRemoteDevice(remote)
	record.save()
开发者ID:Nyophyte,项目名称:proximitymarketing,代码行数:9,代码来源:uploader.py


示例20: configure_dongle

def configure_dongle(request, address=None):
    logger.info("configure_dongle %s" % address)
    
    errors = []
    messages = []
    form = None
    if request.method == "POST":
        form=DongleForm(request.POST)
        if form.is_valid():
            cd=form.cleaned_data
            add_dongle(
                cd['address'],
                cd['name'],
                cd["scan"],
                cd["upload"],
                cd["scan_pri"],
                cd["upload_max"],
            )
            return HttpResponseRedirect('/')
            #messages.append("Dongle Configured")

    scanner = None
    scanner_pri = 1
    uploader = None
    uploader_max = 7
    
    name = "OpenProximity 2.0"
    
    search=BluetoothDongle.objects.filter(address=address)
    if search.count()>0:
        dongle = search.all()[0]
        name=dongle.name
    
    search=ScannerBluetoothDongle.objects.filter(address=address)
    if search.count() > 0:
        scanner = True
        scanner_pri=search.get().priority
    
    search=UploaderBluetoothDongle.objects.filter(address=address)
    if search.count() > 0:
        uploader = True
        uploader_max=search.get().max_conn

    form = form or DongleForm( initial = { 
                                    'address': address, 
                                    'name': name,
                                     'scan': scanner,
                                     'scan_pri': scanner_pri,
                                     'upload': uploader,
                                     'upload_max': uploader_max})

    return render_to_response('op/dongle_form.html',
        { 
            'form':  form,
            'messages': messages,
        }, context_instance=RequestContext(request))
开发者ID:Nyophyte,项目名称:proximitymarketing,代码行数:56,代码来源:views.py



注:本文中的net.aircable.utils.logger.info函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python api.Container类代码示例发布时间:2022-05-27
下一篇:
Python ConnectionManager.ConnectionManager类代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap