本文整理匯總了Python中libs.Paths.getPluginPath方法的典型用法代碼示例。如果您正苦於以下問題:Python Paths.getPluginPath方法的具體用法?Python Paths.getPluginPath怎麽用?Python Paths.getPluginPath使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類libs.Paths
的用法示例。
在下文中一共展示了Paths.getPluginPath方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: endSetup
# 需要導入模塊: from libs import Paths [as 別名]
# 或者: from libs.Paths import getPluginPath [as 別名]
def endSetup(self):
# get pio version
executable = os.path.join(self.env_bin_dir, 'pio')
cmd = ['\"' + executable + '\"', '--version']
out = childProcess(cmd)
pio_version = match(r"\w+\W \w+ (.+)", out[1]).group(1)
self.Preferences.set('pio_version', pio_version)
# save env paths
env_path = [self.env_bin_dir]
self.saveEnvPaths(env_path)
# copy menu
sys_os = Tools.getOsName()
preset_path = Paths.getPresetPath()
plg_path = Paths.getPluginPath()
dst = os.path.join(plg_path, 'Settings-Default', 'Main.sublime-menu')
if(sys_os == 'windows'):
src_path = os.path.join(preset_path, 'Main.sublime-menu.windows')
copy(src_path, dst)
elif(sys_os == 'osx'):
src_path = os.path.join(preset_path, 'Main.sublime-menu.osx')
copy(src_path, dst)
else:
src_path = os.path.join(preset_path, 'Main.sublime-menu.linux')
copy(src_path, dst)
# creating files (menu, completions, syntax)
generateFiles()
示例2: removePreferences
# 需要導入模塊: from libs import Paths [as 別名]
# 或者: from libs.Paths import getPluginPath [as 別名]
def removePreferences():
from shutil import rmtree
try:
from . import Paths
except:
from libs import Paths
plug_path = Paths.getPluginPath()
dst = os.path.join(plug_path, 'Settings-Default', 'Main.sublime-menu')
user_path = Paths.getDeviotUserPath()
main_menu = Paths.getSublimeMenuPath()
# remove files
rmtree(user_path, ignore_errors=False)
os.remove(main_menu)
os.remove(dst)
示例3: endSetup
# 需要導入模塊: from libs import Paths [as 別名]
# 或者: from libs.Paths import getPluginPath [as 別名]
def endSetup(self):
try:
from .PlatformioCLI import generateFiles
except:
from libs.PlatformioCLI import generateFiles
# save env paths
if(self.os != 'osx'):
env_path = [self.env_bin_dir]
self.saveEnvPaths(env_path)
# get pio version
if(self.os == 'osx'):
executable = os.path.join(self.env_bin_dir, 'python')
cmd = ['"%s"' % (executable), '-m', 'platformio', '--version']
else:
executable = os.path.join(self.env_bin_dir, 'pio')
cmd = ['"%s"' % (executable), '--version']
out = childProcess(cmd)
pio_version = match(r"\w+\W \w+ (.+)", out[1]).group(1)
self.Preferences.set('pio_version', pio_version)
# copy menu
sys_os = Tools.getOsName()
preset_path = Paths.getPresetPath()
plg_path = Paths.getPluginPath()
dst = os.path.join(plg_path, 'Settings-Default', 'Main.sublime-menu')
if(sys_os == 'windows'):
if(platform.release() == '7'):
src_path = os.path.join(preset_path, 'Main.sublime-menu.w7')
else:
src_path = os.path.join(preset_path, 'Main.sublime-menu.windows')
copy(src_path, dst)
elif(sys_os == 'osx'):
src_path = os.path.join(preset_path, 'Main.sublime-menu.osx')
copy(src_path, dst)
else:
src_path = os.path.join(preset_path, 'Main.sublime-menu.linux')
copy(src_path, dst)
# creating files (menu, completions, syntax)
sublime.set_timeout(generateFiles, 0)
self.Preferences.set('protected', True)
self.Preferences.set('enable_menu', True)