def __init__(self, operation, **kwargs):
        self.operation = operation  #operation being requested
        self.project_name = kwargs.get('project_name', None)
        self.active_file = kwargs.get('active_file', None)
        self.params = kwargs.get('params', None)
        self.context = kwargs.get('context', None)
        self.mm_path = kwargs.get('mm_path', None)
        self.message = kwargs.get('message', None)
        self.view = None
        self.window = None
        self.printer = None
        self.process_id = time.strftime("%a, %d %b %Y %H:%M:%S",
                                        time.localtime())
        self.use_mm_panel = kwargs.get('use_mm_panel', False)
        self.result = None  #result of operation
        self.callback = handle_result
        self.alt_callback = kwargs.get(
            'callback', None)  #this is a callback requested by a command
        self.window_id = None
        self.status_region = None

        self.settings = sublime.load_settings('mavensmate.sublime-settings')
        self.define_sublime_context()
        self.printer = PanelPrinter.get(self.window.id())

        if self.message == None:
            self.message = command_helper.get_message(self.params,
                                                      self.operation)

        if self.project_name == None:
            self.project_name = util.get_project_name(self.window)

        if self.use_mm_panel:
            self.printer.show()
            self.printer.writeln(' ')
            self.printer.writeln(
                '                                                                          '
            )
            self.printer.writeln('Operation: ' + self.message)
            self.printer.writeln('Timestamp: ' + self.process_id)
            self.printer.writeln('   Result:           ')
        elif 'index' not in self.operation:
            ThreadProgress(self, self.message, 'Operation complete')

        threading.Thread.__init__(self)
Exemplo n.º 2
0
    def __init__(self, operation, **kwargs):
        self.operation      = operation #operation being requested
        self.active_file    = kwargs.get('active_file', None)
        self.body           = kwargs.get('body', None)
        self.context        = kwargs.get('context', None)
        self.message        = kwargs.get('message', None)
        self.flags          = kwargs.get('flags', None)
        self.view           = None
        self.window         = None
        self.printer        = None
        self.process_id     = time.strftime("%a, %d %b %Y %H:%M:%S", time.localtime())
        self.use_mm_panel   = kwargs.get('use_mm_panel', False)
        self.result         = None #result of operation
        self.callback       = handle_result
        self.alt_callback   = kwargs.get('callback', None) #this is a callback requested by a command
        self.window_id      = None
        self.status_region  = None
        self.sandbox        = None

        self.settings = sublime.load_settings('mavensmate.sublime-settings')
        self.define_sublime_context()
        self.printer = PanelPrinter.get(self.window.id())

        if self.message == None:
            self.message = command_helper.get_message(self.body, self.operation)

        new_sandbox = ping_local_host()
        if new_sandbox and new_sandbox != MavensMateAdapterCall.old_sandbox:
            MavensMateAdapterCall.old_sandbox = new_sandbox

        if self.use_mm_panel:
            self.printer.show()
            self.printer.writeln(' ')
            self.printer.writeln('                                                                          ')
            self.printer.writeln('OPERATION : '+self.message)
            self.printer.writeln('Timestamp : '+self.process_id)
            self.printer.writeln('Sandbox   : '+MavensMateAdapterCall.old_sandbox)
            self.printer.writeln('   Result:           ')
        elif 'index' not in self.operation:
            ThreadProgress(self, self.message, 'Operation complete')
        threading.Thread.__init__(self)
    def __init__(self, operation, **kwargs):
        self.operation      = operation #operation being requested
        self.project_name   = kwargs.get('project_name', None)
        self.active_file    = kwargs.get('active_file', None)
        self.params         = kwargs.get('params', None)
        self.context        = kwargs.get('context', None)
        self.mm_location    = kwargs.get('mm_location', None)
        self.message        = kwargs.get('message', None)
        self.view           = None
        self.window         = None
        self.printer        = None
        self.process_id     = time.strftime("%a, %d %b %Y %H:%M:%S", time.localtime())
        self.use_mm_panel   = kwargs.get('use_mm_panel', False)
        self.result         = None #result of operation
        self.callback       = handle_result
        self.alt_callback   = kwargs.get('callback', None) #this is a callback requested by a command
        self.window_id      = None
        self.status_region  = None

        self.settings = sublime.load_settings('mavensmate.sublime-settings')
        self.define_sublime_context()
        self.printer = PanelPrinter.get(self.window.id())

        if self.message == None:
            self.message = command_helper.get_message(self.params, self.operation)
        
        if self.project_name == None:
            self.project_name = util.get_project_name(self.window)

        if self.use_mm_panel:
            self.printer.show()
            self.printer.writeln(' ')
            self.printer.writeln('                                                                          ')
            self.printer.writeln('Operation: '+self.message)
            self.printer.writeln('Timestamp: '+self.process_id)
            self.printer.writeln('   Result:           ')
        elif 'index' not in self.operation:
            ThreadProgress(self, self.message, 'Operation complete')

        threading.Thread.__init__(self)