コード例 #1
0
    def _wrap_js_content(self, path):
        template = '''"use strict";
(function() {
var exports = {};
%s
})();'''
        replace_file_content(path, lambda c: template % c)
コード例 #2
0
    def _wrap_js_content(self, path):
        template = '''"use strict";
(function() {
var exports = {};
%s
})();'''
        replace_file_content(path, lambda c: template % c)
コード例 #3
0
    def _wrap_js_module(self, extension_out_path, path):
        template = '''"use strict";
_kangoLoader.add("%s", function(require, exports, module) {
%s
});'''
        module_id = os.path.relpath(path, extension_out_path).replace('.js', '').replace('\\', '/')
        replace_file_content(path, lambda c: template % (module_id, c))
コード例 #4
0
    def _wrap_js_module(self, extension_out_path, path):
        template = '''"use strict";
_kangoLoader.add("%s", function(require, exports, module) {
%s
});'''
        module_id = os.path.relpath(path, extension_out_path).replace('.js', '').replace('\\', '/')
        replace_file_content(path, lambda c: template % (module_id, c))
コード例 #5
0
ファイル: build.py プロジェクト: alani1/KAPolyglott
    def _wrap_js_module(self, extension_out_path, path):
        template = """"use strict";
_kangoLoader.add("%s", function(require, exports, module) {
%s
});"""
        module_id = os.path.relpath(path, extension_out_path).replace(".js", "").replace("\\", "/")
        replace_file_content(path, lambda c: template % (module_id, c))
コード例 #6
0
 def patch_background_host(self, path, modules):
     replace_file_content(path, lambda c: self.insert_modules(c, modules))
コード例 #7
0
 def _add_text_to_beginning(self, path, text):
     replace_file_content(path, lambda c: text + c)
コード例 #8
0
 def patch_background_host(self, path, modules):
     replace_file_content(path, lambda c: self.insert_modules(c, modules))
コード例 #9
0
 def _patch_chrome_manifest(self, path):
     replace_file_content(path, lambda c: c.replace(KEYWORDS['product'], self._info.package_id), 'ascii')
コード例 #10
0
 def _patch_chrome_manifest(self, path):
     replace_file_content(path, lambda c: c.replace(KEYWORDS['product'], self._info.package_id), 'ascii')