本文整理汇总了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)