-
Notifications
You must be signed in to change notification settings - Fork 1
/
CopyCode.py
38 lines (29 loc) · 949 Bytes
/
CopyCode.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# This file is part of sublime-copy-code-snippet.
# https://github.com/socsieng/sublime-copy-code-snippet
# Licensed under the MIT license:
# http://www.opensource.org/licenses/MIT-license
# Copyright (c) 2015, Socheat Sieng <socsieng@gmail.com>
import os
import sys
import sublime
import sublime_plugin
import imp
reloader_name = 'copy_code.package_util.reloader'
try:
if reloader_name in sys.modules:
imp.reload(sys.modules[reloader_name])
else:
import copy_code.package_util.reloader
except:
pass
from .copy_code import commands
class CopySnippetCommand(sublime_plugin.TextCommand):
def __init__(self, view):
sublime_plugin.TextCommand.__init__(self, view)
self.command = commands.CopySnippetCommand(self.view, sublime)
def is_enabled(self):
return self.command.is_enabled()
def run(self, edit):
self.command.run(edit)