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


Python Log.debug方法代码示例

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


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

示例1: popLayer

# 需要导入模块: from fofix.core import Log [as 别名]
# 或者: from fofix.core.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 layer not in self.outgoing:
            self.outgoing.append(layer)
开发者ID:Linkid,项目名称:fofix,代码行数:9,代码来源:View.py

示例2: __init__

# 需要导入模块: from fofix.core import Log [as 别名]
# 或者: from fofix.core.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:Linkid,项目名称:fofix,代码行数:28,代码来源:Microphone.py

示例3: disableScreensaver

# 需要导入模块: from fofix.core import Log [as 别名]
# 或者: from fofix.core.Log import debug [as 别名]
    def disableScreensaver(self):
        if os.name == 'nt':
            # See the DisableScreensaver and RestoreScreensaver functions in
            # modules/video_output/msw/common.c in the source code for VLC.
            import win32gui
            import win32con
            import atexit

            Log.debug('Disabling screensaver.')

            old_lowpowertimeout = win32gui.SystemParametersInfo(win32con.SPI_GETLOWPOWERTIMEOUT)
            if old_lowpowertimeout != 0:
                atexit.register(lambda: win32gui.SystemParametersInfo(win32con.SPI_SETLOWPOWERTIMEOUT, old_lowpowertimeout))
                win32gui.SystemParametersInfo(win32con.SPI_SETLOWPOWERTIMEOUT, 0)

            old_powerofftimeout = win32gui.SystemParametersInfo(win32con.SPI_GETPOWEROFFTIMEOUT)
            if old_powerofftimeout != 0:
                atexit.register(lambda: win32gui.SystemParametersInfo(win32con.SPI_SETPOWEROFFTIMEOUT, old_powerofftimeout))
                win32gui.SystemParametersInfo(win32con.SPI_SETPOWEROFFTIMEOUT, 0)

            old_screensavetimeout = win32gui.SystemParametersInfo(win32con.SPI_GETSCREENSAVETIMEOUT)
            if old_screensavetimeout != 0:
                atexit.register(lambda: win32gui.SystemParametersInfo(win32con.SPI_SETSCREENSAVETIMEOUT, old_screensavetimeout))
                win32gui.SystemParametersInfo(win32con.SPI_SETSCREENSAVETIMEOUT, 0)

        else:
            Log.debug('Screensaver disabling is not implemented on this platform.')
开发者ID:ajs124,项目名称:fofix,代码行数:29,代码来源:Video.py

示例4: loadVideo

# 需要导入模块: from fofix.core import Log [as 别名]
# 或者: from fofix.core.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:ajs124,项目名称:fofix,代码行数:31,代码来源:Stage.py

示例5: stop

# 需要导入模块: from fofix.core import Log [as 别名]
# 或者: from fofix.core.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:Linkid,项目名称:fofix,代码行数:11,代码来源:Microphone.py

示例6: start

# 需要导入模块: from fofix.core import Log [as 别名]
# 或者: from fofix.core.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:Linkid,项目名称:fofix,代码行数:11,代码来源:Microphone.py

示例7: getSoundObjectList

# 需要导入模块: from fofix.core import Log [as 别名]
# 或者: from fofix.core.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:ajs124,项目名称:fofix,代码行数:12,代码来源:Data.py

示例8: loadLibrary

# 需要导入模块: from fofix.core import Log [as 别名]
# 或者: from fofix.core.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:Linkid,项目名称:fofix,代码行数:12,代码来源:SongChoosingScene.py

示例9: showTutorial

# 需要导入模块: from fofix.core import Log [as 别名]
# 或者: from fofix.core.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:Wolferacing,项目名称:fofix,代码行数:13,代码来源:MainMenu.py

示例10: pushLayer

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

        if layer not 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:Linkid,项目名称:fofix,代码行数:15,代码来源:View.py

示例11: __init__

# 需要导入模块: from fofix.core import Log [as 别名]
# 或者: from fofix.core.Log import debug [as 别名]
    def __init__(self, name, number):

        self.logClassInits = Config.get("game", "log_class_inits")
        if self.logClassInits == 1:
            Log.debug("Player class init (Player.py)...")

        self.name     = name

        self.reset()
        self.keyList     = None

        self.progressKeys = []
        self.drums        = []
        self.keys         = []
        self.soloKeys     = []
        self.soloShift    = None
        self.soloSlide    = False
        self.actions      = []
        self.yes          = []
        self.no           = []
        self.conf         = []
        self.up           = []
        self.down         = []
        self.left         = []
        self.right        = []
        self.controller   = -1
        self.controlType  = -1

        self.guitarNum    = None
        self.number       = number

        self.bassGrooveEnabled = False
        self.currentTheme = 1

        self.lefty       = _playerDB.execute('SELECT `lefty` FROM `players` WHERE `name` = ?', [self.name]).fetchone()[0]
        self.twoChordMax = _playerDB.execute('SELECT `twochord` FROM `players` WHERE `name` = ?', [self.name]).fetchone()[0]
        self.drumflip    = _playerDB.execute('SELECT `drumflip` FROM `players` WHERE `name` = ?', [self.name]).fetchone()[0]
        self.assistMode  = _playerDB.execute('SELECT `assist` FROM `players` WHERE `name` = ?', [self.name]).fetchone()[0]
        self.autoKick    = _playerDB.execute('SELECT `autokick` FROM `players` WHERE `name` = ?', [self.name]).fetchone()[0]
        self.neck        = _playerDB.execute('SELECT `neck` FROM `players` WHERE `name` = ?', [self.name]).fetchone()[0]
        self.neckType    = _playerDB.execute('SELECT `necktype` FROM `players` WHERE `name` = ?', [self.name]).fetchone()[0]
        self.whichPart   = _playerDB.execute('SELECT `part` FROM `players` WHERE `name` = ?', [self.name]).fetchone()[0]
        self._upname      = _playerDB.execute('SELECT `upname` FROM `players` WHERE `name` = ?', [self.name]).fetchone()[0]
        self._difficulty  = _playerDB.execute('SELECT `difficulty` FROM `players` WHERE `name` = ?', [self.name]).fetchone()[0]
        #MFH - need to store selected practice mode and start position here
        self.practiceMode = False
        self.practiceSpeed = 1.0
        self.practiceSection = None
        self.startPos = 0.0

        self.hopoFreq = None
开发者ID:Linkid,项目名称:fofix,代码行数:53,代码来源:Player.py

示例12: init_oneshot

# 需要导入模块: from fofix.core import Log [as 别名]
# 或者: from fofix.core.Log import debug [as 别名]
    def init_oneshot(self):
        """ Determine if oneshot mode is valid. """
        # I think this code can be moved elsewhere...
        self.engine.cmdPlay = 0

        # Check for a valid invocation of one-shot mode.
        if self.playing is not None:
            Log.debug("Validating song directory for one-shot mode.")

            library = Config.get("setlist", "base_library")
            basefolder = os.path.join(Version.dataPath(), library, "songs", self.playing)

            if not os.path.exists(os.path.join(basefolder, "song.ini")):

                if not (
                    os.path.exists(os.path.join(basefolder, "notes.mid"))
                    or os.path.exists(os.path.join(basefolder, "notes-unedited.mid"))
                ):

                    if not (
                        os.path.exists(os.path.join(basefolder, "song.ogg"))
                        or os.path.exists(os.path.join(basefolder, "guitar.ogg"))
                    ):

                        Log.warn(
                            "Song directory provided ('%s') is not a valid song directory. Starting up FoFiX in standard mode."
                            % self.playing
                        )
                        self.engine.startupMessages.append(
                            _(
                                "Song directory provided ('%s') is not a valid song directory. Starting up FoFiX in standard mode."
                            )
                            % self.playing
                        )
                        return

            # Set up one-shot mode
            Log.debug("Entering one-shot mode.")
            Config.set("setlist", "selected_song", playing)

            self.engine.cmdPlay = 1

            if diff is not None:
                self.engine.cmdDiff = int(diff)
            if part is not None:
                self.engine.cmdPart = int(part)

            if players == 1:
                self.engine.cmdMode = players, mode, 0
            else:
                self.engine.cmdMode = players, 0, mode
开发者ID:Linkid,项目名称:fofix,代码行数:53,代码来源:FoFiX.py

示例13: loadTex2D

# 需要导入模块: from fofix.core import Log [as 别名]
# 或者: from fofix.core.Log import debug [as 别名]
    def loadTex2D(self, fname, type = GL_RGB):
        file = os.path.join(self.workdir,fname)
        if os.path.exists(file):
            img = pygame.image.load(file)
            noise = pygame.image.tostring(img, "RGB")
        else:
            Log.debug("Can't load %s; generating random 2D noise instead." % fname)
            return self.makeNoise2D(16)

        texture = 0
        glBindTexture(GL_TEXTURE_2D, texture)
        glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT)
        glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT)
        glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR)
        glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR)
        glTexImage2D(GL_TEXTURE_2D, 0, 1, img.get_width(), img.get_height(), 0, type, GL_UNSIGNED_BYTE, noise)
        return texture
开发者ID:Linkid,项目名称:fofix,代码行数:19,代码来源:Shader.py

示例14: gcDump

# 需要导入模块: from fofix.core import Log [as 别名]
# 或者: from fofix.core.Log import debug [as 别名]
 def gcDump(self):
     before = len(gc.get_objects())
     coll   = gc.collect()
     after  = len(gc.get_objects())
     Log.debug("%d GC objects collected, total %d -> %d." % (coll, before, after))
     fn = "gcdump.txt"
     f = open(fn, "w")
     n = 0
     gc.collect()
     for obj in gc.garbage:
         try:
             print >>f, obj
             n += 1
         except:
             pass
     f.close()
     Log.debug("Wrote a dump of %d GC garbage objects to %s." % (n, fn))
开发者ID:Linkid,项目名称:fofix,代码行数:19,代码来源:Debug.py

示例15: open

# 需要导入模块: from fofix.core import Log [as 别名]
# 或者: from fofix.core.Log import debug [as 别名]
    def open(self, frequency = 22050, bits = 16, stereo = True, bufferSize = 1024):
        try:
            pygame.mixer.quit()
        except:
            pass

        try:
            pygame.mixer.init(frequency, -bits, stereo and 2 or 1, bufferSize)
        except:
            Log.warn("Audio setup failed. Trying with default configuration.")
            pygame.mixer.init()

        Log.debug("Audio configuration: %s" % str(pygame.mixer.get_init()))

        #myfingershurt: ensuring we have enough audio channels!
        pygame.mixer.set_num_channels(10)

        return True
开发者ID:Linkid,项目名称:fofix,代码行数:20,代码来源:Audio.py


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