From d464ab60189377caa80156e06af03a5a49b4040e Mon Sep 17 00:00:00 2001 From: Stefan Date: Thu, 4 Jul 2013 01:01:35 +0300 Subject: [PATCH 1/2] Replace a tab symbol "\t" with a tab literal --- stdlib.sublime-completions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stdlib.sublime-completions b/stdlib.sublime-completions index a41147a..335c53d 100644 --- a/stdlib.sublime-completions +++ b/stdlib.sublime-completions @@ -2328,5 +2328,5 @@ "EClickable.simple", "EClickable", "Multimap" -\t] + ] } From 58096826970965f861206a50e2fa4f3f651fbaf8 Mon Sep 17 00:00:00 2001 From: Stefan Date: Thu, 4 Jul 2013 01:04:32 +0300 Subject: [PATCH 2/2] Fixing build failures on Ubuntu 12.04 LTS 64-bit Build failures caused by: 1. modtime update latency 2. Current file's dirname, nested deeply in application's root folder --- commands.py | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/commands.py b/commands.py index af1ca1c..e5b8b77 100644 --- a/commands.py +++ b/commands.py @@ -99,15 +99,18 @@ def output(view,str): class runOpaBuildCommand(sublime_plugin.TextCommand): def run(self, view): - panel = self.view.window().get_output_panel("exec") - dirname = os.path.dirname(self.view.file_name()) + wait = 5 exe = exe_name + dirname = getAppDir(self.view.file_name()) + panel = self.view.window().get_output_panel("exec") output(panel, "Will build & run "+exe) output(panel,"\nCompiling ...") tbuild0 = modtime(os.path.join(dirname,exe)) # because we have no error code, we have to check if a new exe has been generated self.view.window().run_command('build') - time.sleep(0.8) # for some reason the modification time is modified latter - tbuild1 = modtime(os.path.join(dirname,exe)) + while tbuild0 == modtime(os.path.join(dirname,exe)) and wait: + wait -=1 + time.sleep(1) # for some reason the modification time is modified latter + tbuild1 = modtime(os.path.join(dirname,exe)) if tbuild0 < tbuild1: output(panel,"done\n") output(panel,"\nStoping previous launch ...") @@ -122,6 +125,18 @@ def run(self, view): class stopRunOpaBuildCommand(sublime_plugin.TextCommand): def run(self, view): - dirname = os.path.dirname(self.view.file_name()) + dirname = getAppDir(self.view.file_name()) print "Will kill", exe_name kill(self,dirname,exe_name) + +def getAppDir(filepath): + dirname = os.path.dirname(filepath) + dn2 = dirname + dn1 = "" + while dn1 != dn2: + dn1 = dn2 + if os.path.exists(os.path.join(dn1, "opa.conf")): + dirname = dn1 + break + dn2 = os.path.dirname(dn1) + return dirname