本文整理汇总了Python中util.Util.trace方法的典型用法代码示例。如果您正苦于以下问题:Python Util.trace方法的具体用法?Python Util.trace怎么用?Python Util.trace使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类util.Util
的用法示例。
在下文中一共展示了Util.trace方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: run
# 需要导入模块: from util import Util [as 别名]
# 或者: from util.Util import trace [as 别名]
def run(self):
path = self._path
self._streamRef = FSEventStreamCreate(
kCFAllocatorDefault,
self.eventsCallback,
path,
[path],
kFSEventStreamEventIdSinceNow, # sinceWhen
1.0, # latency
0,
)
if self._streamRef is None:
Util.trace("FSEventStreamCreate is failed")
return
if False:
FSEventStreamShow(self._streamRef)
FSEventStreamScheduleWithRunLoop(self._streamRef, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode)
startedOK = FSEventStreamStart(self._streamRef)
if not startedOK:
Util.trace("failed to start the FSEventStream")
return
# if True:
# timer = CFRunLoopTimerCreate(
# FSEventStreamGetSinceWhen(streamRef),
# CFAbsoluteTimeGetCurrent() + settings.flush_seconds,
# settings.flush_seconds,
# 0, 0, timer_callback, streamRef)
# CFRunLoopAddTimer(CFRunLoopGetCurrent(), timer, kCFRunLoopDefaultMode)
CFRunLoopRun()
示例2: __del__
# 需要导入模块: from util import Util [as 别名]
# 或者: from util.Util import trace [as 别名]
def __del__(self):
Util.trace("destroy DirCheck instance")
streamRef = self._streamRef
# Stop / Invalidate / Release
FSEventStreamStop(streamRef)
FSEventStreamInvalidate(streamRef)
FSEventStreamRelease(streamRef)
示例3: _dumpVariable
# 需要导入模块: from util import Util [as 别名]
# 或者: from util.Util import trace [as 别名]
def _dumpVariable( self ):
Util.trace( "---------------------------" )
Util.trace( "index: " + str( self.index_ ) )
Util.trace( "name: " + str( self.name_ ) )
#Util.trace( "ext: " + str( self.ext_ ) )
Util.trace( "mtime: " + str( self.mtime_ ) )
Util.trace( "bgColor: " + str( self.bgColor_ ) )
示例4: Cmd_Open
# 需要导入模块: from util import Util [as 别名]
# 或者: from util.Util import trace [as 别名]
def Cmd_Open( vfiler, event ):
""" 関連づけられたプログラムでファイルを開く
"""
listCtrl = vfiler.getFocusedListCtrl()
focusedItemIndex = listCtrl.GetFocusedItem()
cmd = "open %s" %( listCtrl.getItemAbsPath( focusedItemIndex ) )
Util.trace( cmd )
os.system( cmd )
示例5: moveDir
# 需要导入模块: from util import Util [as 别名]
# 或者: from util.Util import trace [as 别名]
def moveDir( self, moveDirDirection ):
""" Key入力によってディレクトリを移動する
"""
nextPath = ""
if moveDirDirection==self.MOVE_DIR_UP:
nextPath = self.curDir + "/.."
elif moveDirDirection==self.MOVE_DIR_DOWN:
nextPath = self.getItemAbsPath( self.GetFocusedItem() )
if os.path.isdir( nextPath ):
Util.trace( "moveDir %s -> %s" %(self.getCurDir(), nextPath) )
nextPath = os.path.normpath( nextPath )
self.changeDir( nextPath )
示例6: eventsCallback
# 需要导入模块: from util import Util [as 别名]
# 或者: from util.Util import trace [as 别名]
def eventsCallback(self, streamRef, clientInfo, numEvents, eventPaths, eventMarsks, eventIDs):
fullPath = clientInfo
print ("callback: clientInfo[%s]" % (clientInfo))
for i in range(numEvents):
path = eventPaths[i]
if path[-1] == "/":
path = path[:-1]
print "eventPath => %s" % (path)
if path == self._path:
self._isChanged = True
eventMarsk = eventMarsks[i]
if eventMarsk & kFSEventStreamEventFlagMustScanSubDirs:
Util.trace("kFSEventStreamEventFlagMustScanSubDirs")
recursive = True
elif eventMarsk & kFSEventStreamEventFlagUserDropped:
Util.trace("kFSEventStreamEventFlagUserDropped")
recursive = True
path = fullPath
elif eventMarsk & kFSEventStreamEventFlagKernelDropped:
Util.trace("kFSEventStreamEventFlagKernelDropped")
recursive = 1
path = fullPath
else:
Util.trace("recive FSEvent callback")
recursive = False
示例7: deleteElem
# 需要导入模块: from util import Util [as 别名]
# 或者: from util.Util import trace [as 别名]
def deleteElem( self ):
""" 選択中エレメントをファイルリストから削除する
"""
focusedItemIndex = self.GetFocusedItem()
if self.getElemCount() and focusedItemIndex>=0:
forcusedElem = self.getElem( focusedItemIndex )
# elemListから削除
self.elemList.remove( forcusedElem )
# GUIから削除
self.DeleteItem( focusedItemIndex )
# FileSystemから削除
cmd = "rm -rf %s" %( forcusedElem.getAbsPath() )
Util.trace( cmd )
os.system( cmd )
示例8: copyElem
# 需要导入模块: from util import Util [as 别名]
# 或者: from util.Util import trace [as 别名]
def copyElem( self ):
""" 選択中エレメントを非フォーカスペインのディレクトリへコピーする
"""
focusedItemIndex = self.GetFocusedItem()
if self.getElemCount() and focusedItemIndex>=0:
forcusedElem = self.getElem( focusedItemIndex )
srcPath = forcusedElem.getAbsPath()
destPath = None
unfocusedPane = self.getFrame().getUnFocusedPane()
if unfocusedPane:
destPath = unfocusedPane.getCurDir()
if destPath and destPath!=os.path.dirname( srcPath ):
cmd = "cp -rf %s %s" %( srcPath, destPath )
Util.trace( cmd )
os.system( cmd )
示例9: Cmd_Delete
# 需要导入模块: from util import Util [as 别名]
# 或者: from util.Util import trace [as 别名]
def Cmd_Delete( vfiler, event ):
""" 選択中エレメントをファイルリストから削除する
"""
listCtrl = vfiler.getFocusedListCtrl()
focusedItemIndex = listCtrl.GetFocusedItem()
if listCtrl.getElemCount() and focusedItemIndex>=0:
forcusedElem = listCtrl.getElem( focusedItemIndex )
# elemListから削除
listCtrl.elemList.remove( forcusedElem )
# GUIから削除
listCtrl.DeleteItem( focusedItemIndex )
# FileSystemから削除
cmd = "rm -rf %s" %( forcusedElem.getAbsPath() )
Util.trace( cmd )
os.system( cmd )
示例10: Cmd_Copy
# 需要导入模块: from util import Util [as 别名]
# 或者: from util.Util import trace [as 别名]
def Cmd_Copy( vfiler, event ):
""" 選択中エレメントを非フォーカスペインのディレクトリへコピーする
"""
listCtrl = vfiler.getFocusedListCtrl()
focusedItemIndex = listCtrl.GetFocusedItem()
if listCtrl.getElemCount() and focusedItemIndex>=0:
forcusedElem = listCtrl.getElem( focusedItemIndex )
srcPath = forcusedElem.getAbsPath()
destPath = None
unfocusedPane = vfiler.getUnFocusedPane()
if unfocusedPane:
destPath = unfocusedPane.getCurDir()
if destPath and destPath!=os.path.dirname( srcPath ):
cmd = "cp -rf %s %s" %( srcPath, destPath )
Util.trace( cmd )
os.system( cmd )
示例11: updateFileList
# 需要导入模块: from util import Util [as 别名]
# 或者: from util.Util import trace [as 别名]
def updateFileList( self, curDir=None, filterFmt=None ):
""" ファイルリストを更新
"""
if curDir==None:
curDir = self.curDir
self.removeFileList()
self.elemList = []
Util.trace( "curDir [%s] updateFileList" %(curDir) )
listdir = os.listdir( curDir )
# ディレクトリ群、ファイル群の順番にソート
dirInfoList = []
fileInfoList = []
for e in listdir:
info = {}
if filterFmt!=None:
p = re.compile( filterFmt, re.IGNORECASE )
if not p.search( e ):
continue# マッチしなかったらフィルターする
info["name"] = e
absPath = "%s/%s" %( curDir, e )
if os.path.isdir( absPath ):
info["isDir"] = True
dirInfoList.append( info )
else:
info["isDir"] = False
fileInfoList.append( info )
infoList = dirInfoList + fileInfoList
# リストに追加
iFile = 0
for info in infoList:
if info["isDir"]:
#Util.trace( "add DIR " + e )
elem = ElemDir( iFile, self, info["name"] )
else:
#Util.trace( "add FILE " + e )
elem = ElemFile( iFile, self, info["name"] )
elem.update()
self.elemList.append( elem )
iFile += 1
# フォーカスがあるときに常に項目を選択状態にするため、Select
if len( self.elemList ):
self.Select( 0, True )
示例12: setListMode
# 需要导入模块: from util import Util [as 别名]
# 或者: from util.Util import trace [as 别名]
def setListMode( self, listMode ):
Util.trace( "change list mode %d => %d" %(self.listMode, listMode) )
self.listMode = listMode
示例13: updateIncSearch
# 需要导入模块: from util import Util [as 别名]
# 或者: from util.Util import trace [as 别名]
def updateIncSearch( self, searchWord ):
""" 検索ワードを受け取って、Incremental検索結果を更新
"""
Util.trace( "search of " + searchWord )
self.updateFileList( filterFmt=searchWord )
self.setListMode( ListCtrl.LIST_MODE_FILTERED )
示例14: removeFileList
# 需要导入模块: from util import Util [as 别名]
# 或者: from util.Util import trace [as 别名]
def removeFileList( self ):
""" ファイルリストを削除
"""
Util.trace( "removeFileList" )
self.DeleteAllItems()
示例15: Cmd_Move
# 需要导入模块: from util import Util [as 别名]
# 或者: from util.Util import trace [as 别名]
def Cmd_Move( vfiler, event ):
Util.trace( "NOT IMPLEMENT!" )