当前位置: 首页>>代码示例>>Python>>正文


Python Log.debug方法代码示例

本文整理汇总了Python中util.Log.debug方法的典型用法代码示例。如果您正苦于以下问题:Python Log.debug方法的具体用法?Python Log.debug怎么用?Python Log.debug使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在util.Log的用法示例。


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

示例1: __init__

# 需要导入模块: from util import Log [as 别名]
# 或者: from util.Log import debug [as 别名]
 def __init__(self, engine, controlnum, samprate=44100):
     Task.__init__(self)
     self.engine = engine
     self.controlnum = controlnum
     devnum = self.engine.input.controls.micDevice[controlnum]
     if devnum == -1:
         devnum = None
         self.devname = pa.get_default_input_device_info()['name']
     else:
         self.devname = pa.get_device_info_by_index(devnum)['name']
     self.mic = pa.open(samprate, 1, pyaudio.paFloat32, input=True, input_device_index=devnum, start=False)
     self.analyzer = pypitch.Analyzer(samprate)
     self.mic_started = False
     self.lastPeak    = 0
     self.detectTaps  = True
     self.tapStatus   = False
     self.tapThreshold = -self.engine.input.controls.micTapSensitivity[controlnum]
     self.passthroughQueue = []
     passthroughVolume = self.engine.input.controls.micPassthroughVolume[controlnum]
     if passthroughVolume > 0.0:
         Log.debug('Microphone: creating passthrough stream at %d%% volume' % round(passthroughVolume * 100))
         self.passthroughStream = Audio.MicrophonePassthroughStream(engine, self)
         self.passthroughStream.setVolume(passthroughVolume)
     else:
         Log.debug('Microphone: not creating passthrough stream')
         self.passthroughStream = None
开发者ID:Archangelgray,项目名称:fofix,代码行数:28,代码来源:Microphone.py

示例2: popLayer

# 需要导入模块: from util import Log [as 别名]
# 或者: from util.Log import debug [as 别名]
    def popLayer(self, layer):
        Log.debug("View: Pop: %s" % layer.__class__.__name__)

        if layer in self.incoming:
            self.incoming.remove(layer)
        if layer in self.layers and not layer in self.outgoing:
            self.outgoing.append(layer)
开发者ID:EdPassos,项目名称:fofix,代码行数:9,代码来源:View.py

示例3: loadVideo

# 需要导入模块: from util import Log [as 别名]
# 或者: from util.Log import debug [as 别名]
    def loadVideo(self, libraryName, songName):
        vidSource = None

        if self.songStage == 1:
            songBackgroundVideoPath = os.path.join(libraryName, songName, "background.ogv")
            if os.path.isfile(songBackgroundVideoPath):
                vidSource = songBackgroundVideoPath
                loop = False
            else:
                Log.warn("Video not found: %s" % songBackgroundVideoPath)

        if vidSource is None:
            vidSource = os.path.join(self.pathfull, "default.ogv")
            loop = True

        if not os.path.isfile(vidSource):
            Log.warn("Video not found: %s" % vidSource)
            Log.warn("Falling back to default stage mode.")
            self.mode = 1 # Fallback
            return

        try: # Catches invalid video files or unsupported formats
            Log.debug("Attempting to load video: %s" % vidSource)
            self.vidPlayer = VideoLayer(self.engine, vidSource,
                                        mute = True, loop = loop)
            self.engine.view.pushLayer(self.vidPlayer)
        except (IOError, VideoPlayerError):
            self.mode = 1
            Log.error("Failed to load song video (falling back to default stage mode):")
开发者ID:Archangelgray,项目名称:fofix,代码行数:31,代码来源:Stage.py

示例4: remove

# 需要导入模块: from util import Log [as 别名]
# 或者: from util.Log import debug [as 别名]
    def remove(self):
        """ Remove component with given name.

        Returns True if the component successfully removed.
        """
        Log.debug("Pubkey.remove(): removing")
        self._remove_key()
        super().remove()
        return True
开发者ID:ctldev,项目名称:ctlweb,代码行数:11,代码来源:pubkey.py

示例5: stop

# 需要导入模块: from util import Log [as 别名]
# 或者: from util.Log import debug [as 别名]
 def stop(self):
     if self.mic_started:
         if self.passthroughStream is not None:
             Log.debug('Microphone: stopping passthrough stream')
             self.passthroughStream.stop()
         self.engine.removeTask(self)
         self.mic.stop_stream()
         self.mic_started = False
         Log.debug('Microphone: stopped %s' % self.devname)
开发者ID:Archangelgray,项目名称:fofix,代码行数:11,代码来源:Microphone.py

示例6: start

# 需要导入模块: from util import Log [as 别名]
# 或者: from util.Log import debug [as 别名]
 def start(self):
     if not self.mic_started:
         self.mic_started = True
         self.mic.start_stream()
         self.engine.addTask(self, synchronized=False)
         Log.debug('Microphone: started %s' % self.devname)
         if self.passthroughStream is not None:
             Log.debug('Microphone: starting passthrough stream')
             self.passthroughStream.play()
开发者ID:Archangelgray,项目名称:fofix,代码行数:11,代码来源:Microphone.py

示例7: drop_table

# 需要导入模块: from util import Log [as 别名]
# 或者: from util.Log import debug [as 别名]
 def drop_table(self):
     """ Should remove the tables created by the class. Every child of
     database which stores its own data should implement this function.
     """
     Log.debug("Dropping Table %s" % self.__name__)
     cursor = self.db_connection.cursor()
     sql = "DROP TABLE "
     sql += self.__name__
     cursor.execute(sql)
     self.db_connection.commit()
开发者ID:ctldev,项目名称:ctlweb,代码行数:12,代码来源:database.py

示例8: getSoundObjectList

# 需要导入模块: from util import Log [as 别名]
# 或者: from util.Log import debug [as 别名]
    def getSoundObjectList(self, soundPath, soundPrefix, numSounds, soundExtension=".ogg"):  # MFH
        Log.debug("{0}1{2} - {0}{1}{2} found in {3}".format(soundPrefix, numSounds, soundExtension, soundPath))

        sounds = []
        for i in xrange(1, numSounds + 1):
            filePath = os.path.join(soundPath, "%s%d%s" % (soundPrefix, i, soundExtension))
            soundObject = Sound(self.resource.fileName(filePath))
            sounds.append(soundObject)

        return sounds
开发者ID:EdPassos,项目名称:fofix,代码行数:12,代码来源:Data.py

示例9: loadLibrary

# 需要导入模块: from util import Log [as 别名]
# 或者: from util.Log import debug [as 别名]
 def loadLibrary(self):
     Log.debug("Loading libraries in %s" % self.library)
     self.loaded = False
     self.tiersPresent = False
     if self.splash:
         Dialogs.changeLoadingSplashScreenText(self.engine, self.splash, _("Browsing Collection..."))
     else:
         self.splash = Dialogs.showLoadingSplashScreen(self.engine, _("Browsing Collection..."))
         self.loadStartTime = time.time()
     self.engine.resource.load(self, "libraries", lambda: Song.getAvailableLibraries(self.engine, self.library), onLoad = self.loadSongs, synch = True)
开发者ID:Archangelgray,项目名称:fofix,代码行数:12,代码来源:SongChoosingScene.py

示例10: showTutorial

# 需要导入模块: from util import Log [as 别名]
# 或者: from util.Log import debug [as 别名]
    def showTutorial(self):
        # evilynux - Make sure tutorial exists before launching
        tutorialpath = self.engine.tutorialFolder
        if not os.path.isdir(self.engine.resource.fileName(tutorialpath)):
            Log.debug("No folder found: %s" % tutorialpath)
            Dialogs.showMessage(self.engine, _("No tutorials found!"))
            return

        self.engine.startWorld(1, None, 0, 0, tutorial = True)

        self.launchLayer(lambda: Lobby(self.engine))
开发者ID:Archangelgray,项目名称:fofix,代码行数:13,代码来源:MainMenu.py

示例11: add

# 需要导入模块: from util import Log [as 别名]
# 或者: from util.Log import debug [as 别名]
    def add(cls, attr):
        """ This method adds a new object to database and authorized_keys.

        attr is expected to be a dictionary.
        The attr are at least and have to be compatible with the create()
        attributes:
            * c_id
            * f_Pubkey_pubkey
        """
        Log.debug('Creating object with ssh access'
                  ' and granting access for public key.')
        return cls.create(attr)
开发者ID:ctldev,项目名称:ctlweb,代码行数:14,代码来源:access.py

示例12: upload_to_web

# 需要导入模块: from util import Log [as 别名]
# 或者: from util.Log import debug [as 别名]
    def upload_to_web(self, url):
        """ Upload the component to the given url

        """
        Log.critical('upload_to_web() has been called. This function is deprecated')
        Log.debug("Uploading component to url %s" % url)
        import requests
        manifest_file = self._component_file
        files = {'manifest': open(manifest_file, "rb")}
        r = requests.post(url, files=files)
        if r.status_code != requests.codes.ok:
            Log.critical("Error %s occured while upload" % r.status_code)
开发者ID:ctldev,项目名称:ctlweb,代码行数:14,代码来源:component.py

示例13: pushLayer

# 需要导入模块: from util import Log [as 别名]
# 或者: from util.Log import debug [as 别名]
    def pushLayer(self, layer):
        Log.debug("View: Push: %s" % layer.__class__.__name__)

        if not layer in self.layers:
            self.layers.append(layer)
            self.incoming.append(layer)
            self.visibility[layer] = 0.0
            layer.shown()
        elif layer in self.outgoing:
            layer.hidden()
            layer.shown()
            self.outgoing.remove(layer)
        self.engine.addTask(layer)
开发者ID:EdPassos,项目名称:fofix,代码行数:15,代码来源:View.py

示例14: add

# 需要导入模块: from util import Log [as 别名]
# 或者: from util.Log import debug [as 别名]
 def add(cls, name, exe_hash):
     """ Creates a new Comonent log and saves it. The new component log will
     be returned.
     """
     Log.debug('Component_Log.add(): adding killed component.')
     data = {'c_name': name,
             'c_exe_hash': exe_hash}
     cl = cls.create(data)
     try:
         cl.save()
     except NoSuchTable:
         cl.create_table().save()
     return cl
开发者ID:ctldev,项目名称:ctlweb,代码行数:15,代码来源:component.py

示例15: test_get

# 需要导入模块: from util import Log [as 别名]
# 或者: from util.Log import debug [as 别名]
 def test_get(self):
     from datetime import datetime
     from datetime import timedelta
     self.comp.create_table()
     self.comp.save()
     # Test get all
     comps = Component.get()
     self.assertIsNotNone(comps, "Could not retrieve Component")
     self.assertEqual(comps[0], self.comp, "Could not deserialize data")
     time_since = datetime.today() - timedelta(minutes=10)
     comps = Component.get(time_since)
     Log.debug("test_get(): comps: " + str(comps))
     self.assertEqual(comps[0], self.comp, "Could not deserialize data")
开发者ID:ctldev,项目名称:ctlweb,代码行数:15,代码来源:test_component.py


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