def open_workspace_window2(cb):
            if sublime.platform() == 'linux':
                subl = open('/proc/self/cmdline').read().split(chr(0))[0]
            elif sublime.platform() == 'osx':
                floorc = utils.load_floorc_json()
                subl = floorc.get('SUBLIME_EXECUTABLE')
                if not subl:
                    settings = sublime.load_settings('Floobits.sublime-settings')
                    subl = settings.get('sublime_executable', '/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl')
                if not os.path.exists(subl):
                    return sublime.error_message('''Can't find your Sublime Text executable at %s.
Please add "sublime_executable": "/path/to/subl" to your ~/.floorc.json and restart Sublime Text''' % subl)
            elif sublime.platform() == 'windows':
                subl = sys.executable
            else:
                raise Exception('WHAT PLATFORM ARE WE ON?!?!?')

            command = [subl]
            if get_workspace_window() is None:
                command.append('--new-window')
            command.append('--add')
            command.append(G.PROJECT_PATH)

            msg.debug('command:', command)
            p = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
            poll_result = p.poll()
            msg.debug('poll:', poll_result)

            set_workspace_window(cb)
Beispiel #2
0
 def pinocchio(self, host=None):
     floorc = utils.load_floorc_json()
     auth = floorc.get('AUTH', {}).get(host or G.DEFAULT_HOST, {})
     username = auth.get('username')
     secret = auth.get('secret')
     if not (username and secret):
         return self.error_message('You don\'t seem to have a Floobits account of any sort')
     webbrowser.open('https://%s/%s/pinocchio/%s' % (G.DEFAULT_HOST, username, secret))
Beispiel #3
0
 def pinocchio(self, host=None):
     floorc = utils.load_floorc_json()
     auth = floorc.get("AUTH", {}).get(host or G.DEFAULT_HOST, {})
     username = auth.get("username")
     secret = auth.get("secret")
     if not (username and secret):
         return self.error_message("You don't seem to have a Floobits account of any sort")
     webbrowser.open("https://%s/%s/pinocchio/%s" % (G.DEFAULT_HOST, username, secret))
Beispiel #4
0
 def pinocchio(self, host=None):
     floorc = utils.load_floorc_json()
     auth = floorc.get('AUTH', {}).get(host or G.DEFAULT_HOST, {})
     username = auth.get('username')
     secret = auth.get('secret')
     if not (username and secret):
         return self.error_message('You don\'t seem to have a Floobits account of any sort')
     webbrowser.open('https://%s/%s/pinocchio/%s' % (G.DEFAULT_HOST, username, secret))
Beispiel #5
0
        def open_workspace_window2(cb):
            if sublime.platform() == 'linux':
                subl = open('/proc/self/cmdline').read().split(chr(0))[0]
            elif sublime.platform() == 'osx':
                floorc = utils.load_floorc_json()
                subl = floorc.get('SUBLIME_EXECUTABLE')
                if not subl:
                    settings = sublime.load_settings(
                        'Floobits.sublime-settings')
                    subl = settings.get(
                        'sublime_executable',
                        '/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl'
                    )
                if not os.path.exists(subl):
                    return sublime.error_message(
                        '''Can't find your Sublime Text executable at %s.
Please add "sublime_executable": "/path/to/subl" to your ~/.floorc.json and restart Sublime Text'''
                        % subl)
            elif sublime.platform() == 'windows':
                subl = sys.executable
            else:
                raise Exception('WHAT PLATFORM ARE WE ON?!?!?')

            command = [subl]
            if get_workspace_window() is None:
                command.append('--new-window')
            command.append('--add')
            command.append(G.PROJECT_PATH)

            msg.debug('command:', command)
            p = subprocess.Popen(command,
                                 stdout=subprocess.PIPE,
                                 stderr=subprocess.PIPE)
            poll_result = p.poll()
            msg.debug('poll:', poll_result)

            set_workspace_window(cb)