示例#1
0
文件: core.py 项目: AKIo0O/sublime-v8
	def __init__(self, console):
		self.console = console
		def log(msg):
			print msg
			js_print_m(console, msg)
		self.console.log = log
		CommonJS.__init__(self)
示例#2
0
    def __init__(self, console):
        self.console = console

        def log(msg):
            print msg
            js_print_m(console, msg)

        self.console.log = log
        CommonJS.__init__(self)
示例#3
0
文件: core.py 项目: AKIo0O/sublime-v8
	if(not lib_path in sys.path):
		sys.path.append(os.path.join(MODULE_PATH, lib_path))
		sys.path.append(MODULE_PATH)

cross_platform();

try:
	import PyV8
except Exception, e:
	raise Exception, '''
		Sorry, the v8 engine are not built correctlly.
		Maybe you need to build v8 follow the guide of lib/PyV8/README.md. 
	''' 

from jscontext.commonjs import CommonJS
CommonJS.append(MODULE_PATH)

def package_file(filename):
	return os.path.join(MODULE_PATH, filename)	

JSCONSOLE_VIEW_NAME = 'jsconsole_view'
class JsConsoleCommand(sublime_plugin.WindowCommand):
	def __init__(self, window):
		self.console = window.get_output_panel(JSCONSOLE_VIEW_NAME)
		self.console.set_name(JSCONSOLE_VIEW_NAME)
		self.window = window
		version = sublime.load_settings('package-metadata.json').get('version') or 'dev'
		js_print_m(self.console, "#JavaScript Console (build:" + version + ")")
		JsConsoleCommand.core = JSCore(self.console)
	def run(self):
		if(not 'history' in dir(JsConsoleCommand)):
示例#4
0
        sys.path.append(os.path.join(MODULE_PATH, lib_path))
        sys.path.append(MODULE_PATH)


cross_platform()

try:
    import PyV8
except Exception, e:
    raise Exception, '''
		Sorry, the v8 engine are not built correctlly.
		Maybe you need to build v8 follow the guide of lib/PyV8/README.md. 
	'''

from jscontext.commonjs import CommonJS
CommonJS.append(MODULE_PATH)


def package_file(filename):
    return os.path.join(MODULE_PATH, filename)


JSCONSOLE_VIEW_NAME = 'jsconsole_view'


class JsConsoleCommand(sublime_plugin.WindowCommand):
    def __init__(self, window):
        self.console = window.get_output_panel(JSCONSOLE_VIEW_NAME)
        self.console.set_name(JSCONSOLE_VIEW_NAME)
        self.window = window
        version = sublime.load_settings('package-metadata.json').get(