3 Star 0 Fork 0

g8up / sublimetext3-plugin

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
util.py 907 Bytes
一键复制 编辑 原始数据 按行查看 历史
g8up 提交于 2018-03-03 12:34 . 设置编码;更新备注
# @file util.py
# @desc 置于 Preferences -> Browser Packages 弹出的目录下
import os, sublime
def runCommand( cd, commands ):
'解析命令行'
if( len( commands ) > 0 ):
if( cd != "" ):
os.chdir( cd )
commands.reverse()
commandStr = " & ".join( commands )
print( "执行命令", commandStr )
os.system( commandStr )
else:
sublime.message_dialog( "命令不能为空" )
def getFisProjectPath( paths ):
'解析路径到 fis 工程根目录'
while( len (paths) > 0 and not os.path.exists( "\\".join( paths ) + "\\widget" ) ):
curPath = paths.pop()
# sublime.message_dialog( str( len (paths)) )
if( len (paths) == 0 ):
return ""
return "\\".join(paths)
def getFileCurrentPath( filePath ):
path=filePath.split("\\")
current_driver=path[0]
path.pop()
return "\\".join(path)
Python
1
https://gitee.com/g8up/sublimetext3-plugin.git
git@gitee.com:g8up/sublimetext3-plugin.git
g8up
sublimetext3-plugin
sublimetext3-plugin
master

搜索帮助