资源简介
sublime的GoSublime插件 用于go语言开发
代码片段和文件信息
import os
import sublime
import sys
import traceback
st2 = (sys.version_info[0] == 2)
dist_dir = os.path.dirname(os.path.abspath(__file__))
sys.path.insert(0 dist_dir)
ANN = ‘‘
VERSION = ‘‘
MARGO_EXE = ‘‘
fn = os.path.join(dist_dir ‘gosubl‘ ‘about.py‘)
execErr = ‘‘
try:
with open(fn) as f:
code = compile(f.read() fn ‘exec‘)
exec(code)
except Exception:
execErr = “Error: failed to exec about.py: Exception: %s“ % traceback.format_exc()
print(“GoSublime: %s“ % execErr)
def plugin_loaded():
from gosubl import about
from gosubl import sh
from gosubl import ev
from gosubl import gs
from gosubl import mg9
if VERSION != about.VERSION:
gs.show_output(‘GoSublime-main‘ ‘\n‘.join([
‘GoSublime has been updated.‘
‘New version: ‘%s‘ current version: ‘%s‘‘ % (VERSION about.VERSION)
‘Please restart Sublime Text to complete the update.‘
execErr
]))
return
if gs.attr(‘about.version‘):
gs.show_output(‘GoSublime-main‘ ‘\n‘.join([
‘GoSublime appears to have been updated.‘
‘New ANNOUNCE: ‘%s‘ current ANNOUNCE: ‘%s‘‘ % (ANN about.ANN)
‘You may need to restart Sublime Text.‘
]))
return
mods = [
(‘gs‘ gs)
(‘sh‘ sh)
(‘mg9‘ mg9)
]
gs.set_attr(‘about.version‘ VERSION)
gs.set_attr(‘about.ann‘ ANN)
for mod_name mod in mods:
print(‘GoSublime %s: init mod(%s)‘ % (VERSION mod_name))
try:
mod.gs_init({
‘version‘: VERSION
‘ann‘: ANN
‘margo_exe‘: MARGO_EXE
})
except TypeError:
# old versions didn‘t take an arg
mod.gs_init()
ev.init.post_add = lambda e f: f()
ev.init()
def cb():
aso = gs.aso()
old_version = aso.get(‘version‘ ‘‘)
old_ann = aso.get(‘ann‘ ‘‘)
if about.VERSION > old_version or about.ANN > old_ann:
aso.set(‘version‘ about.VERSION)
aso.set(‘ann‘ about.ANN)
gs.save_aso()
gs.focus(gs.dist_path(‘CHANGELOG.md‘))
sublime.set_timeout(cb 0)
if st2:
sublime.set_timeout(plugin_loaded 0)
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2013-07-23 10:56 GoSublime-master\
文件 1 2013-07-23 10:56 GoSublime-master\.no-sublime-package
文件 939 2013-07-23 10:56 GoSublime-master\9o.hidden-tmLanguage
文件 440 2013-07-23 10:56 GoSublime-master\9o.hidden-tmLanguage.json
文件 5170 2013-07-23 10:56 GoSublime-master\9o.md
文件 546 2013-07-23 10:56 GoSublime-master\AUTHORS.md
文件 27548 2013-07-23 10:56 GoSublime-master\CHANGELOG.md
文件 5493 2013-07-23 10:56 GoSublime-master\Default (Linux).sublime-keymap
文件 264 2013-07-23 10:56 GoSublime-master\Default (Linux).sublime-mousemap
文件 5549 2013-07-23 10:56 GoSublime-master\Default (OSX).sublime-keymap
文件 266 2013-07-23 10:56 GoSublime-master\Default (OSX).sublime-mousemap
文件 5494 2013-07-23 10:56 GoSublime-master\Default (Windows).sublime-keymap
文件 264 2013-07-23 10:56 GoSublime-master\Default (Windows).sublime-mousemap
文件 497 2013-07-23 10:56 GoSublime-master\GoSublime-next.tmLanguage
文件 1947 2013-07-23 10:56 GoSublime-master\GoSublime.py
文件 54 2013-07-23 10:56 GoSublime-master\GoSublime.sublime-build
文件 3684 2013-07-23 10:56 GoSublime-master\GoSublime.sublime-commands
文件 13254 2013-07-23 10:56 GoSublime-master\GoSublime.sublime-settings
文件 493 2013-07-23 10:56 GoSublime-master\GoSublime.tmLanguage
文件 12636 2013-07-23 10:56 GoSublime-master\GoSublime.tmLanguage.json
文件 19843 2013-07-23 10:56 GoSublime-master\GsDoc.hidden-tmLanguage
文件 1065 2013-07-23 10:56 GoSublime-master\LICENSE.md
文件 2428 2013-07-23 10:56 GoSublime-master\Main.sublime-menu
文件 79 2013-07-23 10:56 GoSublime-master\Preferences.sublime-settings
文件 5147 2013-07-23 10:56 GoSublime-master\README.md
文件 879 2013-07-23 10:56 GoSublime-master\THANKS.md
文件 8021 2013-07-23 10:56 GoSublime-master\USAGE.md
目录 0 2013-07-23 10:56 GoSublime-master\articles\
文件 1510 2013-07-23 10:56 GoSublime-master\articles\golint.md
文件 1324 2013-07-23 10:56 GoSublime-master\articles\shell.md
目录 0 2013-07-23 10:56 GoSublime-master\doc\
............此处省略163个文件信息
- 上一篇:基于数字钟的大小月份自动调节系统
- 下一篇:UFGOV-R9破解
评论
共有 条评论