First of all, patch Sublime Text 2 exec.py. In method run of class ExecCommand replace this strings (line 130):
self.proc = None
if not self.quiet:
print "Running " + " ".join(cmd)
sublime.status_message("Building")
self.proc = None
if not self.quiet:
def foo(element):
try:
element = element.encode(self.encoding)
except UnicodeDecodeError:
pass
return element
print "Running " + " ".join(map(foo, cmd))
sublime.status_message("Building")
{
"folders":
[
{
"path": "/home/snegovik/sandbox/repo",
"name": "PPP Hydro",
"folder_exclude_patterns" :
[
"build",
"bin",
"lib",
"test_old"
],
"file_exclude_patterns":
[
"*.pyc",
"*.pyd",
"*.pyo",
"*.exe",
"*.dll",
"*.obj",
"*.o",
"*.a",
"*.lib",
"*.so",
"*.dylib",
"*.ncb",
"*.sdf",
"*.suo",
"*.pdb",
"*.idb",
".DS_Store",
"*.class",
"*.psd",
"*.db"
]
},
{
"path": "/home/snegovik/.config/pudb",
"name": "PUDB"
}
],
"settings":
{
"tab_size" : 4
},
"build_systems":
[
{
"name" : "PPP Hydro",
"encoding" : "utf-8",
"working_dir" : "/home/snegovik/sandbox/repo/",
"cmd": ["python", "-u", "/home/snegovik/sandbox/repo/ufsim-office"],
"selector": "source.python",
"variants" : [
{
"name": "CVI_lost",
"cmd": ["python",
"-u",
"/home/snegovik/sandbox/repo/ufsim-office",
"/home/snegovik/sandbox/test-models/CVI_lost/CVI1.dat"]
},
{
"name": "Кушнаренковское",
"cmd": ["python",
"-u",
"/home/snegovik/sandbox/repo/ufsim-office",
"/home/snegovik/sandbox/test-models/model/kushnarenk.DAT"]
}
]
}
]
}
self.proc = None
if not self.quiet:
print "Running " + " ".join(cmd)
sublime.status_message("Building")
with
self.proc = None
if not self.quiet:
def foo(element):
try:
element = element.encode(self.encoding)
except UnicodeDecodeError:
pass
return element
print "Running " + " ".join(map(foo, cmd))
sublime.status_message("Building")
Then create your build configurations for projects. In Sublime's menu select Project - Edit Project and make it look like this:
{
"folders":
[
{
"path": "/home/snegovik/sandbox/repo",
"name": "PPP Hydro",
"folder_exclude_patterns" :
[
"build",
"bin",
"lib",
"test_old"
],
"file_exclude_patterns":
[
"*.pyc",
"*.pyd",
"*.pyo",
"*.exe",
"*.dll",
"*.obj",
"*.o",
"*.a",
"*.lib",
"*.so",
"*.dylib",
"*.ncb",
"*.sdf",
"*.suo",
"*.pdb",
"*.idb",
".DS_Store",
"*.class",
"*.psd",
"*.db"
]
},
{
"path": "/home/snegovik/.config/pudb",
"name": "PUDB"
}
],
"settings":
{
"tab_size" : 4
},
"build_systems":
[
{
"name" : "PPP Hydro",
"encoding" : "utf-8",
"working_dir" : "/home/snegovik/sandbox/repo/",
"cmd": ["python", "-u", "/home/snegovik/sandbox/repo/ufsim-office"],
"selector": "source.python",
"variants" : [
{
"name": "CVI_lost",
"cmd": ["python",
"-u",
"/home/snegovik/sandbox/repo/ufsim-office",
"/home/snegovik/sandbox/test-models/CVI_lost/CVI1.dat"]
},
{
"name": "Кушнаренковское",
"cmd": ["python",
"-u",
"/home/snegovik/sandbox/repo/ufsim-office",
"/home/snegovik/sandbox/test-models/model/kushnarenk.DAT"]
}
]
}
]
}
Now select Tools - Build systems and select your build configuration. Then run your build.
Комментариев нет:
Отправить комментарий