示例#1
0
文件: mm.py 项目: vazexqi/mm
def main():
    parser = argparse.ArgumentParser()
    parser.add_argument('-o', '--operation', help='The requested operation') #name of the operation being requested
    parser.add_argument('-c', '--client', help='The plugin client being used') #name of the plugin client ("SUBLIME_TEXT_2", "SUBLIME_TEXT_3", "TEXTMATE", "NOTEPAD_PLUS_PLUS", "BB_EDIT", etc.)
    parser.add_argument('--ui', action='store_true', default=False, 
        dest='ui_switch', help='Launch the default UI for the operation')
    parser.add_argument('--quiet', action='store_true', default=False, 
        dest='quiet', help='Suppresses mm.py output')
    parser.add_argument('--html', action='store_true', default=False, 
        dest='respond_with_html', help='Makes various commands return HTML')
    parser.add_argument('--v', '--verbose', action='store_true', default=False, 
        dest='verbose', help='Makes me really loud and annoying')
    args, unknown = parser.parse_known_args()
    payload = util.get_request_payload()
    try:
        r = MavensMateRequest(args=args, payload=payload, unknown_args=unknown)
        response = r.execute()

        r.output.close()
        sys.stdout = r.saved_stdout

        config.logger.debug('\n\n')
        config.logger.debug('---------------------')
        config.logger.debug('RESPONDING TO REQUEST')
        config.logger.debug('---------------------')
        config.logger.debug('\n')
        config.logger.debug(response)

        print response
    except Exception as e:
        print util.generate_error_response(e.message)
示例#2
0
文件: mm.py 项目: e-bacho/mm
def main():
    parser = argparse.ArgumentParser()
    parser.add_argument('-o', '--operation') #name of the operation being requested
    parser.add_argument('-c', '--client') #name of the plugin client ("SUBLIME_TEXT_2", "SUBLIME_TEXT_3", "TEXTMATE", "NOTEPAD_PLUS_PLUS", "BB_EDIT", etc.)
    parser.add_argument('--ui', action='store_true', default=False, 
        dest='ui_switch', help='Include flag to launch the default UI for the operation')
    parser.add_argument('--quiet', action='store_true', default=False, 
        dest='quiet', help='To suppress mm.py output, use this flag')
    parser.add_argument('--html', action='store_true', default=False, 
        dest='respond_with_html', help='Include flag if you want the response in HTML')
    args = parser.parse_args()
    payload = util.get_request_payload()
    
    try:
        r = MavensMateRequest(args=args, payload=payload)
        r.execute()
    except Exception as e:
        print util.generate_error_response(e.message)
示例#3
0
import os.path
import sys
import argparse
import traceback
import inspect
import json
import lib.config as config
import lib.mm_util as util
import time  #TODO: remove
import urllib
from suds.client import Client
from lib.mm_connection import MavensMatePluginConnection
from lib.mm_client import MavensMateClient
from lib.mm_exceptions import MMException

request_payload = util.get_request_payload()


#config.logger.debug('\n\n\n>>>>>>>>\nhandling request with payload >>>>>')
#config.logger.debug(request_payload)
def main():
    parser = argparse.ArgumentParser()
    parser.add_argument('-o',
                        '--operation')  #name of the operation being requested
    parser.add_argument(
        '-c', '--client'
    )  #name of the plugin client ("SUBLIME_TEXT_2", "SUBLIME_TEXT_3", "TEXTMATE", "NOTEPAD_PLUS_PLUS", "BB_EDIT", etc.)
    parser.add_argument('-p', '--projectname')  #name of the project
    parser.add_argument('-d', '--projectdirectory')  #name of the project
    parser.add_argument(
        '--callback'
示例#4
0
import os.path
import sys
import argparse
import traceback
import inspect
import json
import lib.config as config
import lib.mm_util as util
import time #TODO: remove
import urllib
from suds.client import Client
from lib.mm_connection import MavensMatePluginConnection
from lib.mm_client import MavensMateClient
from lib.mm_exceptions import MMException

request_payload = util.get_request_payload()
#config.logger.debug('\n\n\n>>>>>>>>\nhandling request with payload >>>>>')
#config.logger.debug(request_payload)
def main():
    parser = argparse.ArgumentParser()
    parser.add_argument('-o', '--operation') #name of the operation being requested
    parser.add_argument('-c', '--client') #name of the plugin client ("SUBLIME_TEXT_2", "SUBLIME_TEXT_3", "TEXTMATE", "NOTEPAD_PLUS_PLUS", "BB_EDIT", etc.)
    parser.add_argument('-p', '--projectname') #name of the project
    parser.add_argument('-d', '--projectdirectory') #name of the project
    parser.add_argument('--callback') #some terminal script to run upon completion of a command
    parser.add_argument('--ui', action='store_true', default=False, 
        dest='ui_switch', help='Include flag to launch the default UI for the operation')
    parser.add_argument('--html', action='store_true', default=False, 
        dest='respond_with_html', help='Include flag if you want the response in HTML')
    args = parser.parse_args()
    operation = args.operation